From 446851fce9b5f7428896dae91f9db1360c5babb9 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Fri, 13 Dec 2024 18:18:05 +0200 Subject: [PATCH 01/15] chore: rename packages in /sdk Signed-off-by: Ivan Ivanov --- .../sdk/examples/AccountAliasExample.java | 5 +- .../sdk/examples/AccountAllowanceExample.java | 5 +- .../examples/AccountCreateWithHtsExample.java | 5 +- ...eateAccountTransferTransactionExample.java | 5 +- .../sdk/examples/ChangeRemoveTokenKeys.java | 5 +- .../ConsensusPubSubChunkedExample.java | 5 +- .../sdk/examples/ConsensusPubSubExample.java | 5 +- .../ConsensusPubSubWithSubmitKeyExample.java | 5 +- .../sdk/examples/ContractNoncesExample.java | 5 +- .../sdk/examples/CreateAccountExample.java | 5 +- .../CreateAccountThresholdKeyExample.java | 5 +- .../CreateAccountWithAliasExample.java | 5 +- .../sdk/examples/CreateFileExample.java | 7 +- .../examples/CreateSimpleContractExample.java | 5 +- .../CreateStatefulContractExample.java | 5 +- .../sdk/examples/CreateTopicExample.java | 5 +- .../sdk/examples/CustomFeesExample.java | 5 +- .../sdk/examples/ExampleTemplate.java | 4 +- .../sdk/examples/ExemptCustomFeesExample.java | 5 +- .../examples/FileAppendChunkedExample.java | 5 +- .../examples/GetAccountBalanceExample.java | 4 +- .../sdk/examples/GetAccountInfoExample.java | 5 +- .../sdk/examples/GetAddressBookExample.java | 4 +- .../sdk/examples/GetExchangeRatesExample.java | 5 +- .../sdk/examples/GetFileContentsExample.java | 5 +- ...tializeClientWithMirrorNetworkExample.java | 4 +- .../LoggerFunctionalitiesExample.java | 5 +- .../LongTermScheduledTransactionExample.java | 4 +- .../MirrorNodeContractQueriesExample.java | 4 +- .../sdk/examples/MultiAppTransferExample.java | 5 +- .../sdk/examples/MultiSigOfflineExample.java | 5 +- .../NftAddRemoveAllowancesExample.java | 5 +- .../hashgraph/sdk/examples/PrngExample.java | 5 +- .../sdk/examples/ScheduleExample.java | 5 +- .../ScheduleIdenticalTransactionExample.java | 5 +- .../ScheduleMultiSigTransactionExample.java | 5 +- ...edTransactionMultiSigThresholdExample.java | 5 +- .../examples/ScheduledTransferExample.java | 5 +- .../sdk/examples/SignTransactionExample.java | 5 +- .../sdk/examples/StakingExample.java | 5 +- .../examples/StakingWithUpdateExample.java | 5 +- .../sdk/examples/TokenAirdropExample.java | 4 +- .../sdk/examples/TokenMetadataExample.java | 5 +- .../sdk/examples/TokenRejectExample.java | 5 +- .../examples/TopicWithAdminKeyExample.java | 5 +- .../TransactionSerializationExample.java | 5 +- .../sdk/examples/TransferCryptoExample.java | 5 +- .../sdk/examples/TransferTokensExample.java | 5 +- .../TransferUsingEvmAddressExample.java | 5 +- .../UpdateAccountPublicKeyExample.java | 5 +- .../examples/UpdateNftsMetadataExample.java | 5 +- .../sdk/examples/ValidateChecksumExample.java | 5 +- .../examples/ZeroTokenOperationsExample.java | 5 +- scripts/update_protobufs.py | 6 +- .../sdk/AbstractTokenTransferTransaction.java | 20 +-- .../AccountAllowanceAdjustTransaction.java | 16 +-- .../AccountAllowanceApproveTransaction.java | 20 +-- .../AccountAllowanceDeleteTransaction.java | 20 +-- .../sdk/AccountBalance.java | 6 +- .../sdk/AccountBalanceQuery.java | 20 +-- .../sdk/AccountCreateTransaction.java | 20 +-- .../sdk/AccountDeleteTransaction.java | 18 +-- .../hashgraph => hiero}/sdk/AccountId.java | 4 +- .../hashgraph => hiero}/sdk/AccountInfo.java | 8 +- .../sdk/AccountInfoFlow.java | 2 +- .../sdk/AccountInfoQuery.java | 20 +-- .../sdk/AccountRecordsQuery.java | 20 +-- .../sdk/AccountStakersQuery.java | 20 +-- .../sdk/AccountUpdateTransaction.java | 18 +-- .../sdk/AddressBookQuery.java | 16 +-- .../sdk/AssessedCustomFee.java | 12 +- .../sdk/BadEntityIdException.java | 2 +- .../sdk/BadKeyException.java | 2 +- .../sdk/BadMnemonicException.java | 2 +- .../sdk/BadMnemonicReason.java | 2 +- .../hashgraph => hiero}/sdk/BaseNetwork.java | 2 +- .../hashgraph => hiero}/sdk/BaseNode.java | 2 +- .../sdk/BaseNodeAddress.java | 2 +- .../sdk/ChunkedTransaction.java | 18 +-- .../hashgraph => hiero}/sdk/Client.java | 30 ++--- .../sdk/ConsumerHelper.java | 2 +- .../sdk/ContractByteCodeQuery.java | 20 +-- .../sdk/ContractCallQuery.java | 20 +-- .../sdk/ContractCreateFlow.java | 2 +- .../sdk/ContractCreateTransaction.java | 18 +-- .../sdk/ContractDeleteTransaction.java | 18 +-- .../sdk/ContractExecuteTransaction.java | 18 +-- .../sdk/ContractFunctionParameters.java | 2 +- .../sdk/ContractFunctionResult.java | 10 +- .../sdk/ContractFunctionSelector.java | 2 +- .../hashgraph => hiero}/sdk/ContractId.java | 8 +- .../hashgraph => hiero}/sdk/ContractInfo.java | 4 +- .../sdk/ContractInfoQuery.java | 20 +-- .../sdk/ContractLogInfo.java | 10 +- .../sdk/ContractNonceInfo.java | 10 +- .../sdk/ContractStateChange.java | 10 +- .../sdk/ContractUpdateTransaction.java | 20 +-- .../hashgraph => hiero}/sdk/Crypto.java | 2 +- .../hashgraph => hiero}/sdk/CustomFee.java | 12 +- .../sdk/CustomFeeBase.java | 2 +- .../sdk/CustomFixedFee.java | 8 +- .../sdk/CustomFractionalFee.java | 10 +- .../sdk/CustomRoyaltyFee.java | 10 +- .../hashgraph => hiero}/sdk/Delayer.java | 2 +- .../sdk/DelegateContractId.java | 8 +- .../sdk/DurationConverter.java | 8 +- .../hashgraph => hiero}/sdk/Endpoint.java | 4 +- .../sdk/EntityIdHelper.java | 2 +- .../hashgraph => hiero}/sdk/EthereumFlow.java | 2 +- .../sdk/EthereumTransaction.java | 18 +-- .../sdk/EthereumTransactionData.java | 2 +- .../sdk/EthereumTransactionDataEip1559.java | 2 +- .../sdk/EthereumTransactionDataLegacy.java | 2 +- .../hashgraph => hiero}/sdk/EvmAddress.java | 6 +- .../hashgraph => hiero}/sdk/ExchangeRate.java | 4 +- .../sdk/ExchangeRates.java | 6 +- .../hashgraph => hiero}/sdk/Executable.java | 8 +- .../sdk/ExecutionState.java | 2 +- .../sdk/FeeAssessmentMethod.java | 2 +- .../sdk/FeeComponents.java | 10 +- .../hashgraph => hiero}/sdk/FeeData.java | 12 +- .../hashgraph => hiero}/sdk/FeeDataType.java | 4 +- .../hashgraph => hiero}/sdk/FeeSchedule.java | 10 +- .../hashgraph => hiero}/sdk/FeeSchedules.java | 4 +- .../sdk/FileAppendTransaction.java | 22 +-- .../sdk/FileContentsQuery.java | 20 +-- .../sdk/FileCreateTransaction.java | 26 ++-- .../sdk/FileDeleteTransaction.java | 22 +-- .../hashgraph => hiero}/sdk/FileId.java | 4 +- .../hashgraph => hiero}/sdk/FileInfo.java | 6 +- .../sdk/FileInfoQuery.java | 20 +-- .../sdk/FileUpdateTransaction.java | 22 +-- .../sdk/FreezeTransaction.java | 22 +-- .../hashgraph => hiero}/sdk/FreezeType.java | 20 +-- .../sdk/FutureConverter.java | 2 +- .../{hedera/hashgraph => hiero}/sdk/Hbar.java | 20 +-- .../sdk/HbarAllowance.java | 6 +- .../hashgraph => hiero}/sdk/HbarUnit.java | 2 +- .../sdk/HederaPreCheckStatusException.java | 2 +- .../sdk/HederaReceiptStatusException.java | 2 +- .../sdk/HederaTrustManager.java | 2 +- .../sdk/InstantConverter.java | 6 +- .../{hedera/hashgraph => hiero}/sdk/Key.java | 8 +- .../hashgraph => hiero}/sdk/KeyList.java | 18 +-- .../hashgraph => hiero}/sdk/Keystore.java | 2 +- .../hashgraph => hiero}/sdk/LedgerId.java | 2 +- .../hashgraph => hiero}/sdk/LiveHash.java | 12 +- .../sdk/LiveHashAddTransaction.java | 20 +-- .../sdk/LiveHashDeleteTransaction.java | 18 +-- .../sdk/LiveHashQuery.java | 20 +-- .../hashgraph => hiero}/sdk/LockableList.java | 2 +- .../sdk/MaxAttemptsExceededException.java | 2 +- .../sdk/MaxQueryPaymentExceededException.java | 2 +- .../sdk/MirrorNetwork.java | 2 +- .../hashgraph => hiero}/sdk/MirrorNode.java | 2 +- .../sdk/MirrorNodeContractCallQuery.java | 2 +- .../MirrorNodeContractEstimateGasQuery.java | 2 +- .../sdk/MirrorNodeContractQuery.java | 8 +- .../hashgraph => hiero}/sdk/Mnemonic.java | 4 +- .../hashgraph => hiero}/sdk/Network.java | 4 +- .../hashgraph => hiero}/sdk/NetworkName.java | 2 +- .../sdk/NetworkVersionInfo.java | 4 +- .../sdk/NetworkVersionInfoQuery.java | 20 +-- .../hashgraph => hiero}/sdk/NftId.java | 4 +- .../{hedera/hashgraph => hiero}/sdk/Node.java | 2 +- .../hashgraph => hiero}/sdk/NodeAddress.java | 10 +- .../sdk/NodeAddressBook.java | 10 +- .../sdk/NodeCreateTransaction.java | 20 +-- .../sdk/NodeDeleteTransaction.java | 18 +-- .../sdk/NodeUpdateTransaction.java | 20 +-- .../{hedera/hashgraph => hiero}/sdk/Pem.java | 2 +- .../sdk/PendingAirdropId.java | 8 +- .../sdk/PendingAirdropLogic.java | 6 +- .../sdk/PendingAirdropRecord.java | 10 +- .../sdk/PrecheckStatusException.java | 2 +- .../hashgraph => hiero}/sdk/PrivateKey.java | 12 +- .../sdk/PrivateKeyECDSA.java | 4 +- .../sdk/PrivateKeyED25519.java | 4 +- .../sdk/PrngTransaction.java | 8 +- .../hashgraph => hiero}/sdk/ProxyStaker.java | 4 +- .../hashgraph => hiero}/sdk/PublicKey.java | 6 +- .../sdk/PublicKeyECDSA.java | 10 +- .../sdk/PublicKeyED25519.java | 8 +- .../hashgraph => hiero}/sdk/Query.java | 38 +++--- .../sdk/ReceiptStatusException.java | 2 +- .../hashgraph => hiero}/sdk/RequestType.java | 4 +- .../sdk/ScheduleCreateTransaction.java | 18 +-- .../sdk/ScheduleDeleteTransaction.java | 20 +-- .../hashgraph => hiero}/sdk/ScheduleId.java | 4 +- .../hashgraph => hiero}/sdk/ScheduleInfo.java | 14 +- .../sdk/ScheduleInfoQuery.java | 20 +-- .../sdk/ScheduleSignTransaction.java | 18 +-- .../sdk/SemanticVersion.java | 10 +- .../hashgraph => hiero}/sdk/StakingInfo.java | 10 +- .../hashgraph => hiero}/sdk/Status.java | 4 +- .../sdk/StorageChange.java | 10 +- .../sdk/SubscriptionHandle.java | 2 +- .../sdk/SystemDeleteTransaction.java | 22 +-- .../sdk/SystemUndeleteTransaction.java | 22 +-- .../sdk/ThreadLocalSecureRandom.java | 2 +- .../sdk/TokenAirdropTransaction.java | 20 +-- .../sdk/TokenAllowance.java | 12 +- .../sdk/TokenAssociateTransaction.java | 20 +-- .../sdk/TokenAssociation.java | 10 +- .../sdk/TokenBurnTransaction.java | 22 +-- .../sdk/TokenCancelAirdropTransaction.java | 20 +-- .../sdk/TokenClaimAirdropTransaction.java | 20 +-- .../sdk/TokenCreateTransaction.java | 22 +-- .../sdk/TokenDeleteTransaction.java | 22 +-- .../sdk/TokenDissociateTransaction.java | 22 +-- .../TokenFeeScheduleUpdateTransaction.java | 20 +-- .../sdk/TokenFreezeTransaction.java | 22 +-- .../sdk/TokenGrantKycTransaction.java | 22 +-- .../hashgraph => hiero}/sdk/TokenId.java | 4 +- .../hashgraph => hiero}/sdk/TokenInfo.java | 14 +- .../sdk/TokenInfoQuery.java | 20 +-- .../sdk/TokenKeyValidation.java | 14 +- .../sdk/TokenMintTransaction.java | 22 +-- .../sdk/TokenNftAllowance.java | 8 +- .../hashgraph => hiero}/sdk/TokenNftInfo.java | 10 +- .../sdk/TokenNftInfoQuery.java | 24 ++-- .../sdk/TokenNftTransfer.java | 8 +- .../sdk/TokenPauseTransaction.java | 20 +-- .../sdk/TokenRejectFlow.java | 2 +- .../sdk/TokenRejectTransaction.java | 22 +-- .../sdk/TokenRelationship.java | 14 +- .../sdk/TokenRevokeKycTransaction.java | 22 +-- .../sdk/TokenSupplyType.java | 14 +- .../sdk/TokenTransfer.java | 6 +- .../sdk/TokenTransferList.java | 10 +- .../hashgraph => hiero}/sdk/TokenType.java | 14 +- .../sdk/TokenUnfreezeTransaction.java | 22 +-- .../sdk/TokenUnpauseTransaction.java | 20 +-- .../sdk/TokenUpdateNftsTransaction.java | 20 +-- .../sdk/TokenUpdateTransaction.java | 20 +-- .../sdk/TokenWipeTransaction.java | 22 +-- .../sdk/TopicCreateTransaction.java | 20 +-- .../sdk/TopicDeleteTransaction.java | 20 +-- .../hashgraph => hiero}/sdk/TopicId.java | 4 +- .../hashgraph => hiero}/sdk/TopicInfo.java | 6 +- .../sdk/TopicInfoQuery.java | 20 +-- .../hashgraph => hiero}/sdk/TopicMessage.java | 4 +- .../sdk/TopicMessageChunk.java | 4 +- .../sdk/TopicMessageQuery.java | 12 +- .../sdk/TopicMessageSubmitTransaction.java | 24 ++-- .../sdk/TopicUpdateTransaction.java | 20 +-- .../hashgraph => hiero}/sdk/Transaction.java | 50 +++---- .../sdk/TransactionFeeSchedule.java | 12 +- .../sdk/TransactionId.java | 6 +- .../sdk/TransactionReceipt.java | 20 +-- .../sdk/TransactionReceiptQuery.java | 22 +-- .../sdk/TransactionRecord.java | 20 +-- .../sdk/TransactionRecordQuery.java | 22 +-- .../sdk/TransactionResponse.java | 6 +- .../hashgraph => hiero}/sdk/Transfer.java | 4 +- .../sdk/TransferTransaction.java | 24 ++-- .../sdk/logger/LogLevel.java | 2 +- .../sdk/logger/Logger.java | 2 +- .../hashgraph => hiero}/sdk/package-info.java | 2 +- .../sdk/utils/Bip32Utils.java | 2 +- sdk/src/main/java/module-info.java | 8 +- sdk/src/main/proto/account.proto | 2 +- .../main/proto/account_pending_airdrop.proto | 2 +- sdk/src/main/proto/address_book_service.proto | 2 +- sdk/src/main/proto/basic_types.proto | 2 +- sdk/src/main/proto/block_info.proto | 2 +- sdk/src/main/proto/block_stream_info.proto | 2 +- sdk/src/main/proto/bytecode.proto | 2 +- sdk/src/main/proto/common.proto | 2 +- .../main/proto/congestion_level_starts.proto | 2 +- .../main/proto/consensus_create_topic.proto | 2 +- .../main/proto/consensus_delete_topic.proto | 2 +- .../main/proto/consensus_get_topic_info.proto | 2 +- sdk/src/main/proto/consensus_service.proto | 2 +- .../main/proto/consensus_submit_message.proto | 2 +- sdk/src/main/proto/consensus_topic_info.proto | 6 +- .../main/proto/consensus_update_topic.proto | 2 +- sdk/src/main/proto/contract_call.proto | 2 +- sdk/src/main/proto/contract_call_local.proto | 48 +++---- sdk/src/main/proto/contract_create.proto | 10 +- sdk/src/main/proto/contract_delete.proto | 8 +- .../main/proto/contract_get_bytecode.proto | 2 +- sdk/src/main/proto/contract_get_info.proto | 10 +- sdk/src/main/proto/contract_get_records.proto | 2 +- sdk/src/main/proto/contract_types.proto | 4 +- sdk/src/main/proto/contract_update.proto | 8 +- sdk/src/main/proto/crypto_add_live_hash.proto | 4 +- .../main/proto/crypto_approve_allowance.proto | 4 +- sdk/src/main/proto/crypto_create.proto | 6 +- sdk/src/main/proto/crypto_delete.proto | 2 +- .../main/proto/crypto_delete_allowance.proto | 2 +- .../main/proto/crypto_delete_live_hash.proto | 2 +- .../proto/crypto_get_account_balance.proto | 8 +- .../proto/crypto_get_account_records.proto | 2 +- sdk/src/main/proto/crypto_get_info.proto | 10 +- sdk/src/main/proto/crypto_get_live_hash.proto | 2 +- sdk/src/main/proto/crypto_get_stakers.proto | 2 +- sdk/src/main/proto/crypto_service.proto | 2 +- sdk/src/main/proto/crypto_transfer.proto | 4 +- sdk/src/main/proto/crypto_update.proto | 6 +- sdk/src/main/proto/custom_fees.proto | 28 ++-- sdk/src/main/proto/duration.proto | 2 +- sdk/src/main/proto/ethereum_transaction.proto | 22 +-- sdk/src/main/proto/exchange_rate.proto | 4 +- sdk/src/main/proto/file.proto | 4 +- sdk/src/main/proto/file_append.proto | 4 +- sdk/src/main/proto/file_create.proto | 6 +- sdk/src/main/proto/file_delete.proto | 2 +- sdk/src/main/proto/file_get_contents.proto | 2 +- sdk/src/main/proto/file_get_info.proto | 4 +- sdk/src/main/proto/file_service.proto | 4 +- sdk/src/main/proto/file_update.proto | 4 +- sdk/src/main/proto/freeze.proto | 2 +- sdk/src/main/proto/freeze_service.proto | 2 +- sdk/src/main/proto/freeze_type.proto | 38 +++--- sdk/src/main/proto/get_account_details.proto | 2 +- sdk/src/main/proto/get_by_key.proto | 2 +- sdk/src/main/proto/get_by_solidity_id.proto | 2 +- sdk/src/main/proto/ledger_id.proto | 2 +- .../main/proto/mirror/consensus_service.proto | 2 +- .../proto/mirror/mirror_network_service.proto | 2 +- .../proto/network_get_execution_time.proto | 8 +- .../main/proto/network_get_version_info.proto | 2 +- sdk/src/main/proto/network_service.proto | 8 +- .../main/proto/network_staking_rewards.proto | 2 +- sdk/src/main/proto/nft.proto | 6 +- sdk/src/main/proto/node.proto | 2 +- sdk/src/main/proto/node_create.proto | 2 +- sdk/src/main/proto/node_delete.proto | 2 +- sdk/src/main/proto/node_stake_update.proto | 32 ++--- sdk/src/main/proto/node_update.proto | 2 +- sdk/src/main/proto/primitives.proto | 2 +- sdk/src/main/proto/query.proto | 2 +- sdk/src/main/proto/query_header.proto | 6 +- sdk/src/main/proto/recordcache.proto | 2 +- sdk/src/main/proto/response.proto | 2 +- sdk/src/main/proto/response_code.proto | 2 +- sdk/src/main/proto/response_header.proto | 2 +- sdk/src/main/proto/roster.proto | 2 +- sdk/src/main/proto/roster_state.proto | 2 +- sdk/src/main/proto/running_hashes.proto | 2 +- .../proto/schedulable_transaction_body.proto | 2 +- sdk/src/main/proto/schedule.proto | 2 +- sdk/src/main/proto/schedule_create.proto | 22 +-- sdk/src/main/proto/schedule_delete.proto | 4 +- sdk/src/main/proto/schedule_get_info.proto | 10 +- sdk/src/main/proto/schedule_service.proto | 2 +- sdk/src/main/proto/schedule_sign.proto | 8 +- .../main/proto/smart_contract_service.proto | 4 +- sdk/src/main/proto/staking_node_info.proto | 2 +- sdk/src/main/proto/storage_slot.proto | 10 +- sdk/src/main/proto/system_delete.proto | 4 +- sdk/src/main/proto/system_undelete.proto | 4 +- sdk/src/main/proto/throttle_definitions.proto | 6 +- .../main/proto/throttle_usage_snapshots.proto | 2 +- sdk/src/main/proto/timestamp.proto | 2 +- sdk/src/main/proto/token.proto | 2 +- sdk/src/main/proto/token_airdrop.proto | 2 +- sdk/src/main/proto/token_associate.proto | 2 +- sdk/src/main/proto/token_burn.proto | 4 +- sdk/src/main/proto/token_cancel_airdrop.proto | 2 +- sdk/src/main/proto/token_claim_airdrop.proto | 2 +- sdk/src/main/proto/token_create.proto | 26 ++-- sdk/src/main/proto/token_delete.proto | 2 +- sdk/src/main/proto/token_dissociate.proto | 2 +- .../proto/token_fee_schedule_update.proto | 12 +- sdk/src/main/proto/token_freeze_account.proto | 2 +- .../proto/token_get_account_nft_infos.proto | 2 +- sdk/src/main/proto/token_get_info.proto | 4 +- sdk/src/main/proto/token_get_nft_info.proto | 4 +- sdk/src/main/proto/token_get_nft_infos.proto | 2 +- sdk/src/main/proto/token_grant_kyc.proto | 2 +- sdk/src/main/proto/token_mint.proto | 2 +- sdk/src/main/proto/token_pause.proto | 4 +- sdk/src/main/proto/token_reject.proto | 2 +- sdk/src/main/proto/token_relation.proto | 2 +- sdk/src/main/proto/token_revoke_kyc.proto | 2 +- sdk/src/main/proto/token_service.proto | 2 +- .../main/proto/token_unfreeze_account.proto | 2 +- sdk/src/main/proto/token_unpause.proto | 4 +- sdk/src/main/proto/token_update.proto | 12 +- sdk/src/main/proto/token_update_nfts.proto | 2 +- sdk/src/main/proto/token_wipe_account.proto | 6 +- sdk/src/main/proto/topic.proto | 18 +-- sdk/src/main/proto/transaction.proto | 8 +- sdk/src/main/proto/transaction_body.proto | 2 +- sdk/src/main/proto/transaction_contents.proto | 2 +- .../proto/transaction_get_fast_record.proto | 2 +- .../main/proto/transaction_get_receipt.proto | 8 +- .../main/proto/transaction_get_record.proto | 8 +- sdk/src/main/proto/transaction_list.proto | 2 +- sdk/src/main/proto/transaction_receipt.proto | 2 +- sdk/src/main/proto/transaction_record.proto | 6 +- sdk/src/main/proto/transaction_response.proto | 2 +- sdk/src/main/proto/unchecked_submit.proto | 4 +- sdk/src/main/proto/util_prng.proto | 2 +- sdk/src/main/proto/util_service.proto | 2 +- ...ccountAllowanceApproveTransactionTest.snap | 3 - ...AccountAllowanceDeleteTransactionTest.snap | 3 - .../sdk/AccountBalanceQueryTest.snap | 8 -- .../sdk/AccountCreateTransactionTest.snap | 8 -- .../sdk/AccountDeleteTransactionTest.snap | 3 - .../hedera/hashgraph/sdk/AccountIdTest.snap | 88 ------------ .../hashgraph/sdk/AccountInfoQueryTest.snap | 3 - .../sdk/AccountRecordsQueryTest.snap | 3 - .../sdk/AccountStakersQueryTest.snap | 3 - .../sdk/AccountUpdateTransactionTest.snap | 8 -- .../hashgraph/sdk/AssessedCustomFeeTest.snap | 13 -- .../sdk/ContractByteCodeQueryTest.snap | 3 - .../hashgraph/sdk/ContractCallQueryTest.snap | 8 -- .../sdk/ContractCreateTransactionTest.snap | 8 -- .../sdk/ContractDeleteTransactionTest.snap | 3 - .../sdk/ContractExecuteTransactionTest.snap | 3 - .../hedera/hashgraph/sdk/ContractIdTest.snap | 48 ------- .../hashgraph/sdk/ContractInfoQueryTest.snap | 3 - .../hashgraph/sdk/ContractLogInfoTest.snap | 18 --- .../sdk/ContractUpdateTransactionTest.snap | 8 -- .../sdk/CryptoTransferTransactionTest.snap | 3 - .../hashgraph/sdk/CustomFixedFeeTest.snap | 13 -- .../sdk/CustomFractionalFeeTest.snap | 8 -- .../hashgraph/sdk/CustomRoyaltyFeeTest.snap | 8 -- .../hashgraph/sdk/DelegateContractIdTest.snap | 28 ---- .../sdk/EthereumTransactionTest.snap | 3 - .../sdk/FileAppendTransactionTest.snap | 23 ---- .../hashgraph/sdk/FileContentsQueryTest.snap | 3 - .../sdk/FileCreateTransactionTest.snap | 3 - .../sdk/FileDeleteTransactionTest.snap | 3 - .../com/hedera/hashgraph/sdk/FileIdTest.snap | 23 ---- .../hashgraph/sdk/FileInfoQueryTest.snap | 3 - .../sdk/FileUpdateTransactionTest.snap | 3 - .../hashgraph/sdk/FreezeTransactionTest.snap | 3 - .../sdk/LiveHashAddTransactionTest.snap | 3 - .../sdk/LiveHashDeleteTransactionTest.snap | 3 - .../hashgraph/sdk/LiveHashQueryTest.snap | 3 - .../sdk/MessageSubmitTransactionTest.snap | 3 - .../sdk/NetworkVersionInfoQueryTest.snap | 3 - .../hashgraph/sdk/NetworkVersionInfoTest.snap | 3 - .../com/hedera/hashgraph/sdk/NftIdTest.snap | 33 ----- .../sdk/NodeCreateTransactionTest.snap | 3 - .../sdk/NodeDeleteTransactionTest.snap | 3 - .../sdk/NodeUpdateTransactionTest.snap | 3 - .../hashgraph/sdk/PrngTransactionTest.snap | 8 -- .../hedera/hashgraph/sdk/ProxyStakerTest.snap | 3 - .../sdk/ScheduleCreateTransactionTest.snap | 3 - .../sdk/ScheduleDeleteTransactionTest.snap | 3 - .../hashgraph/sdk/ScheduleInfoQueryTest.snap | 3 - .../sdk/ScheduleSignTransactionTest.snap | 3 - .../sdk/SystemDeleteTransactionTest.snap | 8 -- .../sdk/SystemUndeleteTransactionTest.snap | 8 -- .../sdk/TokenAirdropTransactionTest.snap | 3 - .../sdk/TokenAssociateTransactionTest.snap | 3 - .../hashgraph/sdk/TokenAssociationTest.snap | 3 - .../sdk/TokenBurnTransactionTest.snap | 8 -- .../TokenCancelAirdropTransactionTest.snap | 3 - .../sdk/TokenClaimAirdropTransactionTest.snap | 3 - .../sdk/TokenCreateTransactionTest.snap | 8 -- .../sdk/TokenDeleteTransactionTest.snap | 3 - .../sdk/TokenDissociateTransactionTest.snap | 3 - ...TokenFeeScheduleUpdateTransactionTest.snap | 3 - .../sdk/TokenFreezeTransactionTest.snap | 3 - .../sdk/TokenGrantKycTransactionTest.snap | 3 - .../hashgraph/sdk/TokenInfoQueryTest.snap | 3 - .../sdk/TokenMintTransactionTest.snap | 8 -- .../hashgraph/sdk/TokenNftInfoQueryTest.snap | 3 - .../sdk/TokenPauseTransactionTest.snap | 3 - .../sdk/TokenRejectTransactionTest.snap | 3 - .../sdk/TokenRevokeKycTransactionTest.snap | 3 - .../hashgraph/sdk/TokenSupplyTypeTest.snap | 10 -- .../hedera/hashgraph/sdk/TokenTypeTest.snap | 10 -- .../sdk/TokenUnfreezeTransactionTest.snap | 3 - .../sdk/TokenUnpauseTransactionTest.snap | 3 - .../sdk/TokenUpdateNftsTransactionTest.snap | 3 - .../sdk/TokenUpdateTransactionTest.snap | 3 - .../sdk/TokenWipeTransactionTest.snap | 8 -- .../sdk/TopicCreateTransactionTest.snap | 3 - .../sdk/TopicDeleteTransactionTest.snap | 3 - .../com/hedera/hashgraph/sdk/TopicIdTest.snap | 23 ---- .../hashgraph/sdk/TopicInfoQueryTest.snap | 3 - .../sdk/TopicUpdateTransactionTest.snap | 8 -- .../hashgraph/sdk/TransactionIdTest.snap | 8 -- .../sdk/TransactionReceiptQueryTest.snap | 3 - .../sdk/TransactionRecordQueryTest.snap | 3 - .../sdk => hiero}/logger/LoggerTest.java | 4 +- ...ccountAllowanceApproveTransactionTest.java | 15 ++- ...ccountAllowanceApproveTransactionTest.snap | 3 + ...AccountAllowanceDeleteTransactionTest.java | 13 +- ...AccountAllowanceDeleteTransactionTest.snap | 3 + .../sdk/AccountBalanceQueryTest.java | 11 +- .../hiero/sdk/AccountBalanceQueryTest.snap | 8 ++ .../sdk/AccountCreateTransactionTest.java | 15 ++- .../sdk/AccountCreateTransactionTest.snap | 8 ++ .../sdk/AccountDeleteTransactionTest.java | 12 +- .../sdk/AccountDeleteTransactionTest.snap | 3 + .../sdk/AccountIdTest.java | 6 +- .../java/com/hiero/sdk/AccountIdTest.snap | 88 ++++++++++++ .../sdk/AccountInfoQueryTest.java | 9 +- .../com/hiero/sdk/AccountInfoQueryTest.snap | 3 + .../sdk/AccountInfoTest.java | 14 +- .../sdk/AccountInfoTest.snap | 12 +- .../sdk/AccountRecordsQueryTest.java | 9 +- .../hiero/sdk/AccountRecordsQueryTest.snap | 3 + .../sdk/AccountStakersQueryTest.java | 9 +- .../hiero/sdk/AccountStakersQueryTest.snap | 3 + .../sdk/AccountUpdateTransactionTest.java | 14 +- .../sdk/AccountUpdateTransactionTest.snap | 8 ++ .../sdk/AddressBookQueryMockTest.java | 41 +++--- .../sdk/AllowancesTest.java | 8 +- .../sdk/AllowancesTest.snap | 4 +- .../sdk/AssessedCustomFeeTest.java | 9 +- .../com/hiero/sdk/AssessedCustomFeeTest.snap | 13 ++ .../sdk/BaseNodeAddressTest.java | 9 +- .../sdk/ClientCloseTest.java | 9 +- .../hashgraph => hiero}/sdk/ClientTest.java | 27 ++-- .../sdk/ConsumerHelperTest.java | 3 +- .../sdk/ContractByteCodeQueryTest.java | 8 +- .../hiero/sdk/ContractByteCodeQueryTest.snap | 3 + .../sdk/ContractCallQueryTest.java | 13 +- .../com/hiero/sdk/ContractCallQueryTest.snap | 8 ++ .../sdk/ContractCreateTransactionTest.java | 15 ++- .../sdk/ContractCreateTransactionTest.snap | 8 ++ .../sdk/ContractDeleteTransactionTest.java | 13 +- .../sdk/ContractDeleteTransactionTest.snap | 3 + .../sdk/ContractExecuteTransactionTest.java | 13 +- .../sdk/ContractExecuteTransactionTest.snap | 3 + .../sdk/ContractFunctionParametersTest.java | 4 +- .../sdk/ContractFunctionParametersTest.snap | 4 +- .../sdk/ContractFunctionResultTest.java | 10 +- .../sdk/ContractFunctionSelectorTest.java | 3 +- .../sdk/ContractIdTest.java | 3 +- .../java/com/hiero/sdk/ContractIdTest.snap | 48 +++++++ .../sdk/ContractInfoQueryTest.java | 8 +- .../com/hiero/sdk/ContractInfoQueryTest.snap | 3 + .../sdk/ContractInfoTest.java | 10 +- .../sdk/ContractInfoTest.snap | 10 +- .../sdk/ContractLogInfoTest.java | 6 +- .../com/hiero/sdk/ContractLogInfoTest.snap | 18 +++ .../sdk/ContractNonceInfoTest.java | 8 +- .../sdk/ContractNonceInfoTest.snap | 10 +- .../sdk/ContractUpdateTransactionTest.java | 15 ++- .../sdk/ContractUpdateTransactionTest.snap | 8 ++ .../sdk/CryptoTransferTransactionTest.java | 20 ++- .../sdk/CryptoTransferTransactionTest.snap | 3 + .../sdk/CustomFeeListTest.java | 8 +- .../sdk/CustomFeeListTest.snap | 6 +- .../sdk/CustomFixedFeeTest.java | 8 +- .../com/hiero/sdk/CustomFixedFeeTest.snap | 13 ++ .../sdk/CustomFractionalFeeTest.java | 9 +- .../hiero/sdk/CustomFractionalFeeTest.snap | 8 ++ .../sdk/CustomRoyaltyFeeTest.java | 11 +- .../com/hiero/sdk/CustomRoyaltyFeeTest.snap | 8 ++ .../sdk/DelegateContractIdTest.java | 3 +- .../com/hiero/sdk/DelegateContractIdTest.snap | 28 ++++ .../sdk/DuplicateTransactionTest.java | 4 +- .../sdk/ECDSAPrivateKeyTest.java | 5 +- .../sdk/ECDSAPublicKeyTest.java | 14 +- .../sdk/Ed25519PrivateKeyTest.java | 5 +- .../sdk/Ed25519PublicKeyTest.java | 17 ++- .../sdk/EthereumFlowMockTest.java | 28 ++-- .../EthereumTransactionDataLegacyTest.java | 5 +- .../sdk/EthereumTransactionTest.java | 10 +- .../hiero/sdk/EthereumTransactionTest.snap | 3 + .../sdk/ExchangeRatesTest.java | 3 +- .../sdk/ExecutableTest.java | 125 ++++++++++-------- .../sdk/FeeAssessmentMethodTest.java | 6 +- .../sdk/FeeSchedulesTest.java | 7 +- .../sdk/FeeSchedulesTest.snap | 4 +- .../sdk/FileAppendTransactionTest.java | 16 ++- .../hiero/sdk/FileAppendTransactionTest.snap | 23 ++++ .../sdk/FileContentsQueryTest.java | 8 +- .../com/hiero/sdk/FileContentsQueryTest.snap | 3 + .../sdk/FileCreateTransactionTest.java | 12 +- .../hiero/sdk/FileCreateTransactionTest.snap | 3 + .../sdk/FileDeleteTransactionTest.java | 13 +- .../hiero/sdk/FileDeleteTransactionTest.snap | 3 + .../hashgraph => hiero}/sdk/FileIdTest.java | 3 +- .../test/java/com/hiero/sdk/FileIdTest.snap | 23 ++++ .../sdk/FileInfoQueryTest.java | 8 +- .../java/com/hiero/sdk/FileInfoQueryTest.snap | 3 + .../hashgraph => hiero}/sdk/FileInfoTest.java | 11 +- .../hashgraph => hiero}/sdk/FileInfoTest.snap | 12 +- .../sdk/FileUpdateTransactionTest.java | 15 ++- .../hiero/sdk/FileUpdateTransactionTest.snap | 3 + .../sdk/FreezeTransactionTest.java | 18 ++- .../com/hiero/sdk/FreezeTransactionTest.snap | 3 + .../hashgraph => hiero}/sdk/Function.java | 2 +- .../hashgraph => hiero}/sdk/HbarTest.java | 4 +- .../sdk/HederaTrustManagerTest.java | 6 +- .../hashgraph => hiero}/sdk/KeyListTest.java | 9 +- .../hashgraph => hiero}/sdk/KeyTest.java | 42 +++--- .../hashgraph => hiero}/sdk/KeystoreTest.java | 4 +- .../sdk/ListInputTest.java | 15 ++- .../sdk/LiveHashAddTransactionTest.java | 7 +- .../hiero/sdk/LiveHashAddTransactionTest.snap | 3 + .../sdk/LiveHashDeleteTransactionTest.java | 7 +- .../sdk/LiveHashDeleteTransactionTest.snap | 3 + .../sdk/LiveHashQueryTest.java | 8 +- .../java/com/hiero/sdk/LiveHashQueryTest.snap | 3 + .../MaxQueryPaymentExceededExceptionTest.java | 5 +- .../sdk/MessageSubmitTransactionTest.java | 14 +- .../sdk/MessageSubmitTransactionTest.snap | 3 + .../sdk/MirrorNodeContractQueryTest.java | 8 +- .../sdk/MirrorNodeContractQueryTest.snap | 4 +- .../hashgraph => hiero}/sdk/MnemonicTest.java | 8 +- .../hashgraph => hiero}/sdk/Mocker.java | 21 +-- .../hashgraph => hiero}/sdk/MockingTest.java | 84 +++++++----- .../sdk/NetworkVersionInfoQueryTest.java | 10 +- .../sdk/NetworkVersionInfoQueryTest.snap | 3 + .../sdk/NetworkVersionInfoTest.java | 4 +- .../com/hiero/sdk/NetworkVersionInfoTest.snap | 3 + .../hashgraph => hiero}/sdk/NftIdTest.java | 5 +- .../test/java/com/hiero/sdk/NftIdTest.snap | 33 +++++ .../sdk/NodeCreateTransactionTest.java | 16 ++- .../hiero/sdk/NodeCreateTransactionTest.snap | 3 + .../sdk/NodeDeleteTransactionTest.java | 14 +- .../hiero/sdk/NodeDeleteTransactionTest.snap | 3 + .../sdk/NodeUpdateTransactionTest.java | 16 ++- .../hiero/sdk/NodeUpdateTransactionTest.snap | 3 + .../sdk/PendingAirdropIdTest.java | 14 +- .../sdk/PrivateKeyTest.java | 8 +- .../sdk/PrngTransactionTest.java | 7 +- .../com/hiero/sdk/PrngTransactionTest.snap | 8 ++ .../sdk/ProxyStakerTest.java | 7 +- .../java/com/hiero/sdk/ProxyStakerTest.snap | 3 + .../sdk/ReceiptStatusExceptionTest.java | 10 +- .../sdk/RegenerateTransactionIdsTest.java | 15 ++- .../sdk/RequestTypeTest.java | 5 +- .../sdk/ScheduleCreateTransactionTest.java | 9 +- .../sdk/ScheduleCreateTransactionTest.snap | 3 + .../sdk/ScheduleDeleteTransactionTest.java | 13 +- .../sdk/ScheduleDeleteTransactionTest.snap | 3 + .../sdk/ScheduleInfoQueryTest.java | 9 +- .../com/hiero/sdk/ScheduleInfoQueryTest.snap | 3 + .../sdk/ScheduleInfoTest.java | 14 +- .../sdk/ScheduleInfoTest.snap | 4 +- .../sdk/ScheduleSignTransactionTest.java | 9 +- .../sdk/ScheduleSignTransactionTest.snap | 3 + .../hashgraph => hiero}/sdk/Snapshot.java | 2 +- .../sdk/StakingInfoTest.java | 5 +- .../sdk/StakingInfoTest.snap | 6 +- .../hashgraph => hiero}/sdk/StatusTest.java | 5 +- .../sdk/SystemDeleteTransactionTest.java | 22 ++- .../sdk/SystemDeleteTransactionTest.snap | 8 ++ .../sdk/SystemUndeleteTransactionTest.java | 17 ++- .../sdk/SystemUndeleteTransactionTest.snap | 8 ++ .../hashgraph => hiero}/sdk/TestResponse.java | 12 +- .../hashgraph => hiero}/sdk/TestServer.java | 5 +- .../hashgraph => hiero}/sdk/TestService.java | 10 +- .../sdk/TokenAirdropTransactionTest.java | 17 ++- .../sdk/TokenAirdropTransactionTest.snap | 3 + .../sdk/TokenAllowanceTest.java | 5 +- .../sdk/TokenAssociateTransactionTest.java | 17 ++- .../sdk/TokenAssociateTransactionTest.snap | 3 + .../sdk/TokenAssociationTest.java | 5 +- .../com/hiero/sdk/TokenAssociationTest.snap | 3 + .../sdk/TokenBurnTransactionTest.java | 17 ++- .../hiero/sdk/TokenBurnTransactionTest.snap | 8 ++ .../TokenCancelAirdropTransactionTest.java | 19 ++- .../TokenCancelAirdropTransactionTest.snap | 3 + .../sdk/TokenClaimAirdropTransactionTest.java | 19 ++- .../sdk/TokenClaimAirdropTransactionTest.snap | 3 + .../sdk/TokenCreateTransactionTest.java | 30 +++-- .../hiero/sdk/TokenCreateTransactionTest.snap | 8 ++ .../sdk/TokenDeleteTransactionTest.java | 17 ++- .../hiero/sdk/TokenDeleteTransactionTest.snap | 3 + .../sdk/TokenDissociateTransactionTest.java | 17 ++- .../sdk/TokenDissociateTransactionTest.snap | 3 + ...TokenFeeScheduleUpdateTransactionTest.java | 15 ++- ...TokenFeeScheduleUpdateTransactionTest.snap | 3 + .../sdk/TokenFreezeTransactionTest.java | 13 +- .../hiero/sdk/TokenFreezeTransactionTest.snap | 3 + .../sdk/TokenGrantKycTransactionTest.java | 17 ++- .../sdk/TokenGrantKycTransactionTest.snap | 3 + .../sdk/TokenInfoQueryTest.java | 9 +- .../com/hiero/sdk/TokenInfoQueryTest.snap | 3 + .../sdk/TokenInfoTest.java | 17 ++- .../sdk/TokenInfoTest.snap | 2 +- .../sdk/TokenMintTransactionTest.java | 16 ++- .../hiero/sdk/TokenMintTransactionTest.snap | 8 ++ .../sdk/TokenNftInfoQueryTest.java | 10 +- .../com/hiero/sdk/TokenNftInfoQueryTest.snap | 3 + .../sdk/TokenNftInfoTest.java | 6 +- .../sdk/TokenNftInfoTest.snap | 4 +- .../sdk/TokenPauseTransactionTest.java | 17 ++- .../hiero/sdk/TokenPauseTransactionTest.snap | 3 + .../sdk/TokenRejectTransactionTest.java | 19 ++- .../hiero/sdk/TokenRejectTransactionTest.snap | 3 + .../sdk/TokenRelationshipTest.java | 4 +- .../sdk/TokenRelationshipTest.snap | 4 +- .../sdk/TokenRevokeKycTransactionTest.java | 17 ++- .../sdk/TokenRevokeKycTransactionTest.snap | 3 + .../sdk/TokenSupplyTypeTest.java | 16 +-- .../com/hiero/sdk/TokenSupplyTypeTest.snap | 10 ++ .../sdk/TokenTypeTest.java | 12 +- .../java/com/hiero/sdk/TokenTypeTest.snap | 10 ++ .../sdk/TokenUnfreezeTransactionTest.java | 13 +- .../sdk/TokenUnfreezeTransactionTest.snap | 3 + .../sdk/TokenUnpauseTransactionTest.java | 18 ++- .../sdk/TokenUnpauseTransactionTest.snap | 3 + .../sdk/TokenUpdateNftsTransactionTest.java | 15 ++- .../sdk/TokenUpdateNftsTransactionTest.snap | 3 + .../sdk/TokenUpdateTransactionTest.java | 23 +++- .../hiero/sdk/TokenUpdateTransactionTest.snap | 3 + .../sdk/TokenWipeTransactionTest.java | 17 ++- .../hiero/sdk/TokenWipeTransactionTest.snap | 8 ++ .../sdk/TopicCreateTransactionTest.java | 12 +- .../hiero/sdk/TopicCreateTransactionTest.snap | 3 + .../sdk/TopicDeleteTransactionTest.java | 13 +- .../hiero/sdk/TopicDeleteTransactionTest.snap | 3 + .../hashgraph => hiero}/sdk/TopicIdTest.java | 4 +- .../test/java/com/hiero/sdk/TopicIdTest.snap | 23 ++++ .../sdk/TopicInfoQueryTest.java | 8 +- .../com/hiero/sdk/TopicInfoQueryTest.snap | 3 + .../sdk/TopicInfoTest.java | 12 +- .../sdk/TopicInfoTest.snap | 12 +- .../sdk/TopicMessageChunkTest.java | 11 +- .../sdk/TopicMessageQueryTest.java | 24 ++-- .../sdk/TopicMessageQueryTest.snap | 0 .../TopicMessageSubmitTransactionTest.java | 14 +- .../TopicMessageSubmitTransactionTest.snap | 0 .../sdk/TopicMessageTest.java | 12 +- .../sdk/TopicUpdateTransactionTest.java | 22 ++- .../hiero/sdk/TopicUpdateTransactionTest.snap | 8 ++ .../sdk/TransactionIdTest.java | 4 +- .../java/com/hiero/sdk/TransactionIdTest.snap | 8 ++ .../sdk/TransactionReceiptQueryTest.java | 10 +- .../sdk/TransactionReceiptQueryTest.snap | 3 + .../sdk/TransactionReceiptTest.java | 12 +- .../sdk/TransactionReceiptTest.snap | 4 +- .../sdk/TransactionRecordQueryTest.java | 10 +- .../hiero/sdk/TransactionRecordQueryTest.snap | 3 + .../sdk/TransactionRecordTest.java | 25 +++- .../sdk/TransactionRecordTest.snap | 6 +- .../sdk/TransactionTest.java | 19 ++- .../AccountAllowanceIntegrationTest.java | 16 +-- .../AccountBalanceIntegrationTest.java | 18 +-- .../AccountCreateIntegrationTest.java | 6 +- .../AccountDeleteIntegrationTest.java | 20 +-- .../AccountIdPopulationIntegrationTest.java | 14 +- .../AccountInfoIntegrationTest.java | 22 +-- .../AccountRecordsIntegrationTest.java | 12 +- .../AccountStakersIntegrationTest.java | 10 +- .../AccountUpdateIntegrationTest.java | 18 +-- .../integration/ClientIntegrationTest.java | 4 +- .../sdk/test/integration/Contents.java | 2 +- .../ContractBytecodeIntegrationTest.java | 24 ++-- .../ContractCallIntegrationTest.java | 28 ++-- .../ContractCreateFlowIntegrationTest.java | 4 +- .../ContractCreateIntegrationTest.java | 22 +-- .../ContractDeleteIntegrationTest.java | 22 +-- .../ContractExecuteIntegrationTest.java | 24 ++-- ...ractFunctionParametersIntegrationTest.java | 26 ++-- .../ContractIdPopulationIntegrationTest.java | 14 +- .../ContractInfoIntegrationTest.java | 4 +- .../ContractNonceInfoIntegrationTest.java | 14 +- .../ContractUpdateIntegrationTest.java | 24 ++-- .../sdk/test/integration/EntityHelper.java | 28 ++-- .../EthereumTransactionIntegrationTest.java | 24 ++-- .../test/integration/FeeSchedulesTest.java | 8 +- .../FileAppendIntegrationTest.java | 16 +-- .../FileContentsIntegrationTest.java | 18 +-- .../FileCreateIntegrationTest.java | 10 +- .../FileDeleteIntegrationTest.java | 16 +-- .../integration/FileInfoIntegrationTest.java | 18 +-- .../FileUpdateIntegrationTest.java | 26 ++-- .../test/integration/IntegrationTestEnv.java | 20 +-- .../LiveHashAddIntegrationTest.java | 14 +- .../LiveHashDeleteIntegrationTest.java | 16 +-- .../test/integration/LoadIntegrationTest.java | 10 +- ...irrorNodeContractQueryIntegrationTest.java | 32 ++--- .../NetworkVersionInfoIntegrationTest.java | 4 +- .../NftAllowancesIntegrationTest.java | 34 ++--- .../integration/NftMetadataGenerator.java | 2 +- .../NodeCreateTransactionIntegrationTest.java | 16 +-- .../ReceiptQueryIntegrationTest.java | 16 +-- .../ScheduleCreateIntegrationTest.java | 48 +++---- .../integration/SystemIntegrationTest.java | 16 +-- .../TokenAirdropCancelIntegrationTest.java | 36 ++--- .../TokenAirdropClaimIntegrationTest.java | 34 ++--- ...okenAirdropTransactionIntegrationTest.java | 40 +++--- ...enAutomaticAssociationIntegrationTest.java | 24 ++-- .../integration/TokenBurnIntegrationTest.java | 28 ++-- .../TokenCreateIntegrationTest.java | 26 ++-- .../TokenDeleteIntegrationTest.java | 16 +-- .../TokenDissociateIntegrationTest.java | 22 +-- ...TokenFeeScheduleUpdateIntegrationTest.java | 22 +-- .../TokenFreezeIntegrationTest.java | 24 ++-- .../TokenGrantKycIntegrationTest.java | 22 +-- .../integration/TokenInfoIntegrationTest.java | 24 ++-- ...TokenManualAssociationIntegrationTest.java | 32 ++--- .../integration/TokenMintIntegrationTest.java | 24 ++-- .../TokenNftInfoIntegrationTest.java | 18 +-- .../TokenNftTransferIntegrationTest.java | 30 ++--- .../TokenPauseIntegrationTest.java | 20 +-- .../TokenRejectFlowIntegrationTest.java | 18 +-- .../TokenRejectIntegrationTest.java | 38 +++--- .../TokenRevokeKycIntegrationTest.java | 22 +-- .../TokenTransferIntegrationTest.java | 28 ++-- .../TokenUnfreezeIntegrationTest.java | 22 +-- .../TokenUnpauseIntegrationTest.java | 24 ++-- .../TokenUpdateIntegrationTest.java | 24 ++-- .../TokenUpdateNftsIntegrationTest.java | 26 ++-- .../integration/TokenWipeIntegrationTest.java | 30 ++--- .../TopicCreateIntegrationTest.java | 6 +- .../TopicDeleteIntegrationTest.java | 10 +- .../integration/TopicInfoIntegrationTest.java | 16 +-- .../TopicMessageIntegrationTest.java | 4 +- .../TopicMessageSubmitIntegrationTest.java | 18 +-- .../TopicUpdateIntegrationTest.java | 10 +- .../TransactionIntegrationTest.java | 64 ++++----- .../integration/TransactionResponseTest.java | 6 +- sdk/src/testIntegration/java/module-info.java | 2 +- 811 files changed, 4444 insertions(+), 3732 deletions(-) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AbstractTokenTransferTransaction.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountAllowanceAdjustTransaction.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountAllowanceApproveTransaction.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountAllowanceDeleteTransaction.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountBalance.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountBalanceQuery.java (85%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountCreateTransaction.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountDeleteTransaction.java (88%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountId.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountInfo.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountInfoFlow.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountInfoQuery.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountRecordsQuery.java (81%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountStakersQuery.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AccountUpdateTransaction.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AddressBookQuery.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/AssessedCustomFee.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BadEntityIdException.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BadKeyException.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BadMnemonicException.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BadMnemonicReason.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BaseNetwork.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BaseNode.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/BaseNodeAddress.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ChunkedTransaction.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Client.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ConsumerHelper.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractByteCodeQuery.java (79%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractCallQuery.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractCreateFlow.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractCreateTransaction.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractDeleteTransaction.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractExecuteTransaction.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionParameters.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionResult.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionSelector.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractId.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractInfo.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractInfoQuery.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractLogInfo.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractNonceInfo.java (87%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractStateChange.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ContractUpdateTransaction.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Crypto.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/CustomFee.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/CustomFeeBase.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/CustomFixedFee.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/CustomFractionalFee.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/CustomRoyaltyFee.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Delayer.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/DelegateContractId.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/DurationConverter.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Endpoint.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EntityIdHelper.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EthereumFlow.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EthereumTransaction.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EthereumTransactionData.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EthereumTransactionDataEip1559.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EthereumTransactionDataLegacy.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/EvmAddress.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ExchangeRate.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ExchangeRates.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Executable.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ExecutionState.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FeeAssessmentMethod.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FeeComponents.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FeeData.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FeeDataType.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FeeSchedule.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FeeSchedules.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileAppendTransaction.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileContentsQuery.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileCreateTransaction.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileDeleteTransaction.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileId.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileInfo.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileInfoQuery.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FileUpdateTransaction.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FreezeTransaction.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FreezeType.java (78%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/FutureConverter.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Hbar.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/HbarAllowance.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/HbarUnit.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/HederaPreCheckStatusException.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/HederaReceiptStatusException.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/HederaTrustManager.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/InstantConverter.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Key.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/KeyList.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Keystore.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/LedgerId.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/LiveHash.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/LiveHashAddTransaction.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/LiveHashDeleteTransaction.java (87%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/LiveHashQuery.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/LockableList.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MaxAttemptsExceededException.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MaxQueryPaymentExceededException.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNetwork.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNode.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNodeContractCallQuery.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNodeContractEstimateGasQuery.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNodeContractQuery.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Mnemonic.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Network.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NetworkName.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NetworkVersionInfo.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NetworkVersionInfoQuery.java (71%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NftId.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Node.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NodeAddress.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NodeAddressBook.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NodeCreateTransaction.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NodeDeleteTransaction.java (87%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/NodeUpdateTransaction.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Pem.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PendingAirdropId.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PendingAirdropLogic.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PendingAirdropRecord.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PrecheckStatusException.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PrivateKey.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PrivateKeyECDSA.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PrivateKeyED25519.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PrngTransaction.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ProxyStaker.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PublicKey.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PublicKeyECDSA.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/PublicKeyED25519.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Query.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ReceiptStatusException.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/RequestType.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleCreateTransaction.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleDeleteTransaction.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleId.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleInfo.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleInfoQuery.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleSignTransaction.java (87%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/SemanticVersion.java (88%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/StakingInfo.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Status.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/StorageChange.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/SubscriptionHandle.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/SystemDeleteTransaction.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/SystemUndeleteTransaction.java (86%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/ThreadLocalSecureRandom.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenAirdropTransaction.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenAllowance.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenAssociateTransaction.java (86%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenAssociation.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenBurnTransaction.java (88%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenCancelAirdropTransaction.java (79%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenClaimAirdropTransaction.java (79%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenCreateTransaction.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenDeleteTransaction.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenDissociateTransaction.java (85%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenFeeScheduleUpdateTransaction.java (86%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenFreezeTransaction.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenGrantKycTransaction.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenId.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenInfo.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenInfoQuery.java (81%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenKeyValidation.java (74%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenMintTransaction.java (88%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftAllowance.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftInfo.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftInfoQuery.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftTransfer.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenPauseTransaction.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenRejectFlow.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenRejectTransaction.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenRelationship.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenRevokeKycTransaction.java (84%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenSupplyType.java (79%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenTransfer.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenTransferList.java (87%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenType.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenUnfreezeTransaction.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenUnpauseTransaction.java (83%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenUpdateNftsTransaction.java (88%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenUpdateTransaction.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TokenWipeTransaction.java (89%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicCreateTransaction.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicDeleteTransaction.java (82%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicId.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicInfo.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicInfoQuery.java (79%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessage.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageChunk.java (92%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageQuery.java (97%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageSubmitTransaction.java (87%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TopicUpdateTransaction.java (93%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Transaction.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionFeeSchedule.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionId.java (99%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionReceipt.java (94%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionReceiptQuery.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionRecord.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionRecordQuery.java (90%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransactionResponse.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/Transfer.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/TransferTransaction.java (91%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/logger/LogLevel.java (95%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/logger/Logger.java (98%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/package-info.java (96%) rename sdk/src/main/java/com/{hedera/hashgraph => hiero}/sdk/utils/Bip32Utils.java (97%) delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.snap delete mode 100644 sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph/sdk => hiero}/logger/LoggerTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountAllowanceApproveTransactionTest.java (94%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountAllowanceDeleteTransactionTest.java (89%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountBalanceQueryTest.java (85%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountCreateTransactionTest.java (93%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountDeleteTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountIdTest.java (98%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountInfoQueryTest.java (86%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountInfoTest.java (90%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountInfoTest.snap (57%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountRecordsQueryTest.java (86%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountStakersQueryTest.java (86%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AccountUpdateTransactionTest.java (93%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AddressBookQueryMockTest.java (85%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AllowancesTest.java (93%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AllowancesTest.snap (87%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/AssessedCustomFeeTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/BaseNodeAddressTest.java (95%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ClientCloseTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ClientTest.java (95%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ConsumerHelperTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractByteCodeQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractCallQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractCreateTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractDeleteTransactionTest.java (89%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractExecuteTransactionTest.java (89%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionParametersTest.java (99%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionParametersTest.snap (99%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionResultTest.java (95%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractFunctionSelectorTest.java (97%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractIdTest.java (98%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractInfoQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractInfoTest.java (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractInfoTest.snap (92%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractLogInfoTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractNonceInfoTest.java (85%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractNonceInfoTest.snap (76%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ContractUpdateTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/CryptoTransferTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/CustomFeeListTest.java (93%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/CustomFeeListTest.snap (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/CustomFixedFeeTest.java (94%) create mode 100644 sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/CustomFractionalFeeTest.java (93%) create mode 100644 sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/CustomRoyaltyFeeTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/DelegateContractIdTest.java (97%) create mode 100644 sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/DuplicateTransactionTest.java (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ECDSAPrivateKeyTest.java (99%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ECDSAPublicKeyTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/Ed25519PrivateKeyTest.java (99%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/Ed25519PublicKeyTest.java (95%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/EthereumFlowMockTest.java (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/EthereumTransactionDataLegacyTest.java (95%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/EthereumTransactionTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ExchangeRatesTest.java (97%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ExecutableTest.java (82%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FeeAssessmentMethodTest.java (68%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FeeSchedulesTest.java (94%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FeeSchedulesTest.snap (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileAppendTransactionTest.java (98%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileContentsQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileCreateTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileDeleteTransactionTest.java (88%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileIdTest.java (97%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileInfoQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileInfoTest.java (90%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileInfoTest.snap (50%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FileUpdateTransactionTest.java (89%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/FreezeTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/Function.java (86%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/HbarTest.java (98%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/HederaTrustManagerTest.java (97%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/KeyListTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/KeyTest.java (92%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/KeystoreTest.java (97%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ListInputTest.java (93%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/LiveHashAddTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/LiveHashDeleteTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/LiveHashQueryTest.java (80%) create mode 100644 sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/MaxQueryPaymentExceededExceptionTest.java (88%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/MessageSubmitTransactionTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNodeContractQueryTest.java (97%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/MirrorNodeContractQueryTest.snap (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/MnemonicTest.java (99%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/Mocker.java (92%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/MockingTest.java (92%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/NetworkVersionInfoQueryTest.java (82%) create mode 100644 sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/NetworkVersionInfoTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/NftIdTest.java (96%) create mode 100644 sdk/src/test/java/com/hiero/sdk/NftIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/NodeCreateTransactionTest.java (95%) create mode 100644 sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/NodeDeleteTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/NodeUpdateTransactionTest.java (96%) create mode 100644 sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/PendingAirdropIdTest.java (90%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/PrivateKeyTest.java (91%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/PrngTransactionTest.java (93%) create mode 100644 sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ProxyStakerTest.java (77%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ReceiptStatusExceptionTest.java (74%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/RegenerateTransactionIdsTest.java (88%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/RequestTypeTest.java (87%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleCreateTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleDeleteTransactionTest.java (88%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleInfoQueryTest.java (86%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleInfoTest.java (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleInfoTest.snap (88%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/ScheduleSignTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/Snapshot.java (98%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/StakingInfoTest.java (94%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/StakingInfoTest.snap (71%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/StatusTest.java (94%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/SystemDeleteTransactionTest.java (93%) create mode 100644 sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/SystemUndeleteTransactionTest.java (89%) create mode 100644 sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TestResponse.java (91%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TestServer.java (95%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TestService.java (92%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenAirdropTransactionTest.java (94%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenAllowanceTest.java (94%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenAssociateTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenAssociationTest.java (96%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenBurnTransactionTest.java (93%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenCancelAirdropTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenClaimAirdropTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenCreateTransactionTest.java (95%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenDeleteTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenDissociateTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenFeeScheduleUpdateTransactionTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenFreezeTransactionTest.java (88%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenGrantKycTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenInfoQueryTest.java (88%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenInfoTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenInfoTest.snap (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenMintTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftInfoQueryTest.java (85%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftInfoTest.java (92%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenNftInfoTest.snap (70%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenPauseTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenRejectTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenRelationshipTest.java (93%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenRelationshipTest.snap (61%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenRevokeKycTransactionTest.java (91%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenSupplyTypeTest.java (57%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenTypeTest.java (75%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenUnfreezeTransactionTest.java (88%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenUnpauseTransactionTest.java (89%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenUpdateNftsTransactionTest.java (92%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenUpdateTransactionTest.java (95%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TokenWipeTransactionTest.java (94%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicCreateTransactionTest.java (90%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicDeleteTransactionTest.java (88%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicIdTest.java (95%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicInfoQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicInfoTest.java (89%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicInfoTest.snap (50%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageChunkTest.java (84%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageQueryTest.java (96%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageQueryTest.snap (100%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageSubmitTransactionTest.java (91%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageSubmitTransactionTest.snap (100%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicMessageTest.java (93%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TopicUpdateTransactionTest.java (94%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionIdTest.java (98%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionReceiptQueryTest.java (86%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionReceiptTest.java (84%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionReceiptTest.snap (90%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionRecordQueryTest.java (87%) create mode 100644 sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionRecordTest.java (85%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionRecordTest.snap (97%) rename sdk/src/test/java/com/{hedera/hashgraph => hiero}/sdk/TransactionTest.java (90%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountAllowanceIntegrationTest.java (88%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountBalanceIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountCreateIntegrationTest.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountDeleteIntegrationTest.java (88%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountIdPopulationIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountInfoIntegrationTest.java (88%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountRecordsIntegrationTest.java (87%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountStakersIntegrationTest.java (85%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/AccountUpdateIntegrationTest.java (89%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ClientIntegrationTest.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/Contents.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractBytecodeIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractCallIntegrationTest.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractCreateFlowIntegrationTest.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractCreateIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractDeleteIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractExecuteIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractFunctionParametersIntegrationTest.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractIdPopulationIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractInfoIntegrationTest.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractNonceInfoIntegrationTest.java (91%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ContractUpdateIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/EntityHelper.java (92%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/EthereumTransactionIntegrationTest.java (92%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FeeSchedulesTest.java (88%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FileAppendIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FileContentsIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FileCreateIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FileDeleteIntegrationTest.java (89%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FileInfoIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/FileUpdateIntegrationTest.java (89%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/IntegrationTestEnv.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/LiveHashAddIntegrationTest.java (85%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/LiveHashDeleteIntegrationTest.java (85%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/LoadIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/NetworkVersionInfoIntegrationTest.java (90%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/NftAllowancesIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/NftMetadataGenerator.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/NodeCreateTransactionIntegrationTest.java (92%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ReceiptQueryIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/ScheduleCreateIntegrationTest.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/SystemIntegrationTest.java (92%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenAirdropCancelIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenAirdropClaimIntegrationTest.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java (97%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenBurnIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenCreateIntegrationTest.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenDeleteIntegrationTest.java (92%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenDissociateIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenFreezeIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenGrantKycIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenInfoIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenManualAssociationIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenMintIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenNftInfoIntegrationTest.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenNftTransferIntegrationTest.java (89%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenPauseIntegrationTest.java (85%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenRejectFlowIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenRejectIntegrationTest.java (98%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenRevokeKycIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenTransferIntegrationTest.java (90%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenUnfreezeIntegrationTest.java (93%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenUnpauseIntegrationTest.java (83%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenUpdateIntegrationTest.java (99%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenUpdateNftsIntegrationTest.java (96%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TokenWipeIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TopicCreateIntegrationTest.java (91%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TopicDeleteIntegrationTest.java (89%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TopicInfoIntegrationTest.java (94%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TopicMessageIntegrationTest.java (98%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TopicMessageSubmitIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TopicUpdateIntegrationTest.java (88%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TransactionIntegrationTest.java (95%) rename sdk/src/testIntegration/java/com/{hedera/hashgraph => hiero}/sdk/test/integration/TransactionResponseTest.java (91%) diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java index 34ef054387..689365b88d 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java index 8eb7006899..2425ecbac8 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java index fecb71cc05..a515afde80 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java index 8b3a54b917..3504f9827e 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java index 08a7b9b672..cbf7dcda1a 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java index 0a295a1a6b..6290b92658 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.io.BufferedReader; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java index 61d44e3b93..0ae1918bc8 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java index dc92c18c8c..09e2792018 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java index a3e82db261..769e0e1dab 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java index 1522690edb..2b8923a552 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java index f6aaa8da2d..c15ac1f6d4 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java index ac09abc0d3..c0fb113e31 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java index 06d0076b02..a88564417a 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; @@ -93,7 +92,7 @@ public static void main(String[] args) throws Exception { // The default max fee of 1 Hbar is not enough to create a file (starts around ~1.1 Hbar). .setMaxTransactionFee(Hbar.from(2)) .execute(client); - + TransactionReceipt fileCreateTxReceipt = fileCreateTxResponse.getReceipt(client); FileId newFileId = fileCreateTxReceipt.fileId; Objects.requireNonNull(newFileId); diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java index 83482b17d5..af2a9ef265 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java index 7a872ae3c1..13569a35c1 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java index eff03f1ef9..c4505b353b 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java index be25d653b4..ece6b91782 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java index 824093fbfe..0fb13f7f26 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java @@ -23,8 +23,8 @@ import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java index 00e22ba94b..d533bf846c 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java index ce8cbf7881..6f3b999e21 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java index 4255f377dd..d0f9341e2d 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java @@ -23,8 +23,8 @@ import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java index 95adc4b182..66d84d2dd3 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java index 36ce6eee21..06398a5aba 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java @@ -23,8 +23,8 @@ import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.FileId; import com.hedera.hashgraph.sdk.NodeAddressBook; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.io.ByteArrayInputStream; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java index 1d81bd129a..ec32465990 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java @@ -20,9 +20,8 @@ package com.hedera.hashgraph.sdk.examples; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java index 9f27503698..5b02ce87d2 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java @@ -20,9 +20,8 @@ package com.hedera.hashgraph.sdk.examples; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java index 20ba0e68ba..ea81d04ccb 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java @@ -25,8 +25,8 @@ import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java index 27dd7d127a..959716040f 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java index 7c56bfc6f0..8fea8865e8 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java @@ -31,8 +31,8 @@ import com.hedera.hashgraph.sdk.ScheduleInfoQuery; import com.hedera.hashgraph.sdk.ScheduleSignTransaction; import com.hedera.hashgraph.sdk.TransferTransaction; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.time.Instant; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java index b90eab231f..21bb885f62 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java @@ -28,8 +28,8 @@ import com.hedera.hashgraph.sdk.MirrorNodeContractCallQuery; import com.hedera.hashgraph.sdk.MirrorNodeContractEstimateGasQuery; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java index d3fbe68092..a0cdc0ed48 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java index 74899972e6..83f0a7db1d 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java index e45dc96e2f..acf221dd3c 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java index 5e88c5d9ec..7cb69884c1 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java index acf8fcd156..2d71d13bb5 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.time.Instant; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java index 7badc153a6..76eb1fe953 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java index 1f0de7271e..5219d93271 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java index 596bd65fa7..5907614e07 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java index d22ef23dd7..c65d4ebf51 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java index c89b8b27b7..ff7dd9dd52 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java index dab731ff2d..867793c1b2 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java index f41f6477ed..106d581c14 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java index b9de23e6a0..bc439b8751 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java @@ -33,8 +33,8 @@ import com.hedera.hashgraph.sdk.TokenRejectTransaction; import com.hedera.hashgraph.sdk.TokenSupplyType; import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.ArrayList; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java index 4c44712f67..220cb8a04f 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java index 5d4be4bb1e..52d57eab23 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.ArrayList; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java index 0ce17ea2d4..636d89ce83 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java index 07833f9893..05f2b9f33a 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java index a99e149f66..bcf8d9edef 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java index f0b9821b61..16ff23aabd 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java index 2ab3961ed4..1fd0ebd53b 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java index e1b0eeea24..4b07900ef4 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java index bacf9d84fe..460dc4095c 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java index 6d50738518..97a260a980 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.Charset; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java index 747099f8d8..693c01e01e 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java @@ -19,9 +19,8 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hedera.hashgraph.sdk.*; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/scripts/update_protobufs.py b/scripts/update_protobufs.py index 7ce6beaa7a..da27e04c63 100755 --- a/scripts/update_protobufs.py +++ b/scripts/update_protobufs.py @@ -75,13 +75,13 @@ def go_to_script_dir(): PROTO_REPLACEMENTS = ( ("option java_package = \"com.hederahashgraph.api.proto.java\";", - "option java_package = \"com.hedera.hashgraph.sdk.proto\";"), + "option java_package = \"com.hiero.sdk.proto\";"), ("option java_package = \"com.hederahashgraph.service.proto.java\";", - "option java_package = \"com.hedera.hashgraph.sdk.proto\";"), + "option java_package = \"com.hiero.sdk.proto\";"), ("option java_package = \"com.hedera.mirror.api.proto\";", - "option java_package = \"com.hedera.hashgraph.sdk.proto.mirror\";") + "option java_package = \"com.hiero.sdk.proto.mirror\";") ) PROTO_REPLACEMENTS_IMPORTS = ( diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AbstractTokenTransferTransaction.java b/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AbstractTokenTransferTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java index 3b090d477e..632ff68305 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AbstractTokenTransferTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; @@ -41,7 +41,7 @@ protected AbstractTokenTransferTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AbstractTokenTransferTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); } @@ -51,7 +51,7 @@ protected AbstractTokenTransferTransaction() {} * * @param txBody protobuf TransactionBody */ - AbstractTokenTransferTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AbstractTokenTransferTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); } @@ -299,8 +299,8 @@ public T setNftTransferApproval(NftId nftId, boolean isApproved) { return (T) this; } - protected ArrayList sortTransfersAndBuild() { - var transferLists = new ArrayList(); + protected ArrayList sortTransfersAndBuild() { + var transferLists = new ArrayList(); this.tokenTransfers.sort(Comparator.comparing((TokenTransfer a) -> a.tokenId).thenComparing(a -> a.accountId) .thenComparing(a -> a.isApproved)); @@ -331,14 +331,14 @@ protected ArrayList sortTransfersAnd var result = iTokenId.compareTo(jTokenId); if (result == 0) { - transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(iTokenId, + transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), this.nftTransfers.get(j++))); } else if (result < 0) { - transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(iTokenId, + transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); } else { - transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(jTokenId, null, null, + transferLists.add(new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); } } else if (i < this.tokenTransfers.size()) { @@ -351,7 +351,7 @@ protected ArrayList sortTransfersAnd continue; } - transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(iTokenId, + transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); } else { var jTokenId = this.nftTransfers.get(j).tokenId; @@ -364,7 +364,7 @@ protected ArrayList sortTransfersAnd } transferLists.add( - new com.hedera.hashgraph.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); + new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); } } return transferLists; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceAdjustTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceAdjustTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java index a3f867db2e..9453537251 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceAdjustTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nonnegative; @@ -55,13 +55,13 @@ public AccountAllowanceAdjustTransaction() { } AccountAllowanceAdjustTransaction( - LinkedHashMap> txs + LinkedHashMap> txs ) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } - AccountAllowanceAdjustTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AccountAllowanceAdjustTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -388,7 +388,7 @@ public List getTokenNftAllowances() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { throw new UnsupportedOperationException("Cannot get method descriptor for AccountAllowanceAdjustTransaction"); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java index 9b32072df4..6238fb3233 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -59,7 +59,7 @@ public AccountAllowanceApproveTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records */ AccountAllowanceApproveTransaction( - LinkedHashMap> txs + LinkedHashMap> txs ) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -70,7 +70,7 @@ public AccountAllowanceApproveTransaction() { * * @param txBody protobuf TransactionBody */ - AccountAllowanceApproveTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AccountAllowanceApproveTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -439,14 +439,14 @@ public List getTokenNftApprovals() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getApproveAllowancesMethod(); } /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody builder } + * @return {@link com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody builder } */ CryptoApproveAllowanceTransactionBody.Builder build() { var builder = CryptoApproveAllowanceTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java index a8aea45bce..00d3b579c9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteAllowanceTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -39,7 +39,7 @@ /** * This transaction type is for deleting an account allowance. */ -public class AccountAllowanceDeleteTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class AccountAllowanceDeleteTransaction extends com.hiero.sdk.Transaction { private final List hbarAllowances = new ArrayList<>(); private final List tokenAllowances = new ArrayList<>(); private final List nftAllowances = new ArrayList<>(); @@ -59,7 +59,7 @@ public AccountAllowanceDeleteTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AccountAllowanceDeleteTransaction( - LinkedHashMap> txs + LinkedHashMap> txs ) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -70,7 +70,7 @@ public AccountAllowanceDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - AccountAllowanceDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AccountAllowanceDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountBalance.java b/sdk/src/main/java/com/hiero/sdk/AccountBalance.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountBalance.java rename to sdk/src/main/java/com/hiero/sdk/AccountBalance.java index b6ffce6283..af8d7befc6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountBalance.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountBalance.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoGetAccountBalanceResponse; -import com.hedera.hashgraph.sdk.proto.TokenBalance; +import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse; +import com.hiero.sdk.proto.TokenBalance; import javax.annotation.Nonnegative; import java.util.HashMap; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountBalanceQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java similarity index 85% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountBalanceQuery.java rename to sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java index f5e00fb4e7..4fa1f4faae 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountBalanceQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoGetAccountBalanceQuery; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.CryptoGetAccountBalanceQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -112,7 +112,7 @@ boolean isPaymentRequired() { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetAccountBalanceQuery.newBuilder(); if (accountId != null) { builder.setAccountID(accountId.toProtobuf()); @@ -126,7 +126,7 @@ void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, Qu } @Override - AccountBalance mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + AccountBalance mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return AccountBalance.fromProtobuf(response.getCryptogetAccountBalance()); } @@ -136,12 +136,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getCryptogetAccountBalance().getHeader(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoGetBalanceMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java index 86c5af66c9..a2c07130f8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoCreateTransactionBody; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; @@ -71,7 +71,7 @@ public AccountCreateTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - AccountCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + AccountCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -81,7 +81,7 @@ public AccountCreateTransaction() { * * @param txBody protobuf TransactionBody */ - AccountCreateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AccountCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -388,7 +388,7 @@ public AccountCreateTransaction setAlias(String aliasEvmAddress) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.CryptoCreateTransactionBody} + * @return {@link com.hiero.sdk.proto.CryptoCreateTransactionBody} */ CryptoCreateTransactionBody.Builder build() { var builder = CryptoCreateTransactionBody.newBuilder() @@ -464,7 +464,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCreateAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java similarity index 88% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java index 72b71f19ca..5c4d69ca20 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoDeleteTransactionBody; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -56,7 +56,7 @@ public AccountDeleteTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - AccountDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + AccountDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -66,7 +66,7 @@ public AccountDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - AccountDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AccountDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -129,7 +129,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoDeleteMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountId.java b/sdk/src/main/java/com/hiero/sdk/AccountId.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountId.java rename to sdk/src/main/java/com/hiero/sdk/AccountId.java index 3faa33990f..2b2dbb7df4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountId.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountId.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AccountID; +import com.hiero.sdk.proto.AccountID; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfo.java b/sdk/src/main/java/com/hiero/sdk/AccountInfo.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfo.java rename to sdk/src/main/java/com/hiero/sdk/AccountInfo.java index 75d0986e5e..9a083ad4d6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountInfo.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static java.util.stream.Collectors.toList; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoGetInfoResponse; +import com.hiero.sdk.proto.CryptoGetInfoResponse; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -258,12 +258,12 @@ static AccountInfo fromProtobuf(CryptoGetInfoResponse.AccountInfo accountInfo) { : null; var liveHashes = Arrays.stream(accountInfo.getLiveHashesList().toArray()) - .map((liveHash) -> LiveHash.fromProtobuf((com.hedera.hashgraph.sdk.proto.LiveHash) liveHash)) + .map((liveHash) -> LiveHash.fromProtobuf((com.hiero.sdk.proto.LiveHash) liveHash)) .collect(toList()); Map relationships = new HashMap<>(); - for (com.hedera.hashgraph.sdk.proto.TokenRelationship relationship : accountInfo.getTokenRelationshipsList()) { + for (com.hiero.sdk.proto.TokenRelationship relationship : accountInfo.getTokenRelationshipsList()) { TokenId tokenId = TokenId.fromProtobuf(relationship.getTokenId()); relationships.put(tokenId, TokenRelationship.fromProtobuf(relationship)); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoFlow.java b/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoFlow.java rename to sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java index c18fdc7ea5..5f6be2defd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java index 8b9aa64096..db3f1992cc 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoGetInfoQuery; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.CryptoGetInfoQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -74,7 +74,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetInfoQuery.newBuilder(); if (accountId != null) { @@ -90,17 +90,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getCryptoGetInfo().getHeader(); } @Override - AccountInfo mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + AccountInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return AccountInfo.fromProtobuf(response.getCryptoGetInfo().getAccountInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetAccountInfoMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountRecordsQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java similarity index 81% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountRecordsQuery.java rename to sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java index d8237bf2a1..8f987d9192 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountRecordsQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoGetAccountRecordsQuery; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.CryptoGetAccountRecordsQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -75,7 +75,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetAccountRecordsQuery.newBuilder(); if (accountId != null) { @@ -91,12 +91,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getCryptoGetAccountRecords().getHeader(); } @Override - List mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { var rawTransactionRecords = response.getCryptoGetAccountRecords().getRecordsList(); var transactionRecords = new ArrayList(rawTransactionRecords.size()); @@ -108,7 +108,7 @@ List mapResponse(Response response, AccountId nodeId, com.hed } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetAccountRecordsMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountStakersQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountStakersQuery.java rename to sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java index 0ba4772d60..8c3eb66a37 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountStakersQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoGetStakersQuery; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.CryptoGetStakersQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -77,7 +77,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetStakersQuery.newBuilder(); if (accountId != null) { @@ -93,12 +93,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getCryptoGetProxyStakers().getHeader(); } @Override - List mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { var rawStakers = response.getCryptoGetProxyStakers().getStakers(); var stakers = new ArrayList(rawStakers.getProxyStakerCount()); @@ -110,7 +110,7 @@ List mapResponse(Response response, AccountId nodeId, com.hedera.ha } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetStakersByAccountIDMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AccountUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java index 3b7fa00b93..4a91123fd6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AccountUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.BoolValue; import com.google.protobuf.Int32Value; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.CryptoUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.CryptoUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -93,7 +93,7 @@ public AccountUpdateTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - AccountUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + AccountUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -103,7 +103,7 @@ public AccountUpdateTransaction() { * * @param txBody protobuf TransactionBody */ - AccountUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + AccountUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -502,7 +502,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getUpdateAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AddressBookQuery.java b/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AddressBookQuery.java rename to sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java index aa101b384c..6301e6c32e 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AddressBookQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.mirror.NetworkServiceGrpc; +import com.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Deadline; @@ -225,9 +225,9 @@ void executeAsync(Client client, Deadline deadline, CompletableFuture() { + new StreamObserver() { @Override - public void onNext(com.hedera.hashgraph.sdk.proto.NodeAddress addressProto) { + public void onNext(com.hiero.sdk.proto.NodeAddress addressProto) { addresses.add(NodeAddress.fromProtobuf(addressProto)); } @@ -253,10 +253,10 @@ public void onCompleted() { /** * Build the address book query. * - * @return {@link com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery buildQuery } + * @return {@link com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery } */ - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery buildQuery() { - var builder = com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder(); + com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery() { + var builder = com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder(); if (fileId != null) { builder.setFileId(fileId.toProtobuf()); } @@ -266,7 +266,7 @@ com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery buildQuery() { return builder.build(); } - private ClientCall + private ClientCall buildCall(Client client, Deadline deadline) { try { return client.mirrorNetwork.getNextMirrorNode().getChannel().newCall( diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/AssessedCustomFee.java b/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/AssessedCustomFee.java rename to sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java index ccd64c17a6..ba633c5d44 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/AssessedCustomFee.java +++ b/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -70,7 +70,7 @@ public class AssessedCustomFee { * @param assessedCustomFee protobuf response object * @return the converted assessed custom fee object */ - static AssessedCustomFee fromProtobuf(com.hedera.hashgraph.sdk.proto.AssessedCustomFee assessedCustomFee) { + static AssessedCustomFee fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee assessedCustomFee) { var payerList = new ArrayList(assessedCustomFee.getEffectivePayerAccountIdCount()); for (var payerId : assessedCustomFee.getEffectivePayerAccountIdList()) { payerList.add(AccountId.fromProtobuf(payerId)); @@ -91,7 +91,7 @@ static AssessedCustomFee fromProtobuf(com.hedera.hashgraph.sdk.proto.AssessedCus * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static AssessedCustomFee fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.AssessedCustomFee.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee.parseFrom(bytes).toBuilder().build()); } @Override @@ -107,10 +107,10 @@ public String toString() { /** * Create the protobuf representation. * - * @return {@link com.hedera.hashgraph.sdk.proto.AssessedCustomFee} + * @return {@link com.hiero.sdk.proto.AssessedCustomFee} */ - com.hedera.hashgraph.sdk.proto.AssessedCustomFee toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.AssessedCustomFee.newBuilder().setAmount(amount); + com.hiero.sdk.proto.AssessedCustomFee toProtobuf() { + var builder = com.hiero.sdk.proto.AssessedCustomFee.newBuilder().setAmount(amount); if (tokenId != null) { builder.setTokenId(tokenId.toProtobuf()); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadEntityIdException.java b/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BadEntityIdException.java rename to sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java index 70067aec06..89acf60972 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadEntityIdException.java +++ b/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Custom exception thrown by the entity helper validate method when the account id and checksum are invalid. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadKeyException.java b/sdk/src/main/java/com/hiero/sdk/BadKeyException.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BadKeyException.java rename to sdk/src/main/java/com/hiero/sdk/BadKeyException.java index 594566d8ce..a81affad9d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadKeyException.java +++ b/sdk/src/main/java/com/hiero/sdk/BadKeyException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Signals that a key could not be realized from the given input. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadMnemonicException.java b/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BadMnemonicException.java rename to sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java index 3e005650ae..12ec01877a 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadMnemonicException.java +++ b/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; import java.util.List; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadMnemonicReason.java b/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BadMnemonicReason.java rename to sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java index 7be4ec48ff..8655d50651 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BadMnemonicReason.java +++ b/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Possible reason why a {@link Mnemonic} failed validation. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNetwork.java b/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNetwork.java rename to sdk/src/main/java/com/hiero/sdk/BaseNetwork.java index 0897a0bfe0..8b71140318 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNetwork.java +++ b/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.annotations.VisibleForTesting; import java.time.Duration; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java b/sdk/src/main/java/com/hiero/sdk/BaseNode.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java rename to sdk/src/main/java/com/hiero/sdk/BaseNode.java index 1b6ae177ef..a25f1160fe 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNode.java +++ b/sdk/src/main/java/com/hiero/sdk/BaseNode.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import io.grpc.ChannelCredentials; import io.grpc.ConnectivityState; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNodeAddress.java b/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNodeAddress.java rename to sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java index b3b9299695..33e672d8fe 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/BaseNodeAddress.java +++ b/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; import java.util.Objects; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ChunkedTransaction.java b/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ChunkedTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java index 876845179d..4c535fbc15 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ChunkedTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SignatureMap; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionID; +import com.hiero.sdk.proto.SignatureMap; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionID; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; @@ -64,7 +64,7 @@ abstract class ChunkedTransaction> extends Trans * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ChunkedTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ChunkedTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); } @@ -73,7 +73,7 @@ abstract class ChunkedTransaction> extends Trans * * @param txBody protobuf TransactionBody */ - ChunkedTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + ChunkedTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); } @@ -355,7 +355,7 @@ public CompletableFuture> executeAllAsync(Client clien public CompletableFuture> executeAllAsync(Client client, Duration timeoutPerChunk) { freezeAndSign(client); - CompletableFuture> future = + CompletableFuture> future = CompletableFuture.supplyAsync(() -> new ArrayList<>(transactionIds.size())); for (var i = 0; i < transactionIds.size(); i++) { @@ -428,7 +428,7 @@ public void executeAllAsync(Client client, Duration timeout, Consumer executeAsync(Client client, Duration timeoutPerChunk) { + public CompletableFuture executeAsync(Client client, Duration timeoutPerChunk) { return executeAllAsync(client, timeoutPerChunk).thenApply(responses -> responses.get(0)); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java b/sdk/src/main/java/com/hiero/sdk/Client.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java rename to sdk/src/main/java/com/hiero/sdk/Client.java index 957b14ba57..390be419c4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java +++ b/sdk/src/main/java/com/hiero/sdk/Client.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -26,8 +26,8 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import java.io.File; import java.io.IOException; import java.io.Reader; @@ -155,7 +155,7 @@ static ExecutorService createExecutor() { * * @param networkMap the map of node IDs to node addresses that make up the network. * @param executor runs the grpc requests asynchronously. - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forNetwork(Map networkMap, ExecutorService executor) { var network = Network.forNetwork(executor, networkMap); @@ -175,7 +175,7 @@ public static Client forNetwork(Map networkMap, ExecutorServi * chose nodes to send transactions to. For one transaction, at most 1/3 of the nodes will be tried. * * @param networkMap the map of node IDs to node addresses that make up the network. - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forNetwork(Map networkMap) { var executor = createExecutor(); @@ -223,7 +223,7 @@ public static Client forName(String name) { * href="https://docs.hedera.com/guides/mainnet/address-book#mainnet-address-book">Mainnet access. * * @param executor runs the grpc requests asynchronously. - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forMainnet(ExecutorService executor) { var network = Network.forMainnet(executor); @@ -238,7 +238,7 @@ public static Client forMainnet(ExecutorService executor) { * access. * * @param executor runs the grpc requests asynchronously. - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forTestnet(ExecutorService executor) { var network = Network.forTestnet(executor); @@ -254,7 +254,7 @@ public static Client forTestnet(ExecutorService executor) { * nodes. * * @param executor runs the grpc requests asynchronously. - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forPreviewnet(ExecutorService executor) { var network = Network.forPreviewnet(executor); @@ -269,7 +269,7 @@ public static Client forPreviewnet(ExecutorService executor) { * Construct a Hedera client pre-configured for Mainnet access. * - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forMainnet() { var executor = createExecutor(); @@ -284,7 +284,7 @@ public static Client forMainnet() { * Construct a Hedera client pre-configured for Testnet * access. * - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forTestnet() { var executor = createExecutor(); @@ -300,7 +300,7 @@ public static Client forTestnet() { * href="https://docs.hedera.com/guides/testnet/testnet-nodes#previewnet-node-public-keys">Preview Testnet * nodes. * - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} */ public static Client forPreviewnet() { var executor = createExecutor(); @@ -315,7 +315,7 @@ public static Client forPreviewnet() { * Configure a client based off the given JSON string. * * @param json The json string containing the client configuration - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} * @throws Exception if the config is incorrect */ public static Client fromConfig(String json) throws Exception { @@ -326,7 +326,7 @@ public static Client fromConfig(String json) throws Exception { * Configure a client based off the given JSON reader. * * @param json The Reader containing the client configuration - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} * @throws Exception if the config is incorrect */ public static Client fromConfig(Reader json) throws Exception { @@ -346,7 +346,7 @@ private static Map getNetworkNodes(JsonObject networks) { * Configure a client based on a JSON file at the given path. * * @param fileName The string containing the file path - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} * @throws IOException if IO operations fail */ public static Client fromConfigFile(String fileName) throws Exception { @@ -357,7 +357,7 @@ public static Client fromConfigFile(String fileName) throws Exception { * Configure a client based on a JSON file. * * @param file The file containing the client configuration - * @return {@link com.hedera.hashgraph.sdk.Client} + * @return {@link com.hiero.sdk.Client} * @throws IOException if IO operations fail */ public static Client fromConfigFile(File file) throws Exception { diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ConsumerHelper.java b/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ConsumerHelper.java rename to sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java index 4d3c75b38c..ce9e5017a1 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ConsumerHelper.java +++ b/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.concurrent.CompletableFuture; import java.util.function.BiConsumer; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractByteCodeQuery.java b/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java similarity index 79% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractByteCodeQuery.java rename to sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java index 12e368e096..e8bc2967a5 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractByteCodeQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ContractGetBytecodeQuery; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.ContractGetBytecodeQuery; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -73,7 +73,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ContractGetBytecodeQuery.newBuilder(); if (contractId != null) { builder.setContractID(contractId.toProtobuf()); @@ -88,17 +88,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getContractGetBytecode().getHeader(); } @Override - ByteString mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + ByteString mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return response.getContractGetBytecodeResponse().getBytecode(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getContractGetBytecodeMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCallQuery.java b/sdk/src/main/java/com/hiero/sdk/ContractCallQuery.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCallQuery.java rename to sdk/src/main/java/com/hiero/sdk/ContractCallQuery.java index 16b0d080e3..8fafe7ba97 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCallQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractCallQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ContractCallLocalQuery; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.ContractCallLocalQuery; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.Objects; @@ -216,7 +216,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ContractCallLocalQuery.newBuilder(); if (contractId != null) { builder.setContractID(contractId.toProtobuf()); @@ -236,17 +236,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getContractCallLocal().getHeader(); } @Override - ContractFunctionResult mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + ContractFunctionResult mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return new ContractFunctionResult(response.getContractCallLocal().getFunctionResult()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getContractCallLocalMethodMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCreateFlow.java b/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCreateFlow.java rename to sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java index c5cba04d4e..09a3ad5372 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCreateFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import java.time.Duration; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java index a21f336ae9..0cfbcade7a 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ContractCreateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import org.bouncycastle.util.Arrays; import java.time.Duration; @@ -128,7 +128,7 @@ public ContractCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ContractCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ContractCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -138,7 +138,7 @@ public ContractCreateTransaction() { * * @param txBody protobuf TransactionBody */ - ContractCreateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + ContractCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -604,7 +604,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getCreateContractMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java index 571840484d..1ae5aa56e1 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ContractDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -56,7 +56,7 @@ public ContractDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ContractDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ContractDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -66,7 +66,7 @@ public ContractDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - ContractDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + ContractDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -167,7 +167,7 @@ void validateChecksums(Client client) throws BadEntityIdException { @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getDeleteContractMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractExecuteTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractExecuteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java index 5318948c45..ee56770096 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractExecuteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractCallTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ContractCallTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -62,7 +62,7 @@ public ContractExecuteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ContractExecuteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ContractExecuteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -72,7 +72,7 @@ public ContractExecuteTransaction() { * * @param txBody protobuf TransactionBody */ - ContractExecuteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + ContractExecuteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -231,7 +231,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getContractCallMethodMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionParameters.java b/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionParameters.java rename to sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java index bbdca320f3..ede72bc376 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionParameters.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionResult.java b/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionResult.java rename to sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java index 32fb5ede74..07bbc959d5 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionResult.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.esaulpaugh.headlong.abi.Tuple; import com.esaulpaugh.headlong.abi.TupleType; @@ -25,7 +25,7 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.Int64Value; -import com.hedera.hashgraph.sdk.proto.ContractFunctionResultOrBuilder; +import com.hiero.sdk.proto.ContractFunctionResultOrBuilder; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -424,10 +424,10 @@ private ByteString getByteString(int startIndex, int endIndex) { /** * Create the protobuf representation. * - * @return {@link com.hedera.hashgraph.sdk.proto.ContractFunctionResult} + * @return {@link com.hiero.sdk.proto.ContractFunctionResult} */ - com.hedera.hashgraph.sdk.proto.ContractFunctionResult toProtobuf() { - var contractFunctionResult = com.hedera.hashgraph.sdk.proto.ContractFunctionResult.newBuilder() + com.hiero.sdk.proto.ContractFunctionResult toProtobuf() { + var contractFunctionResult = com.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(contractId.toProtobuf()) .setContractCallResult(rawResult) .setBloom(bloom) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionSelector.java b/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionSelector.java rename to sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java index b10944efeb..44eae35cbf 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractFunctionSelector.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import org.bouncycastle.jcajce.provider.digest.Keccak; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractId.java b/sdk/src/main/java/com/hiero/sdk/ContractId.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractId.java rename to sdk/src/main/java/com/hiero/sdk/ContractId.java index ff486069b0..396162501f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractId.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractId.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractID; +import com.hiero.sdk.proto.ContractID; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -280,8 +280,8 @@ public String getChecksum() { } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { - return com.hedera.hashgraph.sdk.proto.Key.newBuilder() + com.hiero.sdk.proto.Key toProtobufKey() { + return com.hiero.sdk.proto.Key.newBuilder() .setContractID(toProtobuf()) .build(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfo.java b/sdk/src/main/java/com/hiero/sdk/ContractInfo.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfo.java rename to sdk/src/main/java/com/hiero/sdk/ContractInfo.java index b9eb02bb29..001e142024 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractInfo.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractGetInfoResponse; +import com.hiero.sdk.proto.ContractGetInfoResponse; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java index 8af4b3d154..cb2c19ecb3 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ContractGetInfoQuery; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.ContractGetInfoQuery; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -83,7 +83,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ContractGetInfoQuery.newBuilder(); if (contractId != null) { builder.setContractID(contractId.toProtobuf()); @@ -98,17 +98,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getContractGetInfo().getHeader(); } @Override - ContractInfo mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + ContractInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return ContractInfo.fromProtobuf(response.getContractGetInfo().getContractInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getGetContractInfoMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractLogInfo.java b/sdk/src/main/java/com/hiero/sdk/ContractLogInfo.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractLogInfo.java rename to sdk/src/main/java/com/hiero/sdk/ContractLogInfo.java index aff32be966..de0ac0efe7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractLogInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractLogInfo.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractLoginfo; +import com.hiero.sdk.proto.ContractLoginfo; import org.bouncycastle.util.encoders.Hex; import java.util.ArrayList; @@ -74,7 +74,7 @@ private ContractLogInfo(ContractId contractId, ByteString bloom, List storageChanges = new ArrayList<>(stateChangeProto.getStorageChangesCount()); // for (var storageChangeProto : stateChangeProto.getStorageChangesList()) { // storageChanges.add(StorageChange.fromProtobuf(storageChangeProto)); @@ -75,7 +75,7 @@ public class ContractStateChange { // * @throws InvalidProtocolBufferException when there is an issue with the protobuf // */ // public static ContractStateChange fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - // return fromProtobuf(com.hedera.hashgraph.sdk.proto.ContractStateChange.parseFrom(bytes)); + // return fromProtobuf(com.hiero.sdk.proto.ContractStateChange.parseFrom(bytes)); // } // // /** @@ -83,8 +83,8 @@ public class ContractStateChange { // * // * @return the protobuf representation // */ - // com.hedera.hashgraph.sdk.proto.ContractStateChange toProtobuf() { - // var builder = com.hedera.hashgraph.sdk.proto.ContractStateChange.newBuilder() + // com.hiero.sdk.proto.ContractStateChange toProtobuf() { + // var builder = com.hiero.sdk.proto.ContractStateChange.newBuilder() // .setContractID(contractId.toProtobuf()); // for (var storageChange : storageChanges) { // builder.addStorageChanges(storageChange.toProtobuf()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java index bcc748da41..4ecf236b7b 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ContractUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.BoolValue; import com.google.protobuf.Int32Value; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.ContractUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ContractUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -101,7 +101,7 @@ public ContractUpdateTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) record * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ContractUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ContractUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -110,7 +110,7 @@ public ContractUpdateTransaction() { * * @param txBody protobuf TransactionBody */ - ContractUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + ContractUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -509,7 +509,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.ContractUpdateTransactionBody builder } + * @return {@link com.hiero.sdk.proto.ContractUpdateTransactionBody builder } */ ContractUpdateTransactionBody.Builder build() { var builder = ContractUpdateTransactionBody.newBuilder(); @@ -574,7 +574,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getUpdateContractMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Crypto.java b/sdk/src/main/java/com/hiero/sdk/Crypto.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Crypto.java rename to sdk/src/main/java/com/hiero/sdk/Crypto.java index c2d2f831b9..797f518cd8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Crypto.java +++ b/sdk/src/main/java/com/hiero/sdk/Crypto.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import org.bouncycastle.asn1.sec.SECNamedCurves; import org.bouncycastle.asn1.x9.X9ECParameters; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFee.java b/sdk/src/main/java/com/hiero/sdk/CustomFee.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFee.java rename to sdk/src/main/java/com/hiero/sdk/CustomFee.java index a659e92878..c7e5269805 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFee.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -54,7 +54,7 @@ abstract public class CustomFee { * @param customFee protobuf response object * @return the converted custom fee object */ - static CustomFee fromProtobufInner(com.hedera.hashgraph.sdk.proto.CustomFee customFee) { + static CustomFee fromProtobufInner(com.hiero.sdk.proto.CustomFee customFee) { switch (customFee.getFeeCase()) { case FIXED_FEE: return CustomFixedFee.fromProtobuf(customFee.getFixedFee()); @@ -70,7 +70,7 @@ static CustomFee fromProtobufInner(com.hedera.hashgraph.sdk.proto.CustomFee cust } } - static CustomFee fromProtobuf(com.hedera.hashgraph.sdk.proto.CustomFee customFee) { + static CustomFee fromProtobuf(com.hiero.sdk.proto.CustomFee customFee) { var outFee = fromProtobufInner(customFee); if (customFee.hasFeeCollectorAccountId()) { outFee.feeCollectorAccountId = AccountId.fromProtobuf(customFee.getFeeCollectorAccountId()); @@ -88,7 +88,7 @@ static CustomFee fromProtobuf(com.hedera.hashgraph.sdk.proto.CustomFee customFee * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static CustomFee fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.CustomFee.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.CustomFee.parseFrom(bytes).toBuilder().build()); } /** @@ -148,7 +148,7 @@ void validateChecksums(Client client) throws BadEntityIdException { * @param customFeeBuilder the builder object * @return the protobuf */ - protected com.hedera.hashgraph.sdk.proto.CustomFee finishToProtobuf(com.hedera.hashgraph.sdk.proto.CustomFee.Builder customFeeBuilder) { + protected com.hiero.sdk.proto.CustomFee finishToProtobuf(com.hiero.sdk.proto.CustomFee.Builder customFeeBuilder) { if (feeCollectorAccountId != null) { customFeeBuilder.setFeeCollectorAccountId(feeCollectorAccountId.toProtobuf()); } @@ -161,7 +161,7 @@ protected com.hedera.hashgraph.sdk.proto.CustomFee finishToProtobuf(com.hedera.h * * @return the protobuf for the custom fee object */ - abstract com.hedera.hashgraph.sdk.proto.CustomFee toProtobuf(); + abstract com.hiero.sdk.proto.CustomFee toProtobuf(); /** * Create the byte array. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFeeBase.java b/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFeeBase.java rename to sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java index 5f5c195b2c..ed7f9145ef 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFeeBase.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.Objects; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFixedFee.java b/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFixedFee.java rename to sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java index e06c955129..e1160e9d42 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFixedFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hedera.hashgraph.sdk.proto.FixedFee; +import com.hiero.sdk.proto.FixedFee; import javax.annotation.Nullable; @@ -168,8 +168,8 @@ FixedFee toFixedFeeProtobuf() { } @Override - com.hedera.hashgraph.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hedera.hashgraph.sdk.proto.CustomFee.newBuilder() + com.hiero.sdk.proto.CustomFee toProtobuf() { + var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder() .setFixedFee(toFixedFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFractionalFee.java b/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFractionalFee.java rename to sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java index c6d876a477..e88e632135 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomFractionalFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Fraction; -import com.hedera.hashgraph.sdk.proto.FractionalFee; +import com.hiero.sdk.proto.Fraction; +import com.hiero.sdk.proto.FractionalFee; import java.util.Objects; @@ -207,8 +207,8 @@ FractionalFee toFractionalFeeProtobuf() { } @Override - com.hedera.hashgraph.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hedera.hashgraph.sdk.proto.CustomFee.newBuilder() + com.hiero.sdk.proto.CustomFee toProtobuf() { + var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder() .setFractionalFee(toFractionalFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomRoyaltyFee.java b/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/CustomRoyaltyFee.java rename to sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java index 09e27e67e3..5cc19721a4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/CustomRoyaltyFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hedera.hashgraph.sdk.proto.Fraction; -import com.hedera.hashgraph.sdk.proto.RoyaltyFee; +import com.hiero.sdk.proto.Fraction; +import com.hiero.sdk.proto.RoyaltyFee; import javax.annotation.Nullable; import java.util.Objects; @@ -153,8 +153,8 @@ RoyaltyFee toRoyaltyFeeProtobuf() { } @Override - com.hedera.hashgraph.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hedera.hashgraph.sdk.proto.CustomFee.newBuilder() + com.hiero.sdk.proto.CustomFee toProtobuf() { + var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder() .setRoyaltyFee(toRoyaltyFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Delayer.java b/sdk/src/main/java/com/hiero/sdk/Delayer.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Delayer.java rename to sdk/src/main/java/com/hiero/sdk/Delayer.java index b672c577d7..32d33913b7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Delayer.java +++ b/sdk/src/main/java/com/hiero/sdk/Delayer.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.time.Duration; import java.util.concurrent.CompletableFuture; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/DelegateContractId.java b/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/DelegateContractId.java rename to sdk/src/main/java/com/hiero/sdk/DelegateContractId.java index 30cf09a2b8..561a4fe828 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/DelegateContractId.java +++ b/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractID; +import com.hiero.sdk.proto.ContractID; import javax.annotation.Nullable; import java.util.Objects; @@ -104,8 +104,8 @@ public static DelegateContractId fromBytes(byte[] bytes) throws InvalidProtocolB } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { - return com.hedera.hashgraph.sdk.proto.Key.newBuilder() + com.hiero.sdk.proto.Key toProtobufKey() { + return com.hiero.sdk.proto.Key.newBuilder() .setDelegatableContractId(toProtobuf()) .build(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/DurationConverter.java b/sdk/src/main/java/com/hiero/sdk/DurationConverter.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/DurationConverter.java rename to sdk/src/main/java/com/hiero/sdk/DurationConverter.java index 9e3b7e1d23..3a642b52d1 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/DurationConverter.java +++ b/sdk/src/main/java/com/hiero/sdk/DurationConverter.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.time.Duration; @@ -34,7 +34,7 @@ private DurationConverter() { * @param duration the duration protobuf * @return the duration object */ - static Duration fromProtobuf(com.hedera.hashgraph.sdk.proto.Duration duration) { + static Duration fromProtobuf(com.hiero.sdk.proto.Duration duration) { return Duration.ofSeconds(duration.getSeconds()); } @@ -44,8 +44,8 @@ static Duration fromProtobuf(com.hedera.hashgraph.sdk.proto.Duration duration) { * @param duration the duration object * @return the protobuf */ - static com.hedera.hashgraph.sdk.proto.Duration toProtobuf(Duration duration) { - return com.hedera.hashgraph.sdk.proto.Duration.newBuilder() + static com.hiero.sdk.proto.Duration toProtobuf(Duration duration) { + return com.hiero.sdk.proto.Duration.newBuilder() .setSeconds(duration.getSeconds()) .build(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Endpoint.java b/sdk/src/main/java/com/hiero/sdk/Endpoint.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Endpoint.java rename to sdk/src/main/java/com/hiero/sdk/Endpoint.java index fc542450e0..999ec24a3c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Endpoint.java +++ b/sdk/src/main/java/com/hiero/sdk/Endpoint.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ServiceEndpoint; +import com.hiero.sdk.proto.ServiceEndpoint; import java.util.Arrays; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EntityIdHelper.java b/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EntityIdHelper.java rename to sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java index 7258c7f44e..65e5008b70 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EntityIdHelper.java +++ b/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.gson.JsonObject; import com.google.gson.JsonParser; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumFlow.java b/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumFlow.java rename to sdk/src/main/java/com/hiero/sdk/EthereumFlow.java index 8bbc116b10..8b1251bdef 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.time.Duration; import java.util.Arrays; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransaction.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransaction.java rename to sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java index 37e2f08e75..1a76a7c021 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.EthereumTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.EthereumTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -48,12 +48,12 @@ public class EthereumTransaction extends Transaction { public EthereumTransaction() { } - EthereumTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + EthereumTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } - EthereumTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + EthereumTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -166,7 +166,7 @@ private EthereumTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getCallEthereumMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionData.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionData.java rename to sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java index 7b459abec1..42057466a8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionData.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionDataEip1559.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionDataEip1559.java rename to sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java index 15890ced04..e207ffcfc7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionDataEip1559.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; import com.esaulpaugh.headlong.rlp.RLPEncoder; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacy.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacy.java rename to sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java index 4e30727130..3b3f3488f3 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacy.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; import com.esaulpaugh.headlong.rlp.RLPEncoder; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/EvmAddress.java b/sdk/src/main/java/com/hiero/sdk/EvmAddress.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/EvmAddress.java rename to sdk/src/main/java/com/hiero/sdk/EvmAddress.java index 7606a938b1..feeacd1e29 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/EvmAddress.java +++ b/sdk/src/main/java/com/hiero/sdk/EvmAddress.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AccountID; +import com.hiero.sdk.proto.AccountID; import org.bouncycastle.util.encoders.Hex; import javax.annotation.Nonnegative; @@ -78,7 +78,7 @@ public static EvmAddress fromBytes(byte[] bytes) { } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { + com.hiero.sdk.proto.Key toProtobufKey() { throw new UnsupportedOperationException("toProtobufKey() not implemented for EvmAddress"); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ExchangeRate.java b/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ExchangeRate.java rename to sdk/src/main/java/com/hiero/sdk/ExchangeRate.java index 8f17c1c2e9..1db01d2b72 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ExchangeRate.java +++ b/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import java.time.Instant; @@ -59,7 +59,7 @@ public final class ExchangeRate { * @param pb the protobuf * @return the new exchange rate */ - static ExchangeRate fromProtobuf(com.hedera.hashgraph.sdk.proto.ExchangeRate pb) { + static ExchangeRate fromProtobuf(com.hiero.sdk.proto.ExchangeRate pb) { return new ExchangeRate( pb.getHbarEquiv(), pb.getCentEquiv(), diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ExchangeRates.java b/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ExchangeRates.java rename to sdk/src/main/java/com/hiero/sdk/ExchangeRates.java index 6e83ec5461..0554564f5c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ExchangeRates.java +++ b/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -47,7 +47,7 @@ private ExchangeRates(ExchangeRate currentRate, ExchangeRate nextRate) { * @param pb the protobuf * @return the new exchange rates */ - static ExchangeRates fromProtobuf(com.hedera.hashgraph.sdk.proto.ExchangeRateSet pb) { + static ExchangeRates fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet pb) { return new ExchangeRates( ExchangeRate.fromProtobuf(pb.getCurrentRate()), ExchangeRate.fromProtobuf(pb.getNextRate()) @@ -62,7 +62,7 @@ static ExchangeRates fromProtobuf(com.hedera.hashgraph.sdk.proto.ExchangeRateSet * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static ExchangeRates fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.ExchangeRateSet.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet.parseFrom(bytes).toBuilder().build()); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Executable.java b/sdk/src/main/java/com/hiero/sdk/Executable.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Executable.java rename to sdk/src/main/java/com/hiero/sdk/Executable.java index 4bb6a01fa6..f2bb685009 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Executable.java +++ b/sdk/src/main/java/com/hiero/sdk/Executable.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import static com.hedera.hashgraph.sdk.FutureConverter.toCompletableFuture; +import static com.hiero.sdk.FutureConverter.toCompletableFuture; import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.MessageLite; -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.MethodDescriptor; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ExecutionState.java b/sdk/src/main/java/com/hiero/sdk/ExecutionState.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ExecutionState.java rename to sdk/src/main/java/com/hiero/sdk/ExecutionState.java index 7eabf572d5..9d02adb355 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ExecutionState.java +++ b/sdk/src/main/java/com/hiero/sdk/ExecutionState.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Enum for the execution states. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeAssessmentMethod.java b/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FeeAssessmentMethod.java rename to sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java index ef6319ca75..04e7807518 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeAssessmentMethod.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Enum for the fee assessment method. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeComponents.java b/sdk/src/main/java/com/hiero/sdk/FeeComponents.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FeeComponents.java rename to sdk/src/main/java/com/hiero/sdk/FeeComponents.java index 10b7583c90..06770f3565 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeComponents.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeComponents.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -83,7 +83,7 @@ public FeeComponents() { * @param feeComponents the protobuf * @return the fee component object */ - static FeeComponents fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeComponents feeComponents) { + static FeeComponents fromProtobuf(com.hiero.sdk.proto.FeeComponents feeComponents) { return new FeeComponents() .setMin(feeComponents.getMin()) .setMax(feeComponents.getMax()) @@ -106,7 +106,7 @@ static FeeComponents fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeComponents f * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeComponents fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeComponents.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.FeeComponents.parseFrom(bytes).toBuilder().build()); } /** @@ -334,8 +334,8 @@ public FeeComponents setResponseDiskByte(long responseDiskByte) { * * @return the protobuf */ - com.hedera.hashgraph.sdk.proto.FeeComponents toProtobuf() { - return com.hedera.hashgraph.sdk.proto.FeeComponents.newBuilder() + com.hiero.sdk.proto.FeeComponents toProtobuf() { + return com.hiero.sdk.proto.FeeComponents.newBuilder() .setMin(getMin()) .setMax(getMax()) .setConstant(getConstant()) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeData.java b/sdk/src/main/java/com/hiero/sdk/FeeData.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FeeData.java rename to sdk/src/main/java/com/hiero/sdk/FeeData.java index 633b65a857..ee4f8093eb 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeData.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeData.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -49,7 +49,7 @@ public FeeData() { * @param feeData the protobuf * @return the fee data object */ - static FeeData fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeData feeData) { + static FeeData fromProtobuf(com.hiero.sdk.proto.FeeData feeData) { return new FeeData() .setNodeData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getNodedata()) : null) .setNetworkData(feeData.hasNetworkdata() ? FeeComponents.fromProtobuf(feeData.getNetworkdata()) : null) @@ -65,7 +65,7 @@ static FeeData fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeData feeData) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeData fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeData.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.FeeData.parseFrom(bytes).toBuilder().build()); } /** @@ -142,7 +142,7 @@ FeeDataType getType() { /** * Assign the fee data type. - * {@link com.hedera.hashgraph.sdk.FeeDataType} + * {@link com.hiero.sdk.FeeDataType} * * @param type the fee data type * @return {@code this} @@ -157,8 +157,8 @@ FeeData setType(FeeDataType type) { * * @return the protobuf */ - com.hedera.hashgraph.sdk.proto.FeeData toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.FeeData.newBuilder().setSubType(type.code); + com.hiero.sdk.proto.FeeData toProtobuf() { + var builder = com.hiero.sdk.proto.FeeData.newBuilder().setSubType(type.code); if (nodeData != null) { builder.setNodedata(nodeData.toProtobuf()); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeDataType.java b/sdk/src/main/java/com/hiero/sdk/FeeDataType.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FeeDataType.java rename to sdk/src/main/java/com/hiero/sdk/FeeDataType.java index 1632770ae4..b9460c19dd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeDataType.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeDataType.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.SubType; +import com.hiero.sdk.proto.SubType; /** * Enum for the fee data types. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java b/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java rename to sdk/src/main/java/com/hiero/sdk/FeeSchedule.java index f5afd5acd8..3f7f2277b4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedule.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -51,7 +51,7 @@ public FeeSchedule() { * @param feeSchedule the protobuf * @return the fee schedule */ - static FeeSchedule fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeSchedule feeSchedule) { + static FeeSchedule fromProtobuf(com.hiero.sdk.proto.FeeSchedule feeSchedule) { FeeSchedule returnFeeSchedule = new FeeSchedule() .setExpirationTime(feeSchedule.hasExpiryTime() ? InstantConverter.fromProtobuf(feeSchedule.getExpiryTime()) : null); for (var transactionFeeSchedule : feeSchedule.getTransactionFeeScheduleList()) { @@ -69,7 +69,7 @@ static FeeSchedule fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeSchedule feeSc * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeSchedule fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.FeeSchedule.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.FeeSchedule.parseFrom(bytes).toBuilder().build()); } /** @@ -137,8 +137,8 @@ public FeeSchedule setExpirationTime(@Nullable Instant expirationTime) { * * @return the protobuf */ - com.hedera.hashgraph.sdk.proto.FeeSchedule toProtobuf() { - var returnBuilder = com.hedera.hashgraph.sdk.proto.FeeSchedule.newBuilder(); + com.hiero.sdk.proto.FeeSchedule toProtobuf() { + var returnBuilder = com.hiero.sdk.proto.FeeSchedule.newBuilder(); if (expirationTime != null) { returnBuilder.setExpiryTime(InstantConverter.toSecondsProtobuf(expirationTime)); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedules.java b/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedules.java rename to sdk/src/main/java/com/hiero/sdk/FeeSchedules.java index cab329ca5e..ad6adb40c9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FeeSchedules.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CurrentAndNextFeeSchedule; +import com.hiero.sdk.proto.CurrentAndNextFeeSchedule; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileAppendTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileAppendTransaction.java rename to sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java index d33a1a66cf..2d846438ce 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileAppendTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileAppendTransactionBody; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionID; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FileAppendTransactionBody; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionID; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -44,7 +44,7 @@ public FileAppendTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ FileAppendTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); @@ -56,7 +56,7 @@ public FileAppendTransaction() { * * @param txBody protobuf TransactionBody */ - FileAppendTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + FileAppendTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -141,7 +141,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getAppendContentMethod(); } @@ -175,7 +175,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.FileAppendTransactionBody builder} + * @return {@link com.hiero.sdk.proto.FileAppendTransactionBody builder} */ FileAppendTransactionBody.Builder build() { var builder = FileAppendTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileContentsQuery.java b/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileContentsQuery.java rename to sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java index ad01e485df..f710ed98a7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileContentsQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.FileGetContentsQuery; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.FileGetContentsQuery; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -89,7 +89,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = FileGetContentsQuery.newBuilder(); if (fileId != null) { builder.setFileID(fileId.toProtobuf()); @@ -104,17 +104,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getFileGetContents().getHeader(); } @Override - ByteString mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + ByteString mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return response.getFileGetContents().getFileContents().getContents(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getGetFileContentMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileCreateTransaction.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/FileCreateTransaction.java index 39dc787be2..c179d7c669 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileCreateTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FileCreateTransactionBody; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; @@ -66,7 +66,7 @@ public FileCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + FileCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -76,7 +76,7 @@ public FileCreateTransaction() { * * @param txBody protobuf TransactionBody */ - FileCreateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + FileCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -128,7 +128,7 @@ public Collection getKeys() { * paying for the transaction). Only one key must sign to delete the file, however. * *

To require more than one key to sign to delete a file, add them to a - * {@link com.hedera.hashgraph.sdk.KeyList} and pass that here. + * {@link com.hiero.sdk.KeyList} and pass that here. * *

The network currently requires a file to have at least one key (or key list or threshold key) * but this requirement may be lifted in the future. @@ -158,7 +158,7 @@ public ByteString getContents() { * *

Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the * network; if you exceed this you may receive a {@link PrecheckStatusException} - * with {@link com.hedera.hashgraph.sdk.Status#TRANSACTION_OVERSIZE}. + * with {@link com.hiero.sdk.Status#TRANSACTION_OVERSIZE}. * *

In this case, you can use {@link FileAppendTransaction}, which automatically breaks the contents * into chunks for you, to append contents of arbitrary size. @@ -184,7 +184,7 @@ public FileCreateTransaction setContents(byte[] bytes) { * *

Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the * network; if you exceed this you may receive a {@link PrecheckStatusException} - * with {@link com.hedera.hashgraph.sdk.Status#TRANSACTION_OVERSIZE}. + * with {@link com.hiero.sdk.Status#TRANSACTION_OVERSIZE}. * *

In this case, you can use {@link FileAppendTransaction}, which automatically breaks the contents * into chunks for you, to append contents of arbitrary size. @@ -222,7 +222,7 @@ public FileCreateTransaction setFileMemo(String memo) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getCreateFileMethod(); } @@ -249,7 +249,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody builder} + * @return {@link com.hiero.sdk.proto.FileCreateTransactionBody builder} */ FileCreateTransactionBody.Builder build() { var builder = FileCreateTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java index 556f1c101e..275486e7ae 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FileDeleteTransactionBody; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -39,7 +39,7 @@ * will throw {@link PrecheckStatusException} with a status of {@link Status#FILE_DELETED}. * *

Only one of the file's keys needs to sign to delete the file, unless the key you have is part - * of a {@link com.hedera.hashgraph.sdk.KeyList}. + * of a {@link com.hiero.sdk.KeyList}. */ public final class FileDeleteTransaction extends Transaction { @@ -59,7 +59,7 @@ public FileDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + FileDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -69,7 +69,7 @@ public FileDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - FileDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + FileDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -110,7 +110,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.FileDeleteTransactionBody builder} + * @return {@link com.hiero.sdk.proto.FileDeleteTransactionBody builder} */ FileDeleteTransactionBody.Builder build() { var builder = FileDeleteTransactionBody.newBuilder(); @@ -129,7 +129,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getDeleteFileMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileId.java b/sdk/src/main/java/com/hiero/sdk/FileId.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileId.java rename to sdk/src/main/java/com/hiero/sdk/FileId.java index a740b58e1c..e4ba08a9de 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileId.java +++ b/sdk/src/main/java/com/hiero/sdk/FileId.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileID; +import com.hiero.sdk.proto.FileID; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileInfo.java b/sdk/src/main/java/com/hiero/sdk/FileInfo.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileInfo.java rename to sdk/src/main/java/com/hiero/sdk/FileInfo.java index 10daa194e2..0c9e64c0ce 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/FileInfo.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileGetInfoResponse; +import com.hiero.sdk.proto.FileGetInfoResponse; import java.time.Instant; import javax.annotation.Nullable; @@ -135,7 +135,7 @@ FileGetInfoResponse.FileInfo toProtobuf() { .setLedgerId(ledgerId.toByteString()); if (keys != null) { - var keyList = com.hedera.hashgraph.sdk.proto.KeyList.newBuilder(); + var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); for (Key key : keys) { keyList.addKeys(key.toProtobufKey()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java index 4d12d8a58b..74e6bf8a5b 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.FileGetInfoQuery; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.FileGetInfoQuery; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -80,7 +80,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = FileGetInfoQuery.newBuilder(); if (fileId != null) { builder.setFileID(fileId.toProtobuf()); @@ -95,17 +95,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getFileGetInfo().getHeader(); } @Override - FileInfo mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + FileInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return FileInfo.fromProtobuf(response.getFileGetInfo().getFileInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getGetFileInfoMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FileUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java index 053a19634e..36b9b20e5e 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FileUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.FileUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.FileUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; @@ -68,7 +68,7 @@ public FileUpdateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + FileUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -78,7 +78,7 @@ public FileUpdateTransaction() { * * @param txBody protobuf TransactionBody */ - FileUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + FileUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -181,7 +181,7 @@ public ByteString getContents() { * * @param bytes the bytes to replace the contents of the file with. * @return {@code this} - * @see #setContents(String) for an overload which takes a {@link String}. + * @see #setContents(String) for an overload which takes a String. * @see FileAppendTransaction if you merely want to add data to a file's existing contents. */ public FileUpdateTransaction setContents(byte[] bytes) { @@ -278,7 +278,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.FileUpdateTransactionBody builder } + * @return {@link com.hiero.sdk.proto.FileUpdateTransactionBody builder } */ FileUpdateTransactionBody.Builder build() { var builder = FileUpdateTransactionBody.newBuilder(); @@ -307,7 +307,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getUpdateFileMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeTransaction.java b/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeTransaction.java rename to sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java index b78ca0e6df..1678983282 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FreezeServiceGrpc; -import com.hedera.hashgraph.sdk.proto.FreezeTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FreezeServiceGrpc; +import com.hiero.sdk.proto.FreezeTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.time.OffsetTime; @@ -63,7 +63,7 @@ public FreezeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + FreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -73,7 +73,7 @@ public FreezeTransaction() { * * @param txBody protobuf TransactionBody */ - FreezeTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + FreezeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -234,7 +234,7 @@ public FreezeType getFreezeType() { /** * Assign the freeze type. - * {@link com.hedera.hashgraph.sdk.FreezeTransaction} + * {@link com.hiero.sdk.FreezeTransaction} * * @param freezeType the freeze type * @return {@code this} @@ -251,7 +251,7 @@ void validateChecksums(Client client) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FreezeServiceGrpc.getFreezeMethod(); } @@ -273,7 +273,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.FreezeTransactionBody builder } + * @return {@link com.hiero.sdk.proto.FreezeTransactionBody builder } */ FreezeTransactionBody.Builder build() { var builder = FreezeTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeType.java b/sdk/src/main/java/com/hiero/sdk/FreezeType.java similarity index 78% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeType.java rename to sdk/src/main/java/com/hiero/sdk/FreezeType.java index 3921e0639e..a8376dbd63 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeType.java +++ b/sdk/src/main/java/com/hiero/sdk/FreezeType.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Enum for the freeze types. @@ -27,7 +27,7 @@ public enum FreezeType { * An (invalid) default value for this enum, to ensure the client explicitly sets * the intended type of freeze transaction. */ - UNKNOWN_FREEZE_TYPE(com.hedera.hashgraph.sdk.proto.FreezeType.UNKNOWN_FREEZE_TYPE), + UNKNOWN_FREEZE_TYPE(com.hiero.sdk.proto.FreezeType.UNKNOWN_FREEZE_TYPE), /** * Freezes the network at the specified time. The start_time field must be provided and @@ -35,39 +35,39 @@ public enum FreezeType { * fields will be ignored. This transaction does not perform any network changes or * upgrades and requires manual intervention to restart the network. */ - FREEZE_ONLY(com.hedera.hashgraph.sdk.proto.FreezeType.FREEZE_ONLY), + FREEZE_ONLY(com.hiero.sdk.proto.FreezeType.FREEZE_ONLY), /** * A non-freezing operation that initiates network wide preparation in advance of a * scheduled freeze upgrade. The update_file and file_hash fields must be provided and * valid. The start_time field may be omitted and any value present will be ignored. */ - PREPARE_UPGRADE(com.hedera.hashgraph.sdk.proto.FreezeType.PREPARE_UPGRADE), + PREPARE_UPGRADE(com.hiero.sdk.proto.FreezeType.PREPARE_UPGRADE), /** * Freezes the network at the specified time and performs the previously prepared * automatic upgrade across the entire network. */ - FREEZE_UPGRADE(com.hedera.hashgraph.sdk.proto.FreezeType.FREEZE_UPGRADE), + FREEZE_UPGRADE(com.hiero.sdk.proto.FreezeType.FREEZE_UPGRADE), /** * Aborts a pending network freeze operation. */ - FREEZE_ABORT(com.hedera.hashgraph.sdk.proto.FreezeType.FREEZE_ABORT), + FREEZE_ABORT(com.hiero.sdk.proto.FreezeType.FREEZE_ABORT), /** * Performs an immediate upgrade on auxilary services and containers providing * telemetry/metrics. Does not impact network operations. */ - TELEMETRY_UPGRADE(com.hedera.hashgraph.sdk.proto.FreezeType.TELEMETRY_UPGRADE); + TELEMETRY_UPGRADE(com.hiero.sdk.proto.FreezeType.TELEMETRY_UPGRADE); - final com.hedera.hashgraph.sdk.proto.FreezeType code; + final com.hiero.sdk.proto.FreezeType code; - FreezeType(com.hedera.hashgraph.sdk.proto.FreezeType code) { + FreezeType(com.hiero.sdk.proto.FreezeType code) { this.code = code; } - static FreezeType valueOf(com.hedera.hashgraph.sdk.proto.FreezeType code) { + static FreezeType valueOf(com.hiero.sdk.proto.FreezeType code) { return switch (code) { case UNKNOWN_FREEZE_TYPE -> UNKNOWN_FREEZE_TYPE; case FREEZE_ONLY -> FREEZE_ONLY; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/FutureConverter.java b/sdk/src/main/java/com/hiero/sdk/FutureConverter.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/FutureConverter.java rename to sdk/src/main/java/com/hiero/sdk/FutureConverter.java index f4e037e31c..4006d78ca3 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/FutureConverter.java +++ b/sdk/src/main/java/com/hiero/sdk/FutureConverter.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Hbar.java b/sdk/src/main/java/com/hiero/sdk/Hbar.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Hbar.java rename to sdk/src/main/java/com/hiero/sdk/Hbar.java index 5ccfc404fb..a621db40dc 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Hbar.java +++ b/sdk/src/main/java/com/hiero/sdk/Hbar.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.Splitter; @@ -60,7 +60,7 @@ public Hbar(long amount) { /** * Constructs a new hbar of the specified value in the specified unit. - * {@link com.hedera.hashgraph.sdk.HbarUnit} + * {@link com.hiero.sdk.HbarUnit} * * @param amount the amount * @param unit the unit for amount @@ -84,7 +84,7 @@ public Hbar(BigDecimal amount) { /** * Constructs a new hbar of the specified value in the specified unit. - * {@link com.hedera.hashgraph.sdk.HbarUnit} + * {@link com.hiero.sdk.HbarUnit} * * @param amount the amount * @param unit the unit for amount @@ -112,7 +112,7 @@ private static HbarUnit getUnit(String symbolString) { * Converts the provided string into an amount of hbars. * * @param text The string representing the amount of Hbar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar fromString(CharSequence text) { var matcher = FROM_STRING_PATTERN.matcher(text); @@ -128,7 +128,7 @@ public static Hbar fromString(CharSequence text) { * * @param text The string representing the amount of set units * @param unit The unit to convert from to Hbar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar fromString(CharSequence text, HbarUnit unit) { return new Hbar(new BigDecimal(text.toString()), unit); @@ -138,7 +138,7 @@ public static Hbar fromString(CharSequence text, HbarUnit unit) { * Returns an Hbar whose value is equal to the specified long. * * @param hbars The value of Hbar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar from(long hbars) { return new Hbar(hbars, HbarUnit.HBAR); @@ -149,7 +149,7 @@ public static Hbar from(long hbars) { * * @param amount The long representing the amount of set units * @param unit The unit to convert from to Hbar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar from(long amount, HbarUnit unit) { return new Hbar(amount, unit); @@ -159,7 +159,7 @@ public static Hbar from(long amount, HbarUnit unit) { * Returns an Hbar whose value is equal to the specified long. * * @param hbars The BigDecimal representing the amount of Hbar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar from(BigDecimal hbars) { return new Hbar(hbars, HbarUnit.HBAR); @@ -170,7 +170,7 @@ public static Hbar from(BigDecimal hbars) { * * @param amount The BigDecimal representing the amount of set units * @param unit The unit to convert from to Hbar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar from(BigDecimal amount, HbarUnit unit) { return new Hbar(amount, unit); @@ -180,7 +180,7 @@ public static Hbar from(BigDecimal amount, HbarUnit unit) { * Returns an Hbar converted from the specified number of tinybars. * * @param tinybars The long representing the amount of tinybar - * @return {@link com.hedera.hashgraph.sdk.Hbar} + * @return {@link com.hiero.sdk.Hbar} */ public static Hbar fromTinybars(long tinybars) { return new Hbar(tinybars, HbarUnit.TINYBAR); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/HbarAllowance.java b/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/HbarAllowance.java rename to sdk/src/main/java/com/hiero/sdk/HbarAllowance.java index 832f97d279..01bbf159ca 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/HbarAllowance.java +++ b/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoAllowance; -import com.hedera.hashgraph.sdk.proto.GrantedCryptoAllowance; +import com.hiero.sdk.proto.CryptoAllowance; +import com.hiero.sdk.proto.GrantedCryptoAllowance; import javax.annotation.Nullable; import java.util.Objects; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/HbarUnit.java b/sdk/src/main/java/com/hiero/sdk/HbarUnit.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/HbarUnit.java rename to sdk/src/main/java/com/hiero/sdk/HbarUnit.java index e604b93bfe..6bb56a6453 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/HbarUnit.java +++ b/sdk/src/main/java/com/hiero/sdk/HbarUnit.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Common units of hbar; for the most part they follow SI prefix conventions. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/HederaPreCheckStatusException.java b/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/HederaPreCheckStatusException.java rename to sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java index 73a5975327..155770948e 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/HederaPreCheckStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/HederaReceiptStatusException.java b/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/HederaReceiptStatusException.java rename to sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java index 0ab1306152..7160f91dc7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/HederaReceiptStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * An Exception thrown on error status by {@link TransactionId#getReceipt(Client)}. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/HederaTrustManager.java b/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/HederaTrustManager.java rename to sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java index dae46e2da9..35029fd2e6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/HederaTrustManager.java +++ b/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/InstantConverter.java b/sdk/src/main/java/com/hiero/sdk/InstantConverter.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/InstantConverter.java rename to sdk/src/main/java/com/hiero/sdk/InstantConverter.java index 0380f114d7..7d7887bbc9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/InstantConverter.java +++ b/sdk/src/main/java/com/hiero/sdk/InstantConverter.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TimestampSeconds; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TimestampSeconds; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Key.java b/sdk/src/main/java/com/hiero/sdk/Key.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Key.java rename to sdk/src/main/java/com/hiero/sdk/Key.java index dbcabbffc4..29b5dc7a22 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Key.java +++ b/sdk/src/main/java/com/hiero/sdk/Key.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import org.bouncycastle.asn1.ASN1ObjectIdentifier; @@ -52,7 +52,7 @@ public abstract class Key { * @param key the protobuf key of unknown type * @return the differentiated key */ - static Key fromProtobufKey(com.hedera.hashgraph.sdk.proto.Key key) { + static Key fromProtobufKey(com.hiero.sdk.proto.Key key) { switch (key.getKeyCase()) { case ED25519 -> { return PublicKeyED25519.fromBytesInternal(key.getEd25519().toByteArray()); @@ -86,7 +86,7 @@ static Key fromProtobufKey(com.hedera.hashgraph.sdk.proto.Key key) { /** * Serialize this key as a protobuf object */ - abstract com.hedera.hashgraph.sdk.proto.Key toProtobufKey(); + abstract com.hiero.sdk.proto.Key toProtobufKey(); /** * Create the byte array. @@ -105,6 +105,6 @@ public byte[] toBytes() { * @throws InvalidProtocolBufferException */ public static Key fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobufKey(com.hedera.hashgraph.sdk.proto.Key.parseFrom(bytes)); + return fromProtobufKey(com.hiero.sdk.proto.Key.parseFrom(bytes)); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/KeyList.java b/sdk/src/main/java/com/hiero/sdk/KeyList.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/KeyList.java rename to sdk/src/main/java/com/hiero/sdk/KeyList.java index a0abd79e53..8df42806a0 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/KeyList.java +++ b/sdk/src/main/java/com/hiero/sdk/KeyList.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hedera.hashgraph.sdk.proto.ThresholdKey; +import com.hiero.sdk.proto.ThresholdKey; import javax.annotation.Nullable; import java.util.ArrayList; @@ -97,7 +97,7 @@ public static KeyList withThreshold(int threshold) { * @param threshold the minimum number of keys that must sign * @return the key list */ - static KeyList fromProtobuf(com.hedera.hashgraph.sdk.proto.KeyList keyList, @Nullable Integer threshold) { + static KeyList fromProtobuf(com.hiero.sdk.proto.KeyList keyList, @Nullable Integer threshold) { var keys = (threshold != null ? new KeyList(threshold) : new KeyList()); for (var i = 0; i < keyList.getKeysCount(); ++i) { keys.add(Key.fromProtobufKey(keyList.getKeys(i))); @@ -194,21 +194,21 @@ public void clear() { } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { - var protoKeyList = com.hedera.hashgraph.sdk.proto.KeyList.newBuilder(); + com.hiero.sdk.proto.Key toProtobufKey() { + var protoKeyList = com.hiero.sdk.proto.KeyList.newBuilder(); for (var key : keys) { protoKeyList.addKeys(key.toProtobufKey()); } if (threshold != null) { - return com.hedera.hashgraph.sdk.proto.Key.newBuilder() + return com.hiero.sdk.proto.Key.newBuilder() .setThresholdKey(ThresholdKey.newBuilder() .setThreshold(threshold) .setKeys(protoKeyList)) .build(); } - return com.hedera.hashgraph.sdk.proto.Key.newBuilder() + return com.hiero.sdk.proto.Key.newBuilder() .setKeyList(protoKeyList) .build(); } @@ -218,8 +218,8 @@ com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.KeyList toProtobuf() { - var keyList = com.hedera.hashgraph.sdk.proto.KeyList.newBuilder(); + com.hiero.sdk.proto.KeyList toProtobuf() { + var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); for (Key key : keys) { keyList.addKeys(key.toProtobufKey()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Keystore.java b/sdk/src/main/java/com/hiero/sdk/Keystore.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Keystore.java rename to sdk/src/main/java/com/hiero/sdk/Keystore.java index 6e94cb54e3..44a2c2f1b8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Keystore.java +++ b/sdk/src/main/java/com/hiero/sdk/Keystore.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.gson.Gson; import com.google.gson.JsonIOException; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/LedgerId.java b/sdk/src/main/java/com/hiero/sdk/LedgerId.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/LedgerId.java rename to sdk/src/main/java/com/hiero/sdk/LedgerId.java index fad6abfbd6..dcaaf3529d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/LedgerId.java +++ b/sdk/src/main/java/com/hiero/sdk/LedgerId.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHash.java b/sdk/src/main/java/com/hiero/sdk/LiveHash.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHash.java rename to sdk/src/main/java/com/hiero/sdk/LiveHash.java index ac0e1a9c2b..ff283bee1c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHash.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHash.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; @@ -76,7 +76,7 @@ private LiveHash(AccountId accountId, ByteString hash, KeyList keys, Duration du * @param liveHash the protobuf * @return the new live hash */ - protected static LiveHash fromProtobuf(com.hedera.hashgraph.sdk.proto.LiveHash liveHash) { + protected static LiveHash fromProtobuf(com.hiero.sdk.proto.LiveHash liveHash) { return new LiveHash( AccountId.fromProtobuf(liveHash.getAccountId()), liveHash.getHash(), @@ -93,7 +93,7 @@ protected static LiveHash fromProtobuf(com.hedera.hashgraph.sdk.proto.LiveHash l * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static LiveHash fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.LiveHash.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.LiveHash.parseFrom(bytes).toBuilder().build()); } /** @@ -101,13 +101,13 @@ public static LiveHash fromBytes(byte[] bytes) throws InvalidProtocolBufferExcep * * @return the protobuf */ - protected com.hedera.hashgraph.sdk.proto.LiveHash toProtobuf() { - var keyList = com.hedera.hashgraph.sdk.proto.KeyList.newBuilder(); + protected com.hiero.sdk.proto.LiveHash toProtobuf() { + var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); for (Key key : keys) { keyList.addKeys(key.toProtobufKey()); } - return com.hedera.hashgraph.sdk.proto.LiveHash.newBuilder() + return com.hiero.sdk.proto.LiveHash.newBuilder() .setAccountId(accountId.toProtobuf()) .setHash(hash) .setKeys(keyList) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashAddTransaction.java b/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashAddTransaction.java rename to sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java index 97d52d5027..10d1130979 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashAddTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoAddLiveHashTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.LiveHash; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoAddLiveHashTransactionBody; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.LiveHash; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; @@ -63,7 +63,7 @@ public LiveHashAddTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - LiveHashAddTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + LiveHashAddTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -194,7 +194,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.CryptoAddLiveHashTransactionBody} + * @return {@link com.hiero.sdk.proto.CryptoAddLiveHashTransactionBody} */ CryptoAddLiveHashTransactionBody.Builder build() { var builder = CryptoAddLiveHashTransactionBody.newBuilder(); @@ -221,7 +221,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getAddLiveHashMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java similarity index 87% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java index ebbfc1a4e2..1094fda0a9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteLiveHashTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.CryptoDeleteLiveHashTransactionBody; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -55,7 +55,7 @@ public LiveHashDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - LiveHashDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + LiveHashDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -130,7 +130,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.CryptoAddLiveHashTransactionBody} + * @return {@link com.hiero.sdk.proto.CryptoAddLiveHashTransactionBody} */ CryptoDeleteLiveHashTransactionBody.Builder build() { var builder = CryptoDeleteLiveHashTransactionBody.newBuilder(); @@ -150,7 +150,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getDeleteLiveHashMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashQuery.java b/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashQuery.java rename to sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java index 6d08e1425c..fd176e1d13 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/LiveHashQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.CryptoGetLiveHashQuery; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.CryptoGetLiveHashQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -95,7 +95,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetLiveHashQuery.newBuilder(); if (accountId != null) { builder.setAccountID(accountId.toProtobuf()); @@ -106,7 +106,7 @@ void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, Qu } @Override - LiveHash mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + LiveHash mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return LiveHash.fromProtobuf(response.getCryptoGetLiveHash().getLiveHash()); } @@ -116,12 +116,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getCryptoGetLiveHash().getHeader(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoGetBalanceMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/LockableList.java b/sdk/src/main/java/com/hiero/sdk/LockableList.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/LockableList.java rename to sdk/src/main/java/com/hiero/sdk/LockableList.java index a61ac8efc4..69e9644c77 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/LockableList.java +++ b/sdk/src/main/java/com/hiero/sdk/LockableList.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.*; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MaxAttemptsExceededException.java b/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MaxAttemptsExceededException.java rename to sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java index c2478f7925..5af1b08559 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MaxAttemptsExceededException.java +++ b/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MaxQueryPaymentExceededException.java b/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MaxQueryPaymentExceededException.java rename to sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java index ea78f3d1d8..e17a57c85d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MaxQueryPaymentExceededException.java +++ b/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Signals that a query will cost more than a pre-configured maximum payment amount. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNetwork.java b/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNetwork.java rename to sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java index 75df2b0337..208ce0b163 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNetwork.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.ArrayList; import java.util.HashMap; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNode.java b/sdk/src/main/java/com/hiero/sdk/MirrorNode.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNode.java rename to sdk/src/main/java/com/hiero/sdk/MirrorNode.java index 9ceec34db2..ae3e995f53 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNode.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNode.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.concurrent.ExecutorService; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractCallQuery.java b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractCallQuery.java rename to sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java index 7601f683cc..84fb837570 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractCallQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java @@ -18,7 +18,7 @@ * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.concurrent.ExecutionException; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractEstimateGasQuery.java b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractEstimateGasQuery.java rename to sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java index 2c9562c952..66bbb9fd8b 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractEstimateGasQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java @@ -18,7 +18,7 @@ * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.util.concurrent.ExecutionException; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractQuery.java b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractQuery.java rename to sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java index 6047ea64ce..64efd0ef86 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/MirrorNodeContractQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java @@ -18,11 +18,11 @@ * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import static com.hedera.hashgraph.sdk.EntityIdHelper.getContractAddressFromMirrorNodeAsync; -import static com.hedera.hashgraph.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; -import static com.hedera.hashgraph.sdk.EntityIdHelper.performQueryToMirrorNodeAsync; +import static com.hiero.sdk.EntityIdHelper.getContractAddressFromMirrorNodeAsync; +import static com.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; +import static com.hiero.sdk.EntityIdHelper.performQueryToMirrorNodeAsync; import com.google.gson.JsonObject; import com.google.gson.JsonParser; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Mnemonic.java b/sdk/src/main/java/com/hiero/sdk/Mnemonic.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Mnemonic.java rename to sdk/src/main/java/com/hiero/sdk/Mnemonic.java index 3a5004a0db..1d322d3b27 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Mnemonic.java +++ b/sdk/src/main/java/com/hiero/sdk/Mnemonic.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.Joiner; -import com.hedera.hashgraph.sdk.utils.Bip32Utils; +import com.hiero.sdk.utils.Bip32Utils; import org.bouncycastle.crypto.digests.SHA256Digest; import org.bouncycastle.crypto.digests.SHA512Digest; import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java b/sdk/src/main/java/com/hiero/sdk/Network.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java rename to sdk/src/main/java/com/hiero/sdk/Network.java index 350dc0a6d9..b8c97d1abd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java +++ b/sdk/src/main/java/com/hiero/sdk/Network.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.io.ByteStreams; import com.google.protobuf.ByteString; @@ -256,7 +256,7 @@ protected Node createNodeFromNetworkEntry(Map.Entry entry) { * Pick 1/3 of the nodes sorted by health and expected delay from the network. * This is used by Query and Transaction for selecting node AccountId's. * - * @return {@link java.util.List} + * @return {@link java.util.List} */ synchronized List getNodeAccountIdsForExecute() throws InterruptedException { var nodes = getNumberOfMostHealthyNodes(getNumberOfNodesForRequest()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkName.java b/sdk/src/main/java/com/hiero/sdk/NetworkName.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkName.java rename to sdk/src/main/java/com/hiero/sdk/NetworkName.java index 6759c55b45..d8be9eb7e8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkName.java +++ b/sdk/src/main/java/com/hiero/sdk/NetworkName.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Enum for the network names. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkVersionInfo.java b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkVersionInfo.java rename to sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java index 784033ae77..1b767001e0 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkVersionInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.NetworkGetVersionInfoResponse; +import com.hiero.sdk.proto.NetworkGetVersionInfoResponse; /** * Internal utility class. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java similarity index 71% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java index a457a02b6a..b453e55519 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.NetworkGetVersionInfoQuery; -import com.hedera.hashgraph.sdk.proto.NetworkServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.NetworkGetVersionInfoQuery; +import com.hiero.sdk.proto.NetworkServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; /** @@ -37,7 +37,7 @@ public NetworkVersionInfoQuery() { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { queryBuilder.setNetworkGetVersionInfo(NetworkGetVersionInfoQuery.newBuilder().setHeader(header)); } @@ -47,7 +47,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getNetworkGetVersionInfo().getHeader(); } @@ -57,12 +57,12 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - NetworkVersionInfo mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + NetworkVersionInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return NetworkVersionInfo.fromProtobuf(response.getNetworkGetVersionInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return NetworkServiceGrpc.getGetVersionInfoMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NftId.java b/sdk/src/main/java/com/hiero/sdk/NftId.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NftId.java rename to sdk/src/main/java/com/hiero/sdk/NftId.java index 33e0ca25b0..303c04cba4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NftId.java +++ b/sdk/src/main/java/com/hiero/sdk/NftId.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.NftID; +import com.hiero.sdk.proto.NftID; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Node.java b/sdk/src/main/java/com/hiero/sdk/Node.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Node.java rename to sdk/src/main/java/com/hiero/sdk/Node.java index 14406e94fa..b29c4d4547 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Node.java +++ b/sdk/src/main/java/com/hiero/sdk/Node.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import io.grpc.ChannelCredentials; import io.grpc.TlsChannelCredentials; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeAddress.java b/sdk/src/main/java/com/hiero/sdk/NodeAddress.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NodeAddress.java rename to sdk/src/main/java/com/hiero/sdk/NodeAddress.java index 350455a03f..c5b7071f80 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeAddress.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeAddress.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ServiceEndpoint; +import com.hiero.sdk.proto.ServiceEndpoint; import javax.annotation.Nullable; import java.nio.charset.StandardCharsets; @@ -80,7 +80,7 @@ public class NodeAddress implements Cloneable { * @param nodeAddress the protobuf * @return the new node */ - static NodeAddress fromProtobuf(com.hedera.hashgraph.sdk.proto.NodeAddress nodeAddress) { + static NodeAddress fromProtobuf(com.hiero.sdk.proto.NodeAddress nodeAddress) { var address = new ArrayList(nodeAddress.getServiceEndpointCount()); if (!nodeAddress.getIpAddress().isEmpty()) { @@ -269,8 +269,8 @@ public NodeAddress setStake(long stake) { * * @return the protobuf representation. */ - com.hedera.hashgraph.sdk.proto.NodeAddress toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.NodeAddress.newBuilder() + com.hiero.sdk.proto.NodeAddress toProtobuf() { + var builder = com.hiero.sdk.proto.NodeAddress.newBuilder() .setNodeId(nodeId); if (certHash != null) { diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeAddressBook.java b/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NodeAddressBook.java rename to sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java index 2b53efdd2f..60e3e3def4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeAddressBook.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; @@ -75,7 +75,7 @@ static List cloneNodeAddresses(List addresses) { * @param book the protobuf * @return the new node address book */ - static NodeAddressBook fromProtobuf(com.hedera.hashgraph.sdk.proto.NodeAddressBook book) { + static NodeAddressBook fromProtobuf(com.hiero.sdk.proto.NodeAddressBook book) { var addresses = new ArrayList(book.getNodeAddressCount()); for (var address : book.getNodeAddressList()) { @@ -93,7 +93,7 @@ static NodeAddressBook fromProtobuf(com.hedera.hashgraph.sdk.proto.NodeAddressBo * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static NodeAddressBook fromBytes(ByteString bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.NodeAddressBook.parseFrom(bytes)); + return fromProtobuf(com.hiero.sdk.proto.NodeAddressBook.parseFrom(bytes)); } /** @@ -101,8 +101,8 @@ public static NodeAddressBook fromBytes(ByteString bytes) throws InvalidProtocol * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.NodeAddressBook toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.NodeAddressBook.newBuilder(); + com.hiero.sdk.proto.NodeAddressBook toProtobuf() { + var builder = com.hiero.sdk.proto.NodeAddressBook.newBuilder(); for (var nodeAdress : nodeAddresses) { builder.addNodeAddress(nodeAdress.toProtobuf()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java index 5779d3fe0f..7de2eddb97 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AddressBookServiceGrpc; -import com.hedera.hashgraph.sdk.proto.NodeCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.AddressBookServiceGrpc; +import com.hiero.sdk.proto.NodeCreateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -164,7 +164,7 @@ public NodeCreateTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ NodeCreateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -175,7 +175,7 @@ public NodeCreateTransaction() {} * * @param txBody protobuf TransactionBody */ - NodeCreateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + NodeCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -347,7 +347,7 @@ public NodeCreateTransaction setAdminKey(Key adminKey) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.NodeCreateTransactionBody} + * @return {@link com.hiero.sdk.proto.NodeCreateTransactionBody} */ NodeCreateTransactionBody.Builder build() { var builder = NodeCreateTransactionBody.newBuilder(); @@ -420,7 +420,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return AddressBookServiceGrpc.getCreateNodeMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java similarity index 87% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NodeDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java index 37c594f3c2..50d5b57d43 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AddressBookServiceGrpc; -import com.hedera.hashgraph.sdk.proto.NodeDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.AddressBookServiceGrpc; +import com.hiero.sdk.proto.NodeDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -69,7 +69,7 @@ public NodeDeleteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ NodeDeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -107,7 +107,7 @@ public NodeDeleteTransaction setNodeId(long nodeId) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.NodeDeleteTransactionBody} + * @return {@link com.hiero.sdk.proto.NodeDeleteTransactionBody} */ NodeDeleteTransactionBody.Builder build() { var builder = NodeDeleteTransactionBody.newBuilder(); @@ -129,7 +129,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return AddressBookServiceGrpc.getDeleteNodeMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java index de5a315758..8a985c1356 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.AddressBookServiceGrpc; -import com.hedera.hashgraph.sdk.proto.NodeUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.AddressBookServiceGrpc; +import com.hiero.sdk.proto.NodeUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -191,7 +191,7 @@ public NodeUpdateTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ NodeUpdateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -202,7 +202,7 @@ public NodeUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - NodeUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + NodeUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -404,7 +404,7 @@ public NodeUpdateTransaction setAdminKey(Key adminKey) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.NodeUpdateTransactionBody} + * @return {@link com.hiero.sdk.proto.NodeUpdateTransactionBody} */ NodeUpdateTransactionBody.Builder build() { var builder = NodeUpdateTransactionBody.newBuilder(); @@ -487,7 +487,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return AddressBookServiceGrpc.getUpdateNodeMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Pem.java b/sdk/src/main/java/com/hiero/sdk/Pem.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Pem.java rename to sdk/src/main/java/com/hiero/sdk/Pem.java index f8ec830f86..9db6d43d01 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Pem.java +++ b/sdk/src/main/java/com/hiero/sdk/Pem.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropId.java b/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropId.java rename to sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java index 2a826289d1..82a2e049de 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropId.java +++ b/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import javax.annotation.Nonnull; @@ -90,7 +90,7 @@ public PendingAirdropId setNftId(@Nullable NftId nftId) { return this; } - static PendingAirdropId fromProtobuf(com.hedera.hashgraph.sdk.proto.PendingAirdropId pendingAirdropId) { + static PendingAirdropId fromProtobuf(com.hiero.sdk.proto.PendingAirdropId pendingAirdropId) { if (pendingAirdropId.hasFungibleTokenType()) { return new PendingAirdropId(AccountId.fromProtobuf(pendingAirdropId.getSenderId()), AccountId.fromProtobuf(pendingAirdropId.getReceiverId()), @@ -102,8 +102,8 @@ static PendingAirdropId fromProtobuf(com.hedera.hashgraph.sdk.proto.PendingAirdr } } - com.hedera.hashgraph.sdk.proto.PendingAirdropId toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.PendingAirdropId.newBuilder() + com.hiero.sdk.proto.PendingAirdropId toProtobuf() { + var builder = com.hiero.sdk.proto.PendingAirdropId.newBuilder() .setSenderId(sender.toProtobuf()) .setReceiverId(receiver.toProtobuf()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropLogic.java b/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropLogic.java rename to sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java index c8fafb043c..a5583331ad 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropLogic.java +++ b/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; @@ -39,7 +39,7 @@ protected PendingAirdropLogic() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ PendingAirdropLogic( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); } @@ -49,7 +49,7 @@ protected PendingAirdropLogic() {} * * @param txBody protobuf TransactionBody */ - PendingAirdropLogic(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + PendingAirdropLogic(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropRecord.java b/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropRecord.java rename to sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java index ebff20ab96..2970b4fdb1 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PendingAirdropRecord.java +++ b/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hedera.hashgraph.sdk.proto.PendingAirdropValue; +import com.hiero.sdk.proto.PendingAirdropValue; public class PendingAirdropRecord { private final PendingAirdropId pendingAirdropId; @@ -39,14 +39,14 @@ public long getPendingAirdropAmount() { return pendingAirdropAmount; } - com.hedera.hashgraph.sdk.proto.PendingAirdropRecord toProtobuf() { - return com.hedera.hashgraph.sdk.proto.PendingAirdropRecord.newBuilder() + com.hiero.sdk.proto.PendingAirdropRecord toProtobuf() { + return com.hiero.sdk.proto.PendingAirdropRecord.newBuilder() .setPendingAirdropId(this.pendingAirdropId.toProtobuf()) .setPendingAirdropValue(PendingAirdropValue.newBuilder().setAmount(pendingAirdropAmount)) .build(); } - static PendingAirdropRecord fromProtobuf(com.hedera.hashgraph.sdk.proto.PendingAirdropRecord pendingAirdropRecord) { + static PendingAirdropRecord fromProtobuf(com.hiero.sdk.proto.PendingAirdropRecord pendingAirdropRecord) { return new PendingAirdropRecord( PendingAirdropId.fromProtobuf(pendingAirdropRecord.getPendingAirdropId()), pendingAirdropRecord.getPendingAirdropValue().getAmount()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrecheckStatusException.java b/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PrecheckStatusException.java rename to sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java index 10ac1ace55..8ae5696493 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrecheckStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKey.java b/sdk/src/main/java/com/hiero/sdk/PrivateKey.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKey.java rename to sdk/src/main/java/com/hiero/sdk/PrivateKey.java index 7152727c35..697e68fdc4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKey.java +++ b/sdk/src/main/java/com/hiero/sdk/PrivateKey.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; import org.bouncycastle.asn1.sec.ECPrivateKey; @@ -251,7 +251,7 @@ private static PrivateKey fromPrivateKeyInfo(PrivateKeyInfo privateKeyInfo) { * This will read the first "PRIVATE KEY" section in the stream as an Ed25519 private key. * * @param pemFile The Reader containing the pem file - * @return {@link com.hedera.hashgraph.sdk.PrivateKey} + * @return {@link com.hiero.sdk.PrivateKey} * @throws IOException if one occurred while reading. * @throws BadKeyException if no "PRIVATE KEY" section was found or the key was not an Ed25519 * private key. @@ -281,7 +281,7 @@ public static PrivateKey readPem(Reader pemFile) throws IOException { * * @param pemFile the PEM encoded file * @param password the password to decrypt the PEM file; if null or empty, no decryption is performed. - * @return {@link com.hedera.hashgraph.sdk.PrivateKey} + * @return {@link com.hiero.sdk.PrivateKey} * @throws IOException if one occurred while reading the PEM file * @throws BadKeyException if no "ENCRYPTED PRIVATE KEY" or "PRIVATE KEY" section was found, * if the passphrase is wrong or the key was not an Ed25519 private key. @@ -294,7 +294,7 @@ public static PrivateKey readPem(Reader pemFile, @Nullable String password) thro * Parse a private key from a PEM encoded string. * * @param pemEncoded The String containing the pem - * @return {@link com.hedera.hashgraph.sdk.PrivateKey} + * @return {@link com.hiero.sdk.PrivateKey} * @throws IOException if the PEM string was improperly encoded * @throws BadKeyException if no "PRIVATE KEY" section was found or the key was not an Ed25519 * private key. @@ -311,7 +311,7 @@ public static PrivateKey fromPem(String pemEncoded) throws IOException { * * @param encodedPem the encoded PEM string * @param password the password to decrypt the PEM file; if null or empty, no decryption is performed. - * @return {@link com.hedera.hashgraph.sdk.PrivateKey} + * @return {@link com.hiero.sdk.PrivateKey} * @throws IOException if the PEM string was improperly encoded * @throws BadKeyException if no "ENCRYPTED PRIVATE KEY" or "PRIVATE KEY" section was found, * if the passphrase is wrong or the key was not an Ed25519 private key. @@ -451,7 +451,7 @@ public AccountId toAccountId(@Nonnegative long shard, @Nonnegative long realm) { } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { + com.hiero.sdk.proto.Key toProtobufKey() { // Forward to the corresponding public key. return getPublicKey().toProtobufKey(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKeyECDSA.java b/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKeyECDSA.java rename to sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java index aa90d593d5..f70c788c10 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKeyECDSA.java +++ b/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.utils.Bip32Utils; +import com.hiero.sdk.utils.Bip32Utils; import org.bouncycastle.asn1.*; import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; import org.bouncycastle.asn1.sec.ECPrivateKey; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKeyED25519.java b/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKeyED25519.java rename to sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java index daa3feb20c..0d4a9a515f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrivateKeyED25519.java +++ b/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.utils.Bip32Utils; +import com.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrngTransaction.java b/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PrngTransaction.java rename to sdk/src/main/java/com/hiero/sdk/PrngTransaction.java index ba30ba3b45..7890086059 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PrngTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.*; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.*; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -88,7 +88,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return UtilServiceGrpc.getPrngMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ProxyStaker.java b/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ProxyStaker.java rename to sdk/src/main/java/com/hiero/sdk/ProxyStaker.java index 8285607561..7c30ff0cb2 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ProxyStaker.java +++ b/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Information about a single account that is proxy staking. @@ -50,7 +50,7 @@ private ProxyStaker(AccountId accountId, long amount) { * @param proxyStaker the protobuf * @return the new proxy staker object */ - static ProxyStaker fromProtobuf(com.hedera.hashgraph.sdk.proto.ProxyStaker proxyStaker) { + static ProxyStaker fromProtobuf(com.hiero.sdk.proto.ProxyStaker proxyStaker) { return new ProxyStaker(AccountId.fromProtobuf(proxyStaker.getAccountID()), proxyStaker.getAmount()); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKey.java b/sdk/src/main/java/com/hiero/sdk/PublicKey.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKey.java rename to sdk/src/main/java/com/hiero/sdk/PublicKey.java index d541d5ae03..26f8499dd0 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKey.java +++ b/sdk/src/main/java/com/hiero/sdk/PublicKey.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SignaturePair; +import com.hiero.sdk.proto.SignaturePair; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.math.ec.rfc8032.Ed25519; @@ -153,7 +153,7 @@ private static PublicKey fromSubjectKeyInfo(SubjectPublicKeyInfo subjectPublicKe static PublicKey fromAliasBytes(ByteString aliasBytes) { if (!aliasBytes.isEmpty()) { try { - var key = Key.fromProtobufKey(com.hedera.hashgraph.sdk.proto.Key.parseFrom(aliasBytes)); + var key = Key.fromProtobufKey(com.hiero.sdk.proto.Key.parseFrom(aliasBytes)); return (key instanceof PublicKey) ? ((PublicKey) key) : null; } catch (InvalidProtocolBufferException ignored) { } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKeyECDSA.java b/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKeyECDSA.java rename to sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java index 986a2c1426..b4d3e0e115 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKeyECDSA.java +++ b/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import static com.hedera.hashgraph.sdk.Crypto.calcKeccak256; +import static com.hiero.sdk.Crypto.calcKeccak256; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.SignaturePair; +import com.hiero.sdk.proto.SignaturePair; import java.io.IOException; import java.math.BigInteger; import java.util.Arrays; @@ -100,8 +100,8 @@ public boolean verify(byte[] message, byte[] signature) { } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { - return com.hedera.hashgraph.sdk.proto.Key.newBuilder() + com.hiero.sdk.proto.Key toProtobufKey() { + return com.hiero.sdk.proto.Key.newBuilder() .setECDSASecp256K1(ByteString.copyFrom(keyData)) .build(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKeyED25519.java b/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKeyED25519.java rename to sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java index ca7928aa62..8decf88b90 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/PublicKeyED25519.java +++ b/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.SignaturePair; +import com.hiero.sdk.proto.SignaturePair; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.crypto.params.Ed25519PublicKeyParameters; @@ -87,8 +87,8 @@ public boolean verify(byte[] message, byte[] signature) { } @Override - com.hedera.hashgraph.sdk.proto.Key toProtobufKey() { - return com.hedera.hashgraph.sdk.proto.Key.newBuilder() + com.hiero.sdk.proto.Key toProtobufKey() { + return com.hiero.sdk.proto.Key.newBuilder() .setEd25519(ByteString.copyFrom(keyData)) .build(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Query.java b/sdk/src/main/java/com/hiero/sdk/Query.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Query.java rename to sdk/src/main/java/com/hiero/sdk/Query.java index aa833af0e4..8c8dcff057 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Query.java +++ b/sdk/src/main/java/com/hiero/sdk/Query.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.ResponseType; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.ResponseType; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -46,8 +46,8 @@ * @param The output type of the query. * @param The type of the query itself. Used to enable chaining. */ -public abstract class Query> extends Executable { - private final com.hedera.hashgraph.sdk.proto.Query.Builder builder; +public abstract class Query> extends Executable { + private final com.hiero.sdk.proto.Query.Builder builder; private final QueryHeader.Builder headerBuilder; @@ -77,7 +77,7 @@ public abstract class Query> extends Executable getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return Query.this.getMethodDescriptor(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ReceiptStatusException.java b/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ReceiptStatusException.java rename to sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java index 2792f5e205..033a270b4f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ReceiptStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/RequestType.java b/sdk/src/main/java/com/hiero/sdk/RequestType.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/RequestType.java rename to sdk/src/main/java/com/hiero/sdk/RequestType.java index d528b5d7d5..277dca4b6c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/RequestType.java +++ b/sdk/src/main/java/com/hiero/sdk/RequestType.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.HederaFunctionality; +import com.hiero.sdk.proto.HederaFunctionality; /** * Enum for the request types. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java index 4cd57c7846..1c9ecd9ffd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.ScheduleCreateTransactionBody; +import com.hiero.sdk.proto.ScheduleServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; @@ -65,7 +65,7 @@ public ScheduleCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ScheduleCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ScheduleCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -228,7 +228,7 @@ public ScheduleCreateTransaction setScheduleMemo(String memo) { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.ScheduleCreateTransactionBody builder } + * @return {@link com.hiero.sdk.proto.ScheduleCreateTransactionBody builder } */ ScheduleCreateTransactionBody.Builder build() { var builder = ScheduleCreateTransactionBody.newBuilder(); @@ -276,7 +276,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ScheduleServiceGrpc.getCreateScheduleMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java index c4d39ad114..ae96a174f8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.ScheduleDeleteTransactionBody; +import com.hiero.sdk.proto.ScheduleServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -55,7 +55,7 @@ public ScheduleDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ScheduleDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ScheduleDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -65,7 +65,7 @@ public ScheduleDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - ScheduleDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + ScheduleDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -106,7 +106,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.ScheduleDeleteTransactionBody builder } + * @return {@link com.hiero.sdk.proto.ScheduleDeleteTransactionBody builder } */ ScheduleDeleteTransactionBody.Builder build() { var builder = ScheduleDeleteTransactionBody.newBuilder(); @@ -125,7 +125,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ScheduleServiceGrpc.getDeleteScheduleMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleId.java b/sdk/src/main/java/com/hiero/sdk/ScheduleId.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleId.java rename to sdk/src/main/java/com/hiero/sdk/ScheduleId.java index 5f18dfba4e..8ab8fb944b 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleId.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleId.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ScheduleID; +import com.hiero.sdk.proto.ScheduleID; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleInfo.java b/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleInfo.java rename to sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java index 2262b051f3..7a16737c58 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleGetInfoResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.ScheduleGetInfoResponse; import java.time.Instant; import javax.annotation.Nullable; @@ -165,7 +165,7 @@ public final class ScheduleInfo { * @param info the protobuf * @return the new schedule info object */ - static ScheduleInfo fromProtobuf(com.hedera.hashgraph.sdk.proto.ScheduleInfo info) { + static ScheduleInfo fromProtobuf(com.hiero.sdk.proto.ScheduleInfo info) { var scheduleId = ScheduleId.fromProtobuf(info.getScheduleID()); var creatorAccountId = AccountId.fromProtobuf(info.getCreatorAccountID()); var payerAccountId = AccountId.fromProtobuf(info.getPayerAccountID()); @@ -199,7 +199,7 @@ static ScheduleInfo fromProtobuf(com.hedera.hashgraph.sdk.proto.ScheduleInfo inf * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static ScheduleInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.ScheduleInfo.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.ScheduleInfo.parseFrom(bytes).toBuilder().build()); } /** @@ -207,8 +207,8 @@ public static ScheduleInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferE * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.ScheduleInfo toProtobuf() { - var info = com.hedera.hashgraph.sdk.proto.ScheduleInfo.newBuilder(); + com.hiero.sdk.proto.ScheduleInfo toProtobuf() { + var info = com.hiero.sdk.proto.ScheduleInfo.newBuilder(); if (adminKey != null) { info.setAdminKey(adminKey.toProtobufKey()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java index e5a7b0cdc9..1a5c8d27dc 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Query; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.ScheduleGetInfoQuery; -import com.hedera.hashgraph.sdk.proto.ScheduleServiceGrpc; +import com.hiero.sdk.proto.Query; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.ScheduleGetInfoQuery; +import com.hiero.sdk.proto.ScheduleServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -36,7 +36,7 @@ * * See Hedera Documentation */ -public class ScheduleInfoQuery extends com.hedera.hashgraph.sdk.Query { +public class ScheduleInfoQuery extends com.hiero.sdk.Query { @Nullable private ScheduleId scheduleId = null; @@ -76,7 +76,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ScheduleGetInfoQuery.newBuilder(); if (scheduleId != null) { builder.setScheduleID(scheduleId.toProtobuf()); @@ -91,7 +91,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getScheduleGetInfo().getHeader(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleSignTransaction.java b/sdk/src/main/java/com/hiero/sdk/ScheduleSignTransaction.java similarity index 87% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleSignTransaction.java rename to sdk/src/main/java/com/hiero/sdk/ScheduleSignTransaction.java index a1f04041b6..ef4ad4b906 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ScheduleSignTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleSignTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleServiceGrpc; -import com.hedera.hashgraph.sdk.proto.ScheduleSignTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.ScheduleServiceGrpc; +import com.hiero.sdk.proto.ScheduleSignTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -63,7 +63,7 @@ public ScheduleSignTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ScheduleSignTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ScheduleSignTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -107,7 +107,7 @@ public ScheduleSignTransaction clearScheduleId() { * Build the correct transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.ScheduleSignTransactionBody + * com.hiero.sdk.proto.ScheduleSignTransactionBody * builder } */ ScheduleSignTransactionBody.Builder build() { @@ -137,7 +137,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ScheduleServiceGrpc.getSignScheduleMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/SemanticVersion.java b/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java similarity index 88% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/SemanticVersion.java rename to sdk/src/main/java/com/hiero/sdk/SemanticVersion.java index 3a27eb46f3..3f64f071ac 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/SemanticVersion.java +++ b/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -62,7 +62,7 @@ public class SemanticVersion { * @param version the protobuf * @return the new semantic version */ - protected static SemanticVersion fromProtobuf(com.hedera.hashgraph.sdk.proto.SemanticVersion version) { + protected static SemanticVersion fromProtobuf(com.hiero.sdk.proto.SemanticVersion version) { return new SemanticVersion( version.getMajor(), version.getMinor(), @@ -78,7 +78,7 @@ protected static SemanticVersion fromProtobuf(com.hedera.hashgraph.sdk.proto.Sem * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static SemanticVersion fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.SemanticVersion.parseFrom(bytes)); + return fromProtobuf(com.hiero.sdk.proto.SemanticVersion.parseFrom(bytes)); } /** @@ -86,8 +86,8 @@ public static SemanticVersion fromBytes(byte[] bytes) throws InvalidProtocolBuff * * @return the protobuf representation */ - protected com.hedera.hashgraph.sdk.proto.SemanticVersion toProtobuf() { - return com.hedera.hashgraph.sdk.proto.SemanticVersion.newBuilder() + protected com.hiero.sdk.proto.SemanticVersion toProtobuf() { + return com.hiero.sdk.proto.SemanticVersion.newBuilder() .setMajor(major) .setMinor(minor) .setPatch(patch) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/StakingInfo.java b/sdk/src/main/java/com/hiero/sdk/StakingInfo.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/StakingInfo.java rename to sdk/src/main/java/com/hiero/sdk/StakingInfo.java index f1eef7cb85..a436b65d36 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/StakingInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/StakingInfo.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -79,7 +79,7 @@ public StakingInfo(boolean declineStakingReward, Instant stakePeriodStart, Hbar this.stakedNodeId = stakedNodeId; } - static StakingInfo fromProtobuf(com.hedera.hashgraph.sdk.proto.StakingInfo info) { + static StakingInfo fromProtobuf(com.hiero.sdk.proto.StakingInfo info) { return new StakingInfo( info.getDeclineReward(), InstantConverter.fromProtobuf(info.getStakePeriodStart()), @@ -98,11 +98,11 @@ static StakingInfo fromProtobuf(com.hedera.hashgraph.sdk.proto.StakingInfo info) * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static StakingInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.StakingInfo.parseFrom(bytes)); + return fromProtobuf(com.hiero.sdk.proto.StakingInfo.parseFrom(bytes)); } - com.hedera.hashgraph.sdk.proto.StakingInfo toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.StakingInfo.newBuilder() + com.hiero.sdk.proto.StakingInfo toProtobuf() { + var builder = com.hiero.sdk.proto.StakingInfo.newBuilder() .setDeclineReward(declineStakingReward) .setStakePeriodStart(InstantConverter.toProtobuf(stakePeriodStart)) .setPendingReward(pendingReward.toTinybars()) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Status.java b/sdk/src/main/java/com/hiero/sdk/Status.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Status.java rename to sdk/src/main/java/com/hiero/sdk/Status.java index 4290ab9bff..46fbb5f538 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Status.java +++ b/sdk/src/main/java/com/hiero/sdk/Status.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.proto.ResponseCodeEnum; import java.util.Objects; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/StorageChange.java b/sdk/src/main/java/com/hiero/sdk/StorageChange.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/StorageChange.java rename to sdk/src/main/java/com/hiero/sdk/StorageChange.java index ddd0245ca1..741bb45056 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/StorageChange.java +++ b/sdk/src/main/java/com/hiero/sdk/StorageChange.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; @@ -72,7 +72,7 @@ public class StorageChange { // * @param storageChangeProto the protobuf // * @return the new storage charge object // */ - // static StorageChange fromProtobuf(com.hedera.hashgraph.sdk.proto.StorageChange storageChangeProto) { + // static StorageChange fromProtobuf(com.hiero.sdk.proto.StorageChange storageChangeProto) { // return new StorageChange( // new BigInteger(storageChangeProto.getSlot().toByteArray()), // new BigInteger(storageChangeProto.getValueRead().toByteArray()), @@ -92,7 +92,7 @@ public class StorageChange { // * @throws InvalidProtocolBufferException when there is an issue with the protobuf // */ // public static StorageChange fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - // return fromProtobuf(com.hedera.hashgraph.sdk.proto.StorageChange.parseFrom(bytes)); + // return fromProtobuf(com.hiero.sdk.proto.StorageChange.parseFrom(bytes)); // } // // /** @@ -100,8 +100,8 @@ public class StorageChange { // * // * @return the byte array representation // */ - // com.hedera.hashgraph.sdk.proto.StorageChange toProtobuf() { - // var builder = com.hedera.hashgraph.sdk.proto.StorageChange.newBuilder() + // com.hiero.sdk.proto.StorageChange toProtobuf() { + // var builder = com.hiero.sdk.proto.StorageChange.newBuilder() // .setSlot(ByteString.copyFrom(slot.toByteArray())) // .setValueRead(ByteString.copyFrom(valueRead.toByteArray())); // if (valueWritten != null) { diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/SubscriptionHandle.java b/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/SubscriptionHandle.java rename to sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java index 9abc694ba4..8c8f6832e3 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/SubscriptionHandle.java +++ b/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/SystemDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/SystemDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java index 747c0d627c..8b0730622e 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/SystemDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SystemDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.SystemDeleteTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.util.LinkedHashMap; @@ -65,7 +65,7 @@ public SystemDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - SystemDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + SystemDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -75,7 +75,7 @@ public SystemDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - SystemDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + SystemDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -161,7 +161,7 @@ public SystemDeleteTransaction setExpirationTime(Instant expirationTime) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.SystemDeleteTransactionBody} + * @return {@link com.hiero.sdk.proto.SystemDeleteTransactionBody} */ SystemDeleteTransactionBody.Builder build() { var builder = SystemDeleteTransactionBody.newBuilder(); @@ -215,7 +215,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { if (fileId != null) { return FileServiceGrpc.getSystemDeleteMethod(); } else { diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/SystemUndeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java similarity index 86% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/SystemUndeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java index fb8f4478ec..9bb4c50a2a 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/SystemUndeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SystemUndeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.SystemUndeleteTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -56,7 +56,7 @@ public SystemUndeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - SystemUndeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + SystemUndeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -66,7 +66,7 @@ public SystemUndeleteTransaction() { * * @param txBody protobuf TransactionBody */ - SystemUndeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + SystemUndeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -137,7 +137,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.SystemUndeleteTransactionBody} + * @return {@link com.hiero.sdk.proto.SystemUndeleteTransactionBody} */ SystemUndeleteTransactionBody.Builder build() { var builder = SystemUndeleteTransactionBody.newBuilder(); @@ -173,7 +173,7 @@ CompletableFuture onExecuteAsync(Client client) { @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { if (fileId != null) { return FileServiceGrpc.getSystemUndeleteMethod(); } else { diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/ThreadLocalSecureRandom.java b/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/ThreadLocalSecureRandom.java rename to sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java index 0d272f3e17..ae237dd15d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/ThreadLocalSecureRandom.java +++ b/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.security.SecureRandom; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAirdropTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAirdropTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java index 0fe56f3238..25776331d7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAirdropTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenAirdropTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenAirdropTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -50,7 +50,7 @@ public TokenAirdropTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenAirdropTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenAirdropTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -60,7 +60,7 @@ public TokenAirdropTransaction() { * * @param txBody protobuf TransactionBody */ - TokenAirdropTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenAirdropTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -69,7 +69,7 @@ public TokenAirdropTransaction() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenAirdropTransactionBody} + * com.hiero.sdk.proto.TokenAirdropTransactionBody} */ TokenAirdropTransactionBody.Builder build() { var transfers = sortTransfersAndBuild(); @@ -83,7 +83,7 @@ TokenAirdropTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getAirdropTokensMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAllowance.java b/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAllowance.java rename to sdk/src/main/java/com/hiero/sdk/TokenAllowance.java index 4dd4661ddf..bff655d3f9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAllowance.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.GrantedTokenAllowance; +import com.hiero.sdk.proto.GrantedTokenAllowance; import javax.annotation.Nullable; import java.util.Objects; @@ -78,7 +78,7 @@ public class TokenAllowance { * @param allowanceProto the protobuf * @return the new token allowance */ - static TokenAllowance fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenAllowance allowanceProto) { + static TokenAllowance fromProtobuf(com.hiero.sdk.proto.TokenAllowance allowanceProto) { return new TokenAllowance( allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, @@ -110,7 +110,7 @@ static TokenAllowance fromProtobuf(GrantedTokenAllowance allowanceProto) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenAllowance fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenAllowance.parseFrom(Objects.requireNonNull(bytes))); + return fromProtobuf(com.hiero.sdk.proto.TokenAllowance.parseFrom(Objects.requireNonNull(bytes))); } /** @@ -136,8 +136,8 @@ void validateChecksums(Client client) throws BadEntityIdException { * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.TokenAllowance toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.TokenAllowance.newBuilder() + com.hiero.sdk.proto.TokenAllowance toProtobuf() { + var builder = com.hiero.sdk.proto.TokenAllowance.newBuilder() .setAmount(amount); if (tokenId != null) { builder.setTokenId(tokenId.toProtobuf()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAssociateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java similarity index 86% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAssociateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java index a91b1b5463..3b18c98ffd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAssociateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenAssociateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenAssociateTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -55,7 +55,7 @@ public TokenAssociateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenAssociateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenAssociateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -65,7 +65,7 @@ public TokenAssociateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenAssociateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenAssociateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -118,7 +118,7 @@ public TokenAssociateTransaction setTokenIds(List tokens) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenAssociateTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenAssociateTransactionBody} */ TokenAssociateTransactionBody.Builder build() { var builder = TokenAssociateTransactionBody.newBuilder(); @@ -164,7 +164,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getAssociateTokensMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAssociation.java b/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAssociation.java rename to sdk/src/main/java/com/hiero/sdk/TokenAssociation.java index 0604dc3662..02d06ae259 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenAssociation.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -61,7 +61,7 @@ public class TokenAssociation { * @param tokenAssociation the protobuf * @return the new token association */ - static TokenAssociation fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenAssociation tokenAssociation) { + static TokenAssociation fromProtobuf(com.hiero.sdk.proto.TokenAssociation tokenAssociation) { return new TokenAssociation( tokenAssociation.hasTokenId() ? TokenId.fromProtobuf(tokenAssociation.getTokenId()) : new TokenId(0, 0, 0), tokenAssociation.hasAccountId() ? AccountId.fromProtobuf(tokenAssociation.getAccountId()) : new AccountId(0, 0, 0) @@ -76,7 +76,7 @@ static TokenAssociation fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenAssocia * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenAssociation fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenAssociation.parseFrom(bytes)); + return fromProtobuf(com.hiero.sdk.proto.TokenAssociation.parseFrom(bytes)); } /** @@ -84,8 +84,8 @@ public static TokenAssociation fromBytes(byte[] bytes) throws InvalidProtocolBuf * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.TokenAssociation toProtobuf() { - return com.hedera.hashgraph.sdk.proto.TokenAssociation.newBuilder() + com.hiero.sdk.proto.TokenAssociation toProtobuf() { + return com.hiero.sdk.proto.TokenAssociation.newBuilder() .setTokenId(tokenId.toProtobuf()) .setAccountId(accountId.toProtobuf()) .build(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenBurnTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java similarity index 88% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenBurnTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java index ce2c3c3192..490f4f2c92 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenBurnTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenBurnTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenBurnTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nonnegative; @@ -42,7 +42,7 @@ * * See Hedera Documentation */ -public class TokenBurnTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenBurnTransaction extends com.hiero.sdk.Transaction { /** * The ID of the token to burn supply */ @@ -70,7 +70,7 @@ public TokenBurnTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenBurnTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenBurnTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -80,7 +80,7 @@ public TokenBurnTransaction() { * * @param txBody protobuf TransactionBody */ - TokenBurnTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenBurnTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -174,7 +174,7 @@ public TokenBurnTransaction addSerial(@Nonnegative long serial) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenBurnTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenBurnTransactionBody} */ TokenBurnTransactionBody.Builder build() { var builder = TokenBurnTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java similarity index 79% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java index 9e2e7c9db5..6583cde3f6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenCancelAirdropTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody.Builder; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenCancelAirdropTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody.Builder; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -44,7 +44,7 @@ public TokenCancelAirdropTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenCancelAirdropTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -55,7 +55,7 @@ public TokenCancelAirdropTransaction() { * * @param txBody protobuf TransactionBody */ - TokenCancelAirdropTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenCancelAirdropTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -64,7 +64,7 @@ public TokenCancelAirdropTransaction() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenCancelAirdropTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenCancelAirdropTransactionBody} */ TokenCancelAirdropTransactionBody.Builder build() { var builder = TokenCancelAirdropTransactionBody.newBuilder(); @@ -87,7 +87,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getCancelAirdropMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java similarity index 79% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java index cafcaa7b6c..465df2c1cd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenClaimAirdropTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody.Builder; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenClaimAirdropTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody.Builder; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -44,7 +44,7 @@ public TokenClaimAirdropTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenClaimAirdropTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -55,7 +55,7 @@ public TokenClaimAirdropTransaction() { * * @param txBody protobuf TransactionBody */ - TokenClaimAirdropTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenClaimAirdropTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -63,7 +63,7 @@ public TokenClaimAirdropTransaction() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenClaimAirdropTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenClaimAirdropTransactionBody} */ TokenClaimAirdropTransactionBody.Builder build() { var builder = TokenClaimAirdropTransactionBody.newBuilder(); @@ -86,7 +86,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getClaimAirdropMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java index 79f2f434d5..19477302f1 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenCreateTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -199,7 +199,7 @@ public class TokenCreateTransaction extends Transaction * Constructor. */ public TokenCreateTransaction() { - setAutoRenewPeriod(DEFAULT_AUTO_RENEW_PERIOD); + autoRenewPeriod = DEFAULT_AUTO_RENEW_PERIOD; defaultMaxTransactionFee = new Hbar(40); } @@ -210,7 +210,7 @@ public TokenCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -220,7 +220,7 @@ public TokenCreateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenCreateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -768,7 +768,7 @@ public TokenCreateTransaction freezeWith(@Nullable Client client) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenCreateTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenCreateTransactionBody} */ TokenCreateTransactionBody.Builder build() { var builder = TokenCreateTransactionBody.newBuilder(); @@ -904,7 +904,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getCreateTokenMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java index c909005f9b..496ea3d661 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenDeleteTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -42,7 +42,7 @@ * * See Hedera Documentation */ -public class TokenDeleteTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenDeleteTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @@ -59,7 +59,7 @@ public TokenDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -69,7 +69,7 @@ public TokenDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - TokenDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -111,7 +111,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenDeleteTransactionBody} + * com.hiero.sdk.proto.TokenDeleteTransactionBody} */ TokenDeleteTransactionBody.Builder build() { var builder = TokenDeleteTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenDissociateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java similarity index 85% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenDissociateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java index bc9e66e9f4..a7896e2e19 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenDissociateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenDissociateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenDissociateTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -42,7 +42,7 @@ * * See Hedera Documentation */ -public class TokenDissociateTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenDissociateTransaction extends com.hiero.sdk.Transaction { @Nullable private AccountId accountId = null; private List tokenIds = new ArrayList<>(); @@ -61,7 +61,7 @@ public TokenDissociateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenDissociateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenDissociateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -71,7 +71,7 @@ public TokenDissociateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenDissociateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenDissociateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -138,7 +138,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenDissociateTransactionBody} + * com.hiero.sdk.proto.TokenDissociateTransactionBody} */ TokenDissociateTransactionBody.Builder build() { var builder = TokenDissociateTransactionBody.newBuilder(); @@ -169,7 +169,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getDissociateTokensMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java similarity index 86% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java index 30699d7cc6..60dc1f30fb 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenFeeScheduleUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -61,7 +61,7 @@ public TokenFeeScheduleUpdateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenFeeScheduleUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenFeeScheduleUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -71,7 +71,7 @@ public TokenFeeScheduleUpdateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenFeeScheduleUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenFeeScheduleUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -139,7 +139,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenFeeScheduleUpdateTransactionBody} + * com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody} */ TokenFeeScheduleUpdateTransactionBody.Builder build() { var builder = TokenFeeScheduleUpdateTransactionBody.newBuilder(); @@ -167,7 +167,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUpdateTokenFeeScheduleMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenFreezeTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenFreezeTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java index e3ba72042a..b71876711e 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenFreezeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenFreezeAccountTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenFreezeAccountTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -38,7 +38,7 @@ * * See Hedera Documentation */ -public class TokenFreezeTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenFreezeTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @Nullable @@ -57,7 +57,7 @@ public TokenFreezeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenFreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenFreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -67,7 +67,7 @@ public TokenFreezeTransaction() { * * @param txBody protobuf TransactionBody */ - TokenFreezeTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenFreezeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -136,7 +136,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenFreezeAccountTransactionBody} + * com.hiero.sdk.proto.TokenFreezeAccountTransactionBody} */ TokenFreezeAccountTransactionBody.Builder build() { var builder = TokenFreezeAccountTransactionBody.newBuilder(); @@ -163,7 +163,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenGrantKycTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenGrantKycTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java index 0fc96e5e4b..5717fac489 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenGrantKycTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenGrantKycTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenGrantKycTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -38,7 +38,7 @@ * * See Hedera Documentation */ -public class TokenGrantKycTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenGrantKycTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @Nullable @@ -57,7 +57,7 @@ public TokenGrantKycTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenGrantKycTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenGrantKycTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -67,7 +67,7 @@ public TokenGrantKycTransaction() { * * @param txBody protobuf TransactionBody */ - TokenGrantKycTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenGrantKycTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -136,7 +136,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenGrantKycTransactionBody} + * com.hiero.sdk.proto.TokenGrantKycTransactionBody} */ TokenGrantKycTransactionBody.Builder build() { var builder = TokenGrantKycTransactionBody.newBuilder(); @@ -163,7 +163,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenId.java b/sdk/src/main/java/com/hiero/sdk/TokenId.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenId.java rename to sdk/src/main/java/com/hiero/sdk/TokenId.java index 15da7034f9..e968a7dd0d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenId.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenId.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.TokenID; +import com.hiero.sdk.proto.TokenID; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenInfo.java b/sdk/src/main/java/com/hiero/sdk/TokenInfo.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenInfo.java rename to sdk/src/main/java/com/hiero/sdk/TokenInfo.java index cde44756a9..80fb3bab7c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenInfo.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.TokenFreezeStatus; -import com.hedera.hashgraph.sdk.proto.TokenGetInfoResponse; -import com.hedera.hashgraph.sdk.proto.TokenKycStatus; -import com.hedera.hashgraph.sdk.proto.TokenPauseStatus; +import com.hiero.sdk.proto.TokenFreezeStatus; +import com.hiero.sdk.proto.TokenGetInfoResponse; +import com.hiero.sdk.proto.TokenKycStatus; +import com.hiero.sdk.proto.TokenPauseStatus; import java.time.Duration; import java.time.Instant; @@ -347,7 +347,7 @@ public static TokenInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferExce * @param info the protobuf * @return the list of custom fee's */ - private static List customFeesFromProto(com.hedera.hashgraph.sdk.proto.TokenInfo info) { + private static List customFeesFromProto(com.hiero.sdk.proto.TokenInfo info) { var returnCustomFees = new ArrayList(info.getCustomFeesCount()); for (var feeProto : info.getCustomFeesList()) { returnCustomFees.add(CustomFee.fromProtobuf(feeProto)); @@ -391,7 +391,7 @@ static TokenPauseStatus pauseStatusToProtobuf(@Nullable Boolean pauseStatus) { * @return the protobuf representation */ TokenGetInfoResponse toProtobuf() { - var tokenInfoBuilder = com.hedera.hashgraph.sdk.proto.TokenInfo.newBuilder() + var tokenInfoBuilder = com.hiero.sdk.proto.TokenInfo.newBuilder() .setTokenId(tokenId.toProtobuf()) .setName(name) .setSymbol(symbol) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java similarity index 81% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java index fd0fe60aeb..660f40dcd7 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Query; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.TokenGetInfoQuery; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.Query; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.TokenGetInfoQuery; +import com.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -33,7 +33,7 @@ /** * Initializes the TokenInfoQuery object. */ -public class TokenInfoQuery extends com.hedera.hashgraph.sdk.Query { +public class TokenInfoQuery extends com.hiero.sdk.Query { @Nullable TokenId tokenId = null; @@ -73,7 +73,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TokenGetInfoQuery.newBuilder(); if (tokenId != null) { builder.setToken(tokenId.toProtobuf()); @@ -88,7 +88,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getTokenGetInfo().getHeader(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenKeyValidation.java b/sdk/src/main/java/com/hiero/sdk/TokenKeyValidation.java similarity index 74% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenKeyValidation.java rename to sdk/src/main/java/com/hiero/sdk/TokenKeyValidation.java index b19a61786a..9324438949 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenKeyValidation.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenKeyValidation.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Types of validation strategies for token keys. @@ -27,25 +27,25 @@ public enum TokenKeyValidation { /** * Currently the default behaviour. It will perform all token key validations. */ - FULL_VALIDATION(com.hedera.hashgraph.sdk.proto.TokenKeyValidation.FULL_VALIDATION), + FULL_VALIDATION(com.hiero.sdk.proto.TokenKeyValidation.FULL_VALIDATION), /** * Perform no validations at all for all passed token keys. */ - NO_VALIDATION(com.hedera.hashgraph.sdk.proto.TokenKeyValidation.NO_VALIDATION); + NO_VALIDATION(com.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION); - final com.hedera.hashgraph.sdk.proto.TokenKeyValidation code; + final com.hiero.sdk.proto.TokenKeyValidation code; /** * Constructor. * * @param code the token key validation */ - TokenKeyValidation(com.hedera.hashgraph.sdk.proto.TokenKeyValidation code) { + TokenKeyValidation(com.hiero.sdk.proto.TokenKeyValidation code) { this.code = code; } - static TokenKeyValidation valueOf(com.hedera.hashgraph.sdk.proto.TokenKeyValidation code) { + static TokenKeyValidation valueOf(com.hiero.sdk.proto.TokenKeyValidation code) { return switch (code) { case FULL_VALIDATION -> FULL_VALIDATION; case NO_VALIDATION -> NO_VALIDATION; @@ -61,7 +61,7 @@ public String toString() { }; } - public com.hedera.hashgraph.sdk.proto.TokenKeyValidation toProtobuf() { + public com.hiero.sdk.proto.TokenKeyValidation toProtobuf() { return this.code; } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenMintTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenMintTransaction.java similarity index 88% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenMintTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenMintTransaction.java index 256b7126cf..5c0c7e81d0 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenMintTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenMintTransaction.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenMintTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nonnegative; @@ -44,7 +44,7 @@ * * See Hedera Documentation */ -public class TokenMintTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenMintTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; /** @@ -82,7 +82,7 @@ public TokenMintTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenMintTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenMintTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -92,7 +92,7 @@ public TokenMintTransaction() { * * @param txBody protobuf TransactionBody */ - TokenMintTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenMintTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -193,7 +193,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody} + * com.hiero.sdk.proto.TokenMintTransactionBody} */ TokenMintTransactionBody.Builder build() { var builder = TokenMintTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftAllowance.java b/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftAllowance.java rename to sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java index 4e1760437a..d3efa9b2cc 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftAllowance.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.BoolValue; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.GrantedNftAllowance; -import com.hedera.hashgraph.sdk.proto.NftAllowance; -import com.hedera.hashgraph.sdk.proto.NftRemoveAllowance; +import com.hiero.sdk.proto.GrantedNftAllowance; +import com.hiero.sdk.proto.NftAllowance; +import com.hiero.sdk.proto.NftRemoveAllowance; import javax.annotation.Nullable; import java.util.ArrayList; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftInfo.java b/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftInfo.java rename to sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java index 160890e777..b7da692334 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; @@ -96,7 +96,7 @@ public class TokenNftInfo { * @param info the protobuf * @return the new token nft info */ - static TokenNftInfo fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenNftInfo info) { + static TokenNftInfo fromProtobuf(com.hiero.sdk.proto.TokenNftInfo info) { return new TokenNftInfo( NftId.fromProtobuf(info.getNftID()), AccountId.fromProtobuf(info.getAccountID()), @@ -115,7 +115,7 @@ static TokenNftInfo fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenNftInfo inf * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenNftInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenNftInfo.parseFrom(bytes)); + return fromProtobuf(com.hiero.sdk.proto.TokenNftInfo.parseFrom(bytes)); } /** @@ -123,8 +123,8 @@ public static TokenNftInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferE * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.TokenNftInfo toProtobuf() { - var builder = com.hedera.hashgraph.sdk.proto.TokenNftInfo.newBuilder() + com.hiero.sdk.proto.TokenNftInfo toProtobuf() { + var builder = com.hiero.sdk.proto.TokenNftInfo.newBuilder() .setNftID(nftId.toProtobuf()) .setAccountID(accountId.toProtobuf()) .setCreationTime(InstantConverter.toProtobuf(creationTime)) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java index 2f26ad8f5b..01edb436e4 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.Query; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.TokenGetNftInfoQuery; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; +package com.hiero.sdk; + +import com.hiero.sdk.proto.Query; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.TokenGetNftInfoQuery; +import com.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Collections; import java.util.List; @@ -40,7 +40,7 @@ * * See Hedera Documentation */ -public class TokenNftInfoQuery extends com.hedera.hashgraph.sdk.Query, TokenNftInfoQuery> { +public class TokenNftInfoQuery extends com.hiero.sdk.Query, TokenNftInfoQuery> { /** * The ID of the non-fungible token in x.y.z format. */ @@ -211,7 +211,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TokenGetNftInfoQuery.newBuilder(); if(nftId != null) { builder.setNftID(nftId.toProtobuf()); @@ -225,12 +225,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getTokenGetInfo().getHeader(); } @Override - List mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return Collections.singletonList(TokenNftInfo.fromProtobuf(response.getTokenGetNftInfo().getNft())); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftTransfer.java b/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftTransfer.java rename to sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java index 7852df662d..2c78c9cc22 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenNftTransfer.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.NftTransfer; -import com.hedera.hashgraph.sdk.proto.TokenID; -import com.hedera.hashgraph.sdk.proto.TokenTransferList; +import com.hiero.sdk.proto.NftTransfer; +import com.hiero.sdk.proto.TokenID; +import com.hiero.sdk.proto.TokenTransferList; import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenPauseTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenPauseTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java index c751855e03..2f1a7b6168 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenPauseTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenPauseTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenPauseTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -58,7 +58,7 @@ public TokenPauseTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenPauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenPauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -68,7 +68,7 @@ public TokenPauseTransaction() { * * @param txBody protobuf TransactionBody */ - TokenPauseTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenPauseTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -107,7 +107,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenPauseTransactionBody} + * com.hiero.sdk.proto.TokenPauseTransactionBody} */ TokenPauseTransactionBody.Builder build() { var builder = TokenPauseTransactionBody.newBuilder(); @@ -119,7 +119,7 @@ TokenPauseTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getPauseTokenMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRejectFlow.java b/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRejectFlow.java rename to sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java index 5015aeb2db..dea356237b 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRejectFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import java.time.Duration; import java.util.ArrayList; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRejectTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRejectTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java index 6e45d54f71..c1e9a000e2 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRejectTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenReference; -import com.hedera.hashgraph.sdk.proto.TokenRejectTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenReference; +import com.hiero.sdk.proto.TokenRejectTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -68,7 +68,7 @@ public TokenRejectTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenRejectTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -79,7 +79,7 @@ public TokenRejectTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenRejectTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenRejectTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -170,7 +170,7 @@ public TokenRejectTransaction addNftId(NftId nftId) { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenRejectTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenRejectTransactionBody} */ TokenRejectTransactionBody.Builder build() { var builder = TokenRejectTransactionBody.newBuilder(); @@ -226,7 +226,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getRejectTokenMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRelationship.java b/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRelationship.java rename to sdk/src/main/java/com/hiero/sdk/TokenRelationship.java index 6d7bce9051..28bc2e2568 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRelationship.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.TokenFreezeStatus; -import com.hedera.hashgraph.sdk.proto.TokenKycStatus; +import com.hiero.sdk.proto.TokenFreezeStatus; +import com.hiero.sdk.proto.TokenKycStatus; import javax.annotation.Nullable; @@ -119,7 +119,7 @@ static Boolean kycStatusFromProtobuf(TokenKycStatus kycStatus) { * @param tokenRelationship the protobuf * @return the new token relationship */ - static TokenRelationship fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenRelationship tokenRelationship) { + static TokenRelationship fromProtobuf(com.hiero.sdk.proto.TokenRelationship tokenRelationship) { return new TokenRelationship( TokenId.fromProtobuf(tokenRelationship.getTokenId()), tokenRelationship.getSymbol(), @@ -139,7 +139,7 @@ static TokenRelationship fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenRelati * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenRelationship fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TokenRelationship.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TokenRelationship.parseFrom(bytes).toBuilder().build()); } /** @@ -167,8 +167,8 @@ static TokenKycStatus kycStatusToProtobuf(@Nullable Boolean kycStatus) { * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.TokenRelationship toProtobuf() { - return com.hedera.hashgraph.sdk.proto.TokenRelationship.newBuilder() + com.hiero.sdk.proto.TokenRelationship toProtobuf() { + return com.hiero.sdk.proto.TokenRelationship.newBuilder() .setTokenId(tokenId.toProtobuf()) .setSymbol(symbol) .setBalance(balance) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java similarity index 84% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java index 15f60d6eb1..5693c94e0f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenRevokeKycTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenRevokeKycTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -39,7 +39,7 @@ * * See Hedera Documentation */ -public class TokenRevokeKycTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenRevokeKycTransaction extends com.hiero.sdk.Transaction { /** * The token ID that is associated with the account to remove the KYC flag for */ @@ -64,7 +64,7 @@ public TokenRevokeKycTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenRevokeKycTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenRevokeKycTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -74,7 +74,7 @@ public TokenRevokeKycTransaction() { * * @param txBody protobuf TransactionBody */ - TokenRevokeKycTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenRevokeKycTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -140,7 +140,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenRevokeKycTransactionBody} + * com.hiero.sdk.proto.TokenRevokeKycTransactionBody} */ TokenRevokeKycTransactionBody.Builder build() { var builder = TokenRevokeKycTransactionBody.newBuilder(); @@ -167,7 +167,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenSupplyType.java b/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java similarity index 79% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenSupplyType.java rename to sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java index dc973b2a3b..ee7f0317f1 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenSupplyType.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Possible Token Supply Types (IWA Compatibility). @@ -30,20 +30,20 @@ public enum TokenSupplyType { /** * Indicates that tokens of that type have an upper bound of Long.MAX_VALUE. */ - INFINITE(com.hedera.hashgraph.sdk.proto.TokenSupplyType.INFINITE), + INFINITE(com.hiero.sdk.proto.TokenSupplyType.INFINITE), /** * Indicates that tokens of that type have an upper bound of maxSupply, provided on token creation. */ - FINITE(com.hedera.hashgraph.sdk.proto.TokenSupplyType.FINITE); + FINITE(com.hiero.sdk.proto.TokenSupplyType.FINITE); - final com.hedera.hashgraph.sdk.proto.TokenSupplyType code; + final com.hiero.sdk.proto.TokenSupplyType code; /** * Constructor. * * @param code the token supply type */ - TokenSupplyType(com.hedera.hashgraph.sdk.proto.TokenSupplyType code) { + TokenSupplyType(com.hiero.sdk.proto.TokenSupplyType code) { this.code = code; } @@ -53,7 +53,7 @@ public enum TokenSupplyType { * @param code the token supply type in question * @return the token supply type */ - static TokenSupplyType valueOf(com.hedera.hashgraph.sdk.proto.TokenSupplyType code) { + static TokenSupplyType valueOf(com.hiero.sdk.proto.TokenSupplyType code) { return switch (code) { case INFINITE -> INFINITE; case FINITE -> FINITE; @@ -69,7 +69,7 @@ public String toString() { }; } - public com.hedera.hashgraph.sdk.proto.TokenSupplyType toProtobuf() { + public com.hiero.sdk.proto.TokenSupplyType toProtobuf() { return this.code; } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenTransfer.java b/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenTransfer.java rename to sdk/src/main/java/com/hiero/sdk/TokenTransfer.java index 3261d6f344..c29d82620b 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenTransfer.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hedera.hashgraph.sdk.proto.AccountAmount; +import com.hiero.sdk.proto.AccountAmount; import javax.annotation.Nullable; import java.util.ArrayList; @@ -76,7 +76,7 @@ public class TokenTransfer { * @param tokenTransferLists the protobuf * @return the list of token transfer records */ - static List fromProtobuf(List tokenTransferLists) { + static List fromProtobuf(List tokenTransferLists) { var transfers = new ArrayList(); for (var tokenTransferList : tokenTransferLists) { diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenTransferList.java b/sdk/src/main/java/com/hiero/sdk/TokenTransferList.java similarity index 87% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenTransferList.java rename to sdk/src/main/java/com/hiero/sdk/TokenTransferList.java index 3d45b41acf..3a847484d8 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenTransferList.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenTransferList.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.UInt32Value; -import com.hedera.hashgraph.sdk.proto.AccountAmount; -import com.hedera.hashgraph.sdk.proto.NftTransfer; +import com.hiero.sdk.proto.AccountAmount; +import com.hiero.sdk.proto.NftTransfer; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; @@ -47,7 +47,7 @@ class TokenTransferList { } } - com.hedera.hashgraph.sdk.proto.TokenTransferList toProtobuf() { + com.hiero.sdk.proto.TokenTransferList toProtobuf() { var transfers = new ArrayList(); var nftTransfers = new ArrayList(); @@ -59,7 +59,7 @@ com.hedera.hashgraph.sdk.proto.TokenTransferList toProtobuf() { nftTransfers.add(transfer.toProtobuf()); } - var builder = com.hedera.hashgraph.sdk.proto.TokenTransferList.newBuilder() + var builder = com.hiero.sdk.proto.TokenTransferList.newBuilder() .setToken(tokenId.toProtobuf()) .addAllTransfers(transfers) .addAllNftTransfers(nftTransfers); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenType.java b/sdk/src/main/java/com/hiero/sdk/TokenType.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenType.java rename to sdk/src/main/java/com/hiero/sdk/TokenType.java index 38a9e7511a..853800cd6f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenType.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenType.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; /** * Possible Token Types (IWA Compatibility). @@ -34,21 +34,21 @@ public enum TokenType { * Interchangeable value with one another, where any quantity of them has the same value as another equal quantity if they are in the same class. * Share a single set of properties, not distinct from one another. Simply represented as a balance or quantity to a given Hedera account. */ - FUNGIBLE_COMMON(com.hedera.hashgraph.sdk.proto.TokenType.FUNGIBLE_COMMON), + FUNGIBLE_COMMON(com.hiero.sdk.proto.TokenType.FUNGIBLE_COMMON), /** * Unique, not interchangeable with other tokens of the same type as they typically have different values. * Individually traced and can carry unique properties (e.g. serial number). */ - NON_FUNGIBLE_UNIQUE(com.hedera.hashgraph.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE); + NON_FUNGIBLE_UNIQUE(com.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE); - final com.hedera.hashgraph.sdk.proto.TokenType code; + final com.hiero.sdk.proto.TokenType code; /** * Constructor. * * @param code the token type */ - TokenType(com.hedera.hashgraph.sdk.proto.TokenType code) { + TokenType(com.hiero.sdk.proto.TokenType code) { this.code = code; } @@ -58,7 +58,7 @@ public enum TokenType { * @param code the token type in question * @return the token type */ - static TokenType valueOf(com.hedera.hashgraph.sdk.proto.TokenType code) { + static TokenType valueOf(com.hiero.sdk.proto.TokenType code) { return switch (code) { case FUNGIBLE_COMMON -> FUNGIBLE_COMMON; case NON_FUNGIBLE_UNIQUE -> NON_FUNGIBLE_UNIQUE; @@ -74,7 +74,7 @@ public String toString() { }; } - public com.hedera.hashgraph.sdk.proto.TokenType toProtobuf() { + public com.hiero.sdk.proto.TokenType toProtobuf() { return this.code; } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java index fc7daa2b7c..a5a8e11c52 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TokenUnfreezeAccountTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -38,7 +38,7 @@ * * See Hedera Documentation */ -public class TokenUnfreezeTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenUnfreezeTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @Nullable @@ -57,7 +57,7 @@ public TokenUnfreezeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUnfreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenUnfreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -67,7 +67,7 @@ public TokenUnfreezeTransaction() { * * @param txBody protobuf TransactionBody */ - TokenUnfreezeTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenUnfreezeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -136,7 +136,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@code @link - * com.hedera.hashgraph.sdk.proto.TokenUnfreezeAccountTransactionBody} + * com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody} */ TokenUnfreezeAccountTransactionBody.Builder build() { var builder = TokenUnfreezeAccountTransactionBody.newBuilder(); @@ -163,7 +163,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUnpauseTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java similarity index 83% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUnpauseTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java index e71e980460..9b1fbd7abf 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUnpauseTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TokenUnpauseTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TokenUnpauseTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -56,7 +56,7 @@ public TokenUnpauseTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUnpauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenUnpauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -66,7 +66,7 @@ public TokenUnpauseTransaction() { * * @param txBody protobuf TransactionBody */ - TokenUnpauseTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenUnpauseTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -108,7 +108,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenUnpauseTransactionBody} + * com.hiero.sdk.proto.TokenUnpauseTransactionBody} */ TokenUnpauseTransactionBody.Builder build() { var builder = TokenUnpauseTransactionBody.newBuilder(); @@ -120,7 +120,7 @@ TokenUnpauseTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUnpauseTokenMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java similarity index 88% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java index 523d0365fe..298319ea0c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TokenUpdateNftsTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TokenUpdateNftsTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -66,13 +66,13 @@ public TokenUpdateNftsTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenUpdateNftsTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } - TokenUpdateNftsTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenUpdateNftsTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -173,7 +173,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.TokenUpdateNftsTransactionBody} + * @return {@link com.hiero.sdk.proto.TokenUpdateNftsTransactionBody} */ TokenUpdateNftsTransactionBody.Builder build() { var builder = TokenUpdateNftsTransactionBody.newBuilder(); @@ -201,7 +201,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUpdateNftsMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java index ef130ff018..036e479c98 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TokenUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TokenUpdateTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -180,7 +180,7 @@ public TokenUpdateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -190,7 +190,7 @@ public TokenUpdateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -686,7 +686,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenUpdateTransactionBody} + * com.hiero.sdk.proto.TokenUpdateTransactionBody} */ TokenUpdateTransactionBody.Builder build() { var builder = TokenUpdateTransactionBody.newBuilder(); @@ -762,7 +762,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUpdateTokenMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenWipeTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java similarity index 89% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TokenWipeTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java index 905d784691..750fa5a67a 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenWipeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TokenWipeAccountTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TokenWipeAccountTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nonnegative; @@ -42,7 +42,7 @@ * * See Hedera Documentation */ -public class TokenWipeTransaction extends com.hedera.hashgraph.sdk.Transaction { +public class TokenWipeTransaction extends com.hiero.sdk.Transaction { /** * The ID of the token to wipe from the account */ @@ -80,7 +80,7 @@ public TokenWipeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenWipeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenWipeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -90,7 +90,7 @@ public TokenWipeTransaction() { * * @param txBody protobuf TransactionBody */ - TokenWipeTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TokenWipeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -216,7 +216,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TokenWipeAccountTransactionBody} + * com.hiero.sdk.proto.TokenWipeAccountTransactionBody} */ TokenWipeAccountTransactionBody.Builder build() { var builder = TokenWipeAccountTransactionBody.newBuilder(); @@ -247,7 +247,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getWipeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicCreateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java index 73bf7509d7..04705b62d0 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ConsensusCreateTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; +import com.hiero.sdk.proto.ConsensusServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; @@ -107,7 +107,7 @@ public TopicCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TopicCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -117,7 +117,7 @@ public TopicCreateTransaction() { * * @param txBody protobuf TransactionBody */ - TopicCreateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TopicCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -282,7 +282,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.ConsensusCreateTopicTransactionBody} + * com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody} */ ConsensusCreateTopicTransactionBody.Builder build() { var builder = ConsensusCreateTopicTransactionBody.newBuilder(); @@ -311,7 +311,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getCreateTopicMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java similarity index 82% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicDeleteTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java index 2f5ad1e6c2..94077f8c0f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ConsensusDeleteTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; +import com.hiero.sdk.proto.ConsensusServiceGrpc; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -56,7 +56,7 @@ public TopicDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TopicDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -66,7 +66,7 @@ public TopicDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - TopicDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TopicDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -108,7 +108,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.ConsensusDeleteTopicTransactionBody} + * com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody} */ ConsensusDeleteTopicTransactionBody.Builder build() { var builder = ConsensusDeleteTopicTransactionBody.newBuilder(); @@ -127,7 +127,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getDeleteTopicMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicId.java b/sdk/src/main/java/com/hiero/sdk/TopicId.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicId.java rename to sdk/src/main/java/com/hiero/sdk/TopicId.java index 6961592b48..3dc5a91573 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicId.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicId.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.TopicID; +import com.hiero.sdk.proto.TopicID; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicInfo.java b/sdk/src/main/java/com/hiero/sdk/TopicInfo.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicInfo.java rename to sdk/src/main/java/com/hiero/sdk/TopicInfo.java index 70cdbd5943..2fb6165e5d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicInfo.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ConsensusGetTopicInfoResponse; -import com.hedera.hashgraph.sdk.proto.ConsensusTopicInfo; +import com.hiero.sdk.proto.ConsensusGetTopicInfoResponse; +import com.hiero.sdk.proto.ConsensusTopicInfo; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java similarity index 79% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicInfoQuery.java rename to sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java index 65136b8fff..6407ea4e42 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ConsensusGetTopicInfoQuery; -import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.ConsensusGetTopicInfoQuery; +import com.hiero.sdk.proto.ConsensusServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -74,7 +74,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ConsensusGetTopicInfoQuery.newBuilder(); if (topicId != null) { builder.setTopicID(topicId.toProtobuf()); @@ -89,17 +89,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getConsensusGetTopicInfo().getHeader(); } @Override - TopicInfo mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + TopicInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return TopicInfo.fromProtobuf(response.getConsensusGetTopicInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getGetTopicInfoMethod(); } } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessage.java b/sdk/src/main/java/com/hiero/sdk/TopicMessage.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessage.java rename to sdk/src/main/java/com/hiero/sdk/TopicMessage.java index 69bb8f2efa..cf90fd046a 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessage.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessage.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageChunk.java b/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java similarity index 92% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageChunk.java rename to sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java index 3c1dd4302b..299d3f78ac 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageChunk.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; /** diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageQuery.java b/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageQuery.java rename to sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java index 6a9b151077..178096cf89 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TransactionID; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicQuery; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TransactionID; +import com.hiero.sdk.proto.mirror.ConsensusServiceGrpc; +import com.hiero.sdk.proto.mirror.ConsensusTopicQuery; +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Status; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java similarity index 87% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java index 01df81950c..618c569ced 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ConsensusMessageChunkInfo; -import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.ConsensusSubmitMessageTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionID; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ConsensusMessageChunkInfo; +import com.hiero.sdk.proto.ConsensusServiceGrpc; +import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionID; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -62,7 +62,7 @@ public TopicMessageSubmitTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicMessageSubmitTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TopicMessageSubmitTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -72,7 +72,7 @@ public TopicMessageSubmitTransaction() { * * @param txBody protobuf TransactionBody */ - TopicMessageSubmitTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TopicMessageSubmitTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -169,7 +169,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.ConsensusSubmitMessageTransactionBody} + * com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody} */ ConsensusSubmitMessageTransactionBody.Builder build() { var builder = ConsensusSubmitMessageTransactionBody.newBuilder(); @@ -189,7 +189,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getSubmitMessageMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java similarity index 93% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TopicUpdateTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java index e8743dc533..2c9737ebca 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TopicUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.ConsensusUpdateTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.ConsensusServiceGrpc; +import com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -97,7 +97,7 @@ public TopicUpdateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TopicUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -107,7 +107,7 @@ public TopicUpdateTransaction() { * * @param txBody protobuf TransactionBody */ - TopicUpdateTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TopicUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -361,7 +361,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.ConsensusUpdateTopicTransactionBody} + * com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody} */ ConsensusUpdateTopicTransactionBody.Builder build() { var builder = ConsensusUpdateTopicTransactionBody.newBuilder(); @@ -403,7 +403,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getUpdateTopicMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Transaction.java b/sdk/src/main/java/com/hiero/sdk/Transaction.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Transaction.java rename to sdk/src/main/java/com/hiero/sdk/Transaction.java index 488ba06f4c..3544724704 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Transaction.java +++ b/sdk/src/main/java/com/hiero/sdk/Transaction.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SignatureMap; -import com.hedera.hashgraph.sdk.proto.SignaturePair; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionList; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SignatureMap; +import com.hiero.sdk.proto.SignaturePair; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionList; import java.lang.reflect.Modifier; import java.time.Duration; import java.time.Instant; @@ -52,7 +52,7 @@ */ public abstract class Transaction> extends - Executable { + Executable { /** * Default auto renew duration for accounts, contracts, topics, and files (entities) @@ -92,14 +92,14 @@ public abstract class Transaction> * except pointing to different nodes. When retrying a transaction after a network error or retry-able status * response, we try a different transaction and thus a different node. */ - protected List outerTransactions = Collections.emptyList(); + protected List outerTransactions = Collections.emptyList(); /** * An SDK [Transaction] is composed of multiple, raw protobuf transactions. These should be functionally identical, * except pointing to different nodes. When retrying a transaction after a network error or retry-able status * response, we try a different transaction and thus a different node. */ - protected List innerSignedTransactions = Collections.emptyList(); + protected List innerSignedTransactions = Collections.emptyList(); /** * A set of signatures corresponding to every unique public key used to sign the transaction. @@ -154,7 +154,7 @@ public abstract class Transaction> * * @param txBody protobuf TransactionBody */ - Transaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + Transaction(com.hiero.sdk.proto.TransactionBody txBody) { setTransactionValidDuration(DEFAULT_TRANSACTION_VALID_DURATION); setMaxTransactionFee(Hbar.fromTinybars(txBody.getTransactionFee())); setTransactionMemo(txBody.getMemo()); @@ -170,9 +170,9 @@ public abstract class Transaction> * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - Transaction(LinkedHashMap> txs) + Transaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { - LinkedHashMap transactionMap = txs.values().iterator().next(); + LinkedHashMap transactionMap = txs.values().iterator().next(); if (!transactionMap.isEmpty() && transactionMap.keySet().iterator().next().equals(DUMMY_ACCOUNT_ID)) { // If the first account ID is a dummy account ID, then only the source TransactionBody needs to be copied. var signedTransaction = SignedTransaction.parseFrom(transactionMap.values().iterator().next().getSignedTransactionBytes()); @@ -252,13 +252,13 @@ public abstract class Transaction> * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - var txs = new LinkedHashMap>(); + var txs = new LinkedHashMap>(); TransactionBody.DataCase dataCase = TransactionBody.DataCase.DATA_NOT_SET; var list = TransactionList.parseFrom(bytes); if (list.getTransactionListList().isEmpty()) { - var transaction = com.hedera.hashgraph.sdk.proto.Transaction.parseFrom(bytes).toBuilder(); + var transaction = com.hiero.sdk.proto.Transaction.parseFrom(bytes).toBuilder(); TransactionBody txBody; if (transaction.getSignedTransactionBytes().isEmpty()) { @@ -283,7 +283,7 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe var transactionId = txBody.hasTransactionID() ? TransactionId.fromProtobuf(txBody.getTransactionID()) : DUMMY_TRANSACTION_ID; - var linked = new LinkedHashMap(); + var linked = new LinkedHashMap(); linked.put(account, transaction.build()); txs.put(transactionId, linked); } else { @@ -302,7 +302,7 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe var linked = txs.containsKey(transactionId) ? Objects.requireNonNull(txs.get(transactionId)) : - new LinkedHashMap(); + new LinkedHashMap(); linked.put(account, transaction); @@ -372,7 +372,7 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe * @return the new transaction */ public static Transaction fromScheduledTransaction( - com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody scheduled) { + com.hiero.sdk.proto.SchedulableTransactionBody scheduled) { var body = TransactionBody.newBuilder() .setMemo(scheduled.getMemo()) .setTransactionFee(scheduled.getTransactionFee()); @@ -738,7 +738,7 @@ public byte[] toBytes() { .setBodyBytes(bodyBuilder.build().toByteString()) .build(); - var transaction = com.hedera.hashgraph.sdk.proto.Transaction.newBuilder() + var transaction = com.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(signedTransaction.toByteString()) .build(); @@ -1225,7 +1225,7 @@ void buildTransaction(int index) { signTransaction(index); - outerTransactions.set(index, com.hedera.hashgraph.sdk.proto.Transaction.newBuilder() + outerTransactions.set(index, com.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes( innerSignedTransactions.get(index) .setSigMap(sigPairLists.get(index)) @@ -1272,7 +1272,7 @@ void signTransaction(int index) { abstract void onScheduled(SchedulableTransactionBody.Builder scheduled); @Override - final com.hedera.hashgraph.sdk.proto.Transaction makeRequest() { + final com.hiero.sdk.proto.Transaction makeRequest() { var index = nodeAccountIds.getIndex() + (transactionIds.getIndex() * nodeAccountIds.size()); buildTransaction(index); @@ -1282,9 +1282,9 @@ final com.hedera.hashgraph.sdk.proto.Transaction makeRequest() { @Override TransactionResponse mapResponse( - com.hedera.hashgraph.sdk.proto.TransactionResponse transactionResponse, + com.hiero.sdk.proto.TransactionResponse transactionResponse, AccountId nodeId, - com.hedera.hashgraph.sdk.proto.Transaction request + com.hiero.sdk.proto.Transaction request ) { var transactionId = Objects.requireNonNull(getTransactionIdInternal()); var hash = hash(request.getSignedTransactionBytes().toByteArray()); @@ -1293,7 +1293,7 @@ TransactionResponse mapResponse( } @Override - final Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.TransactionResponse transactionResponse) { + final Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse transactionResponse) { return Status.valueOf(transactionResponse.getNodeTransactionPrecheckCode()); } @@ -1335,7 +1335,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - ExecutionState getExecutionState(Status status, com.hedera.hashgraph.sdk.proto.TransactionResponse response) { + ExecutionState getExecutionState(Status status, com.hiero.sdk.proto.TransactionResponse response) { if (status == Status.TRANSACTION_EXPIRED) { if ((regenerateTransactionId != null && !regenerateTransactionId) || transactionIds.isLocked()) { return ExecutionState.REQUEST_ERROR; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionFeeSchedule.java b/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionFeeSchedule.java rename to sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java index a5b893ee8d..1f579b4bcb 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionFeeSchedule.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -54,7 +54,7 @@ public TransactionFeeSchedule() { * @param transactionFeeSchedule the protobuf * @return the new transaction fee schedule */ - static TransactionFeeSchedule fromProtobuf(com.hedera.hashgraph.sdk.proto.TransactionFeeSchedule transactionFeeSchedule) { + static TransactionFeeSchedule fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule transactionFeeSchedule) { var returnFeeSchedule = new TransactionFeeSchedule() .setRequestType(RequestType.valueOf(transactionFeeSchedule.getHederaFunctionality())) .setFeeData(transactionFeeSchedule.hasFeeData() ? FeeData.fromProtobuf(transactionFeeSchedule.getFeeData()) : null); @@ -72,7 +72,7 @@ static TransactionFeeSchedule fromProtobuf(com.hedera.hashgraph.sdk.proto.Transa * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionFeeSchedule fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TransactionFeeSchedule.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule.parseFrom(bytes).toBuilder().build()); } /** @@ -142,10 +142,10 @@ public TransactionFeeSchedule addFee(FeeData fee) { * Build the transaction body. * * @return {@link - * com.hedera.hashgraph.sdk.proto.TransactionFeeSchedule} + * com.hiero.sdk.proto.TransactionFeeSchedule} */ - com.hedera.hashgraph.sdk.proto.TransactionFeeSchedule toProtobuf() { - var returnBuilder = com.hedera.hashgraph.sdk.proto.TransactionFeeSchedule.newBuilder() + com.hiero.sdk.proto.TransactionFeeSchedule toProtobuf() { + var returnBuilder = com.hiero.sdk.proto.TransactionFeeSchedule.newBuilder() .setHederaFunctionality(getRequestType().code); if (feeData != null) { returnBuilder.setFeeData(feeData.toProtobuf()); diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionId.java b/sdk/src/main/java/com/hiero/sdk/TransactionId.java similarity index 99% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionId.java rename to sdk/src/main/java/com/hiero/sdk/TransactionId.java index c4a7442ad2..11ceb6712c 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionId.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionId.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static java.util.concurrent.CompletableFuture.completedFuture; import static java.util.concurrent.CompletableFuture.failedFuture; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.TransactionID; +import com.hiero.sdk.proto.TransactionID; import java.time.Duration; import java.time.Instant; import java.util.Objects; @@ -103,7 +103,7 @@ public static TransactionId withValidStart(AccountId accountId, Instant validSta * that will be charged the transaction fees for the transaction. * * @param accountId the ID of the Hedera account that will be charge the transaction fees. - * @return {@link com.hedera.hashgraph.sdk.TransactionId} + * @return {@link com.hiero.sdk.TransactionId} */ public static TransactionId generate(AccountId accountId) { long currentTime; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionReceipt.java b/sdk/src/main/java/com/hiero/sdk/TransactionReceipt.java similarity index 94% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionReceipt.java rename to sdk/src/main/java/com/hiero/sdk/TransactionReceipt.java index 3410ad2e26..7c2c95a45e 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionReceipt.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionReceipt.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ExchangeRateSet; -import com.hedera.hashgraph.sdk.proto.TimestampSeconds; +import com.hiero.sdk.proto.ExchangeRateSet; +import com.hiero.sdk.proto.TimestampSeconds; import org.bouncycastle.util.encoders.Hex; import javax.annotation.Nullable; @@ -190,7 +190,7 @@ public final class TransactionReceipt { * @return the new transaction receipt */ static TransactionReceipt fromProtobuf( - com.hedera.hashgraph.sdk.proto.TransactionReceipt transactionReceipt, + com.hiero.sdk.proto.TransactionReceipt transactionReceipt, List duplicates, List children, @Nullable TransactionId transactionId @@ -278,12 +278,12 @@ static TransactionReceipt fromProtobuf( * @param transactionReceipt the protobuf * @return the new transaction receipt */ - public static TransactionReceipt fromProtobuf(com.hedera.hashgraph.sdk.proto.TransactionReceipt transactionReceipt) { + public static TransactionReceipt fromProtobuf(com.hiero.sdk.proto.TransactionReceipt transactionReceipt) { return fromProtobuf(transactionReceipt, new ArrayList<>(), new ArrayList<>(), null); } static TransactionReceipt fromProtobuf( - com.hedera.hashgraph.sdk.proto.TransactionReceipt transactionReceipt, + com.hiero.sdk.proto.TransactionReceipt transactionReceipt, @Nullable TransactionId transactionId ) { return fromProtobuf(transactionReceipt, new ArrayList<>(), new ArrayList<>(), transactionId); @@ -297,7 +297,7 @@ static TransactionReceipt fromProtobuf( * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionReceipt fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TransactionReceipt.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TransactionReceipt.parseFrom(bytes).toBuilder().build()); } /** @@ -319,11 +319,11 @@ public TransactionReceipt validateStatus(boolean shouldValidate) throws ReceiptS * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.TransactionReceipt toProtobuf() { - var transactionReceiptBuilder = com.hedera.hashgraph.sdk.proto.TransactionReceipt.newBuilder() + com.hiero.sdk.proto.TransactionReceipt toProtobuf() { + var transactionReceiptBuilder = com.hiero.sdk.proto.TransactionReceipt.newBuilder() .setStatus(status.code) .setExchangeRate(ExchangeRateSet.newBuilder() - .setCurrentRate(com.hedera.hashgraph.sdk.proto.ExchangeRate.newBuilder() + .setCurrentRate(com.hiero.sdk.proto.ExchangeRate.newBuilder() .setHbarEquiv(exchangeRate.hbars) .setCentEquiv(exchangeRate.cents) .setExpirationTime(TimestampSeconds.newBuilder() diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionReceiptQuery.java b/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionReceiptQuery.java rename to sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java index 903ca74ae5..5ac61055cd 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionReceiptQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.TransactionGetReceiptQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.TransactionGetReceiptQuery; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -134,7 +134,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TransactionGetReceiptQuery.newBuilder() .setIncludeChildReceipts(includeChildren) .setIncludeDuplicates(includeDuplicates); @@ -153,7 +153,7 @@ Status mapResponseStatus(Response response) { } @Override - TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { var receiptResponse = response.getTransactionGetReceipt(); var duplicates = mapReceiptList(receiptResponse.getDuplicateTransactionReceiptsList()); var children = mapReceiptList(receiptResponse.getChildTransactionReceiptsList()); @@ -167,7 +167,7 @@ TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hedera.h * @return the list of transaction receipts */ private static List mapReceiptList( - List protoReceiptList + List protoReceiptList ) { List outList = new ArrayList<>(protoReceiptList.size()); for (var protoReceipt : protoReceiptList) { @@ -177,7 +177,7 @@ private static List mapReceiptList( } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getTransactionGetReceipt().getHeader(); } @@ -187,7 +187,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetTransactionReceiptsMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionRecord.java b/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionRecord.java rename to sdk/src/main/java/com/hiero/sdk/TransactionRecord.java index 5b6559d477..f632a9833d 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionRecord.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AccountAmount; -import com.hedera.hashgraph.sdk.proto.NftTransfer; -import com.hedera.hashgraph.sdk.proto.TokenTransferList; -import com.hedera.hashgraph.sdk.proto.TransferList; +import com.hiero.sdk.proto.AccountAmount; +import com.hiero.sdk.proto.NftTransfer; +import com.hiero.sdk.proto.TokenTransferList; +import com.hiero.sdk.proto.TransferList; import org.bouncycastle.util.encoders.Hex; import java.time.Instant; @@ -275,7 +275,7 @@ public final class TransactionRecord { * @return the new transaction record */ static TransactionRecord fromProtobuf( - com.hedera.hashgraph.sdk.proto.TransactionRecord transactionRecord, + com.hiero.sdk.proto.TransactionRecord transactionRecord, List children, List duplicates, @Nullable TransactionId transactionId @@ -366,7 +366,7 @@ static TransactionRecord fromProtobuf( * @param transactionRecord the protobuf * @return the new transaction record */ - static TransactionRecord fromProtobuf(com.hedera.hashgraph.sdk.proto.TransactionRecord transactionRecord) { + static TransactionRecord fromProtobuf(com.hiero.sdk.proto.TransactionRecord transactionRecord) { return fromProtobuf(transactionRecord, new ArrayList<>(), new ArrayList<>(), null); } @@ -378,7 +378,7 @@ static TransactionRecord fromProtobuf(com.hedera.hashgraph.sdk.proto.Transaction * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionRecord fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hedera.hashgraph.sdk.proto.TransactionRecord.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TransactionRecord.parseFrom(bytes).toBuilder().build()); } /** @@ -398,13 +398,13 @@ public TransactionRecord validateReceiptStatus(boolean shouldValidate) throws Re * * @return the protobuf representation */ - com.hedera.hashgraph.sdk.proto.TransactionRecord toProtobuf() { + com.hiero.sdk.proto.TransactionRecord toProtobuf() { var transferList = TransferList.newBuilder(); for (Transfer transfer : transfers) { transferList.addAccountAmounts(transfer.toProtobuf()); } - var transactionRecord = com.hedera.hashgraph.sdk.proto.TransactionRecord.newBuilder() + var transactionRecord = com.hiero.sdk.proto.TransactionRecord.newBuilder() .setReceipt(receipt.toProtobuf()) .setTransactionHash(transactionHash) .setConsensusTimestamp(InstantConverter.toProtobuf(consensusTimestamp)) diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionRecordQuery.java b/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java similarity index 90% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionRecordQuery.java rename to sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java index 2ee0055881..7264a90ec6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionRecordQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.TransactionGetRecordQuery; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.TransactionGetRecordQuery; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -129,7 +129,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TransactionGetRecordQuery.newBuilder() .setIncludeChildRecords(includeChildren) .setIncludeDuplicates(includeDuplicates); @@ -146,12 +146,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return request.getTransactionGetRecord().getHeader(); } @Override - TransactionRecord mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) { + TransactionRecord mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { var recordResponse = response.getTransactionGetRecord(); List children = mapRecordList(recordResponse.getChildTransactionRecordsList()); List duplicates = mapRecordList(recordResponse.getDuplicateTransactionRecordsList()); @@ -159,7 +159,7 @@ TransactionRecord mapResponse(Response response, AccountId nodeId, com.hedera.ha } private List mapRecordList( - List protoRecordList + List protoRecordList ) { List outList = new ArrayList<>(protoRecordList.size()); for (var protoRecord : protoRecordList) { @@ -169,7 +169,7 @@ private List mapRecordList( } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetTxRecordByTxIDMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionResponse.java b/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionResponse.java rename to sdk/src/main/java/com/hiero/sdk/TransactionResponse.java index 3b0bb1c815..8c56c0a9b9 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransactionResponse.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import java.time.Duration; @@ -136,7 +136,7 @@ public TransactionReceipt getReceipt(Client client, Duration timeout) throws Tim /** * Create receipt query from the {@link #transactionId} and {@link #transactionHash} * - * @return {@link com.hedera.hashgraph.sdk.TransactionReceiptQuery} + * @return {@link com.hiero.sdk.TransactionReceiptQuery} */ public TransactionReceiptQuery getReceiptQuery() { return new TransactionReceiptQuery() @@ -248,7 +248,7 @@ public TransactionRecord getRecord(Client client, Duration timeout) throws Timeo /** * Create record query from the {@link #transactionId} and {@link #transactionHash} * - * @return {@link com.hedera.hashgraph.sdk.TransactionRecordQuery} + * @return {@link com.hiero.sdk.TransactionRecordQuery} */ public TransactionRecordQuery getRecordQuery() { return new TransactionRecordQuery() diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Transfer.java b/sdk/src/main/java/com/hiero/sdk/Transfer.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/Transfer.java rename to sdk/src/main/java/com/hiero/sdk/Transfer.java index c76d32f8ff..7390afd765 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Transfer.java +++ b/sdk/src/main/java/com/hiero/sdk/Transfer.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hedera.hashgraph.sdk.proto.AccountAmount; +import com.hiero.sdk.proto.AccountAmount; /** * A transfer of Hbar that occurred within a transaction. diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransferTransaction.java b/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java similarity index 91% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/TransferTransaction.java rename to sdk/src/main/java/com/hiero/sdk/TransferTransaction.java index 25bac22f29..5fd170be7f 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TransferTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AccountAmount; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; -import com.hedera.hashgraph.sdk.proto.TransferList; +import com.hiero.sdk.proto.AccountAmount; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.CryptoTransferTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.TransferList; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.Comparator; @@ -88,7 +88,7 @@ public TransferTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TransferTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -99,7 +99,7 @@ public TransferTransaction() { * * @param txBody protobuf TransactionBody */ - TransferTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) { + TransferTransaction(com.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -190,7 +190,7 @@ public TransferTransaction setHbarTransferApproval(AccountId accountId, boolean /** * Build the transaction body. * - * @return {@link com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody} + * @return {@link com.hiero.sdk.proto.CryptoTransferTransactionBody} */ CryptoTransferTransactionBody.Builder build() { var transfers = sortTransfersAndBuild(); @@ -220,7 +220,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoTransferMethod(); } diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/logger/LogLevel.java b/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java similarity index 95% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/logger/LogLevel.java rename to sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java index da4ef430d7..5e70a29dba 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/logger/LogLevel.java +++ b/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.logger; +package com.hiero.sdk.logger; public enum LogLevel { TRACE(0), diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/logger/Logger.java b/sdk/src/main/java/com/hiero/sdk/logger/Logger.java similarity index 98% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/logger/Logger.java rename to sdk/src/main/java/com/hiero/sdk/logger/Logger.java index e3a43a2f05..6efc18ca11 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/logger/Logger.java +++ b/sdk/src/main/java/com/hiero/sdk/logger/Logger.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.logger; +package com.hiero.sdk.logger; import org.slf4j.LoggerFactory; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/package-info.java b/sdk/src/main/java/com/hiero/sdk/package-info.java similarity index 96% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/package-info.java rename to sdk/src/main/java/com/hiero/sdk/package-info.java index b5c2338bd0..867a4c50eb 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/package-info.java +++ b/sdk/src/main/java/com/hiero/sdk/package-info.java @@ -19,6 +19,6 @@ * See Hedera Documentation */ @ParametersAreNonnullByDefault -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/utils/Bip32Utils.java b/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java similarity index 97% rename from sdk/src/main/java/com/hedera/hashgraph/sdk/utils/Bip32Utils.java rename to sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java index 7c24adba55..43aefee0e6 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/utils/Bip32Utils.java +++ b/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.utils; +package com.hiero.sdk.utils; /** * Utility class for BIP32 functionalities diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java index 36ca7aaf7a..28fc448daa 100644 --- a/sdk/src/main/java/module-info.java +++ b/sdk/src/main/java/module-info.java @@ -33,9 +33,9 @@ requires org.slf4j; requires static transitive java.annotation; - exports com.hedera.hashgraph.sdk; - exports com.hedera.hashgraph.sdk.logger; - exports com.hedera.hashgraph.sdk.proto; + exports com.hiero.sdk; + exports com.hiero.sdk.logger; + exports com.hiero.sdk.proto; - opens com.hedera.hashgraph.sdk; + opens com.hiero.sdk; } diff --git a/sdk/src/main/proto/account.proto b/sdk/src/main/proto/account.proto index 3c7cfce552..84d180ac96 100644 --- a/sdk/src/main/proto/account.proto +++ b/sdk/src/main/proto/account.proto @@ -25,7 +25,7 @@ package proto; import "common.proto"; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/account_pending_airdrop.proto b/sdk/src/main/proto/account_pending_airdrop.proto index 6b2c7b47b9..1dc83b0a50 100644 --- a/sdk/src/main/proto/account_pending_airdrop.proto +++ b/sdk/src/main/proto/account_pending_airdrop.proto @@ -20,7 +20,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/address_book_service.proto b/sdk/src/main/proto/address_book_service.proto index d3cde5733e..9833b7a4da 100644 --- a/sdk/src/main/proto/address_book_service.proto +++ b/sdk/src/main/proto/address_book_service.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/basic_types.proto b/sdk/src/main/proto/basic_types.proto index 282890f95c..4f367da90c 100644 --- a/sdk/src/main/proto/basic_types.proto +++ b/sdk/src/main/proto/basic_types.proto @@ -25,7 +25,7 @@ package proto; import "timestamp.proto"; import "google/protobuf/wrappers.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/block_info.proto b/sdk/src/main/proto/block_info.proto index cdd0508d67..5276f0fd31 100644 --- a/sdk/src/main/proto/block_info.proto +++ b/sdk/src/main/proto/block_info.proto @@ -24,7 +24,7 @@ package proto; import "timestamp.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/block_stream_info.proto b/sdk/src/main/proto/block_stream_info.proto index cf3f36809b..8d9a8c4bbf 100644 --- a/sdk/src/main/proto/block_stream_info.proto +++ b/sdk/src/main/proto/block_stream_info.proto @@ -33,7 +33,7 @@ package com.hedera.hapi.node.state.blockstream; import "timestamp.proto"; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/bytecode.proto b/sdk/src/main/proto/bytecode.proto index 8652fce947..4b44868b5c 100644 --- a/sdk/src/main/proto/bytecode.proto +++ b/sdk/src/main/proto/bytecode.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/common.proto b/sdk/src/main/proto/common.proto index 5eb76044a3..32a61e8f42 100644 --- a/sdk/src/main/proto/common.proto +++ b/sdk/src/main/proto/common.proto @@ -23,7 +23,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/congestion_level_starts.proto b/sdk/src/main/proto/congestion_level_starts.proto index d9a3ac25a6..3ec209a896 100644 --- a/sdk/src/main/proto/congestion_level_starts.proto +++ b/sdk/src/main/proto/congestion_level_starts.proto @@ -24,7 +24,7 @@ package proto; import "timestamp.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_create_topic.proto b/sdk/src/main/proto/consensus_create_topic.proto index cd2e468777..dc6b8b7ed6 100644 --- a/sdk/src/main/proto/consensus_create_topic.proto +++ b/sdk/src/main/proto/consensus_create_topic.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_delete_topic.proto b/sdk/src/main/proto/consensus_delete_topic.proto index 6b68113fd5..0d866c602c 100644 --- a/sdk/src/main/proto/consensus_delete_topic.proto +++ b/sdk/src/main/proto/consensus_delete_topic.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_get_topic_info.proto b/sdk/src/main/proto/consensus_get_topic_info.proto index 408641f197..4a122e2ae5 100644 --- a/sdk/src/main/proto/consensus_get_topic_info.proto +++ b/sdk/src/main/proto/consensus_get_topic_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_service.proto b/sdk/src/main/proto/consensus_service.proto index da1bfbf9c9..066aca7fbc 100644 --- a/sdk/src/main/proto/consensus_service.proto +++ b/sdk/src/main/proto/consensus_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/consensus_submit_message.proto b/sdk/src/main/proto/consensus_submit_message.proto index ece3155e98..cc90426713 100644 --- a/sdk/src/main/proto/consensus_submit_message.proto +++ b/sdk/src/main/proto/consensus_submit_message.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_topic_info.proto b/sdk/src/main/proto/consensus_topic_info.proto index c31b2d6255..57210194cd 100644 --- a/sdk/src/main/proto/consensus_topic_info.proto +++ b/sdk/src/main/proto/consensus_topic_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -44,7 +44,7 @@ message ConsensusTopicInfo { * When a topic is created, its running hash is initialized to 48 bytes of binary zeros. * For each submitted message, the topic's running hash is then updated to the output * of a particular SHA-384 digest whose input data include the previous running hash. - * + * * See the TransactionReceipt.proto documentation for an exact description of the * data included in the SHA-384 digest used for the update. */ @@ -84,7 +84,7 @@ message ConsensusTopicInfo { AccountID autoRenewAccount = 8; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 9; } diff --git a/sdk/src/main/proto/consensus_update_topic.proto b/sdk/src/main/proto/consensus_update_topic.proto index 7a1acf9c46..e2863a1ca4 100644 --- a/sdk/src/main/proto/consensus_update_topic.proto +++ b/sdk/src/main/proto/consensus_update_topic.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_call.proto b/sdk/src/main/proto/contract_call.proto index 9000e339ca..5295fae1e5 100644 --- a/sdk/src/main/proto/contract_call.proto +++ b/sdk/src/main/proto/contract_call.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_call_local.proto b/sdk/src/main/proto/contract_call_local.proto index 2fd51a5b35..0c08c4b394 100644 --- a/sdk/src/main/proto/contract_call_local.proto +++ b/sdk/src/main/proto/contract_call_local.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -98,11 +98,11 @@ message ContractFunctionResult { /** * [DEPRECATED] the list of smart contracts that were created by the function call. - * - * The created ids will now _also_ be externalized through internal transaction - * records, where each record has its alias field populated with the new contract's - * EVM address. (This is needed for contracts created with CREATE2, since - * there is no longer a simple relationship between the new contract's 0.0.X id + * + * The created ids will now _also_ be externalized through internal transaction + * records, where each record has its alias field populated with the new contract's + * EVM address. (This is needed for contracts created with CREATE2, since + * there is no longer a simple relationship between the new contract's 0.0.X id * and its Solidity address.) */ repeated ContractID createdContractIDs = 7 [deprecated=true]; @@ -110,33 +110,33 @@ message ContractFunctionResult { reserved 8; /** - * The new contract's 20-byte EVM address. Only populated after release 0.23, - * where each created contract will have its own record. (This is an important - * point--the field is not repeated because there will be a separate + * The new contract's 20-byte EVM address. Only populated after release 0.23, + * where each created contract will have its own record. (This is an important + * point--the field is not repeated because there will be a separate * child record for each created contract.) - * + * * Every contract has an EVM address determined by its shard.realm.num id. * This address is as follows: *

    *
  1. The first 4 bytes are the big-endian representation of the shard.
  2. *
  3. The next 8 bytes are the big-endian representation of the realm.
  4. *
  5. The final 8 bytes are the big-endian representation of the number.
  6. - *
- * - * Contracts created via CREATE2 have an additional, primary address that is - * derived from the EIP-1014 - * specification, and does not have a simple relation to a shard.realm.num id. - * - * (Please do note that CREATE2 contracts can also be referenced by the three-part + * + * + * Contracts created via CREATE2 have an additional, primary address that is + * derived from the EIP-1014 + * specification, and does not have a simple relation to a shard.realm.num id. + * + * (Please do note that CREATE2 contracts can also be referenced by the three-part * EVM address described above.) */ google.protobuf.BytesValue evm_address = 9; /** - * The amount of gas available for the call, aka the gasLimit. + * The amount of gas available for the call, aka the gasLimit. * * This field should only be populated when the paired TransactionBody in the record stream is not a - * ContractCreateTransactionBody or a ContractCallTransactionBody. + * ContractCreateTransactionBody or a ContractCallTransactionBody. */ int64 gas = 10; @@ -144,7 +144,7 @@ message ContractFunctionResult { * Number of tinybars sent (the function must be payable if this is nonzero). * * This field should only be populated when the paired TransactionBody in the record stream is not a - * ContractCreateTransactionBody or a ContractCallTransactionBody. + * ContractCreateTransactionBody or a ContractCallTransactionBody. */ int64 amount = 11; @@ -152,7 +152,7 @@ message ContractFunctionResult { * The parameters passed into the contract call. * * This field should only be populated when the paired TransactionBody in the record stream is not a - * ContractCreateTransactionBody or a ContractCallTransactionBody. + * ContractCreateTransactionBody or a ContractCallTransactionBody. */ bytes functionParameters = 12; @@ -160,7 +160,7 @@ message ContractFunctionResult { * The account that is the "sender." If not present it is the accountId from the transactionId. * * This field should only be populated when the paired TransactionBody in the record stream is not a - * ContractCreateTransactionBody or a ContractCallTransactionBody. + * ContractCreateTransactionBody or a ContractCallTransactionBody. */ AccountID sender_id = 13; @@ -184,7 +184,7 @@ message ContractFunctionResult { * It will not have a consensus timestamp. It cannot generate a record or a receipt. The response will contain the output * returned by the function call. This is useful for calling getter functions, which purely read the state and don't change it. * It is faster and cheaper than a normal call, because it is purely local to a single node. - * + * * Unlike a ContractCall transaction, the node will consume the entire amount of provided gas in determining * the fee for this query. */ @@ -217,7 +217,7 @@ message ContractCallLocalQuery { /** * The account that is the "sender." If not present it is the accountId from the transactionId. - * Typically a different value than specified in the transactionId requires a valid signature + * Typically a different value than specified in the transactionId requires a valid signature * over either the hedera transaction or foreign transaction data. */ AccountID sender_id = 6; diff --git a/sdk/src/main/proto/contract_create.proto b/sdk/src/main/proto/contract_create.proto index b2aea7fa92..a5ec140a78 100644 --- a/sdk/src/main/proto/contract_create.proto +++ b/sdk/src/main/proto/contract_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -32,10 +32,10 @@ import "duration.proto"; /** * Start a new smart contract instance. After the instance is created, the ContractID for it is in * the receipt, and can be retrieved by the Record or with a GetByKey query. The instance will run - * the bytecode, either stored in a previously created file or in the transaction body itself for + * the bytecode, either stored in a previously created file or in the transaction body itself for * small contracts. - * - * + * + * * The constructor will be executed using the given amount of gas, and any unspent gas will be * refunded to the paying account. Constructor inputs come from the given constructorParameters. * - The instance will exist for autoRenewPeriod seconds. When that is reached, it will renew @@ -82,7 +82,7 @@ import "duration.proto"; * to the smart contract in the future. The memo field can only be changed using the admin keys. * If there are no admin keys, then it cannot be changed after the smart contract is created. * - * Signing requirements: If an admin key is set, it must sign the transaction. If an + * Signing requirements: If an admin key is set, it must sign the transaction. If an * auto-renew account is set, its key must sign the transaction. */ message ContractCreateTransactionBody { diff --git a/sdk/src/main/proto/contract_delete.proto b/sdk/src/main/proto/contract_delete.proto index 2260a55eb1..820fcd6c5e 100644 --- a/sdk/src/main/proto/contract_delete.proto +++ b/sdk/src/main/proto/contract_delete.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -30,10 +30,10 @@ import "basic_types.proto"; /** * At consensus, marks a contract as deleted and transfers its remaining hBars, if any, to a * designated receiver. After a contract is deleted, it can no longer be called. - * + * * If the target contract is immutable (that is, was created without an admin key), then this * transaction resolves to MODIFYING_IMMUTABLE_CONTRACT. - * + * * --- Signing Requirements --- * 1. The admin key of the target contract must sign. * 2. If the transfer account or contract has receiverSigRequired, its associated key must also sign @@ -57,7 +57,7 @@ message ContractDeleteTransactionBody { } /** - * If set to true, means this is a "synthetic" system transaction being used to + * If set to true, means this is a "synthetic" system transaction being used to * alert mirror nodes that the contract is being permanently removed from the ledger. * IMPORTANT: User transactions cannot set this field to true, as permanent * removal is always managed by the ledger itself. Any ContractDeleteTransactionBody diff --git a/sdk/src/main/proto/contract_get_bytecode.proto b/sdk/src/main/proto/contract_get_bytecode.proto index ba6224ecc2..e6c83263ff 100644 --- a/sdk/src/main/proto/contract_get_bytecode.proto +++ b/sdk/src/main/proto/contract_get_bytecode.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_get_info.proto b/sdk/src/main/proto/contract_get_info.proto index d9c16b4052..5b2a0044c5 100644 --- a/sdk/src/main/proto/contract_get_info.proto +++ b/sdk/src/main/proto/contract_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -121,15 +121,15 @@ message ContractGetInfoResponse { bool deleted = 10; /** - * [DEPRECATED] The metadata of the tokens associated to the contract. This field was - * deprecated by HIP-367, which allowed - * an account to be associated to an unlimited number of tokens. This scale makes it more + * [DEPRECATED] The metadata of the tokens associated to the contract. This field was + * deprecated by HIP-367, which allowed + * an account to be associated to an unlimited number of tokens. This scale makes it more * efficient for users to consult mirror nodes to review their token associations. */ repeated TokenRelationship tokenRelationships = 11 [deprecated = true]; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 12; diff --git a/sdk/src/main/proto/contract_get_records.proto b/sdk/src/main/proto/contract_get_records.proto index b4d68fab9f..8423c7e3ec 100644 --- a/sdk/src/main/proto/contract_get_records.proto +++ b/sdk/src/main/proto/contract_get_records.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_types.proto b/sdk/src/main/proto/contract_types.proto index b345d239ea..d07b3a4543 100644 --- a/sdk/src/main/proto/contract_types.proto +++ b/sdk/src/main/proto/contract_types.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -44,4 +44,4 @@ message ContractNonceInfo { * The current value of the contract account's nonce property */ int64 nonce = 2; -} \ No newline at end of file +} diff --git a/sdk/src/main/proto/contract_update.proto b/sdk/src/main/proto/contract_update.proto index d54fec5a96..a0981154bc 100644 --- a/sdk/src/main/proto/contract_update.proto +++ b/sdk/src/main/proto/contract_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -33,12 +33,12 @@ import "google/protobuf/wrappers.proto"; /** * At consensus, updates the fields of a smart contract to the given values. - * + * * If no value is given for a field, that field is left unchanged on the contract. For an immutable * smart contract (that is, a contract created without an adminKey), only the expirationTime may be * updated; setting any other field in this case will cause the transaction status to resolve to * MODIFYING_IMMUTABLE_CONTRACT. - * + * * --- Signing Requirements --- * 1. Whether or not a contract has an admin key, its expiry can be extended with only the * transaction payer's signature. @@ -109,7 +109,7 @@ message ContractUpdateTransactionBody { google.protobuf.Int32Value max_automatic_token_associations = 11; /** - * If set to the sentinel 0.0.0 AccountID, this field removes the contract's auto-renew + * If set to the sentinel 0.0.0 AccountID, this field removes the contract's auto-renew * account. Otherwise it updates the contract's auto-renew account to the referenced account. */ AccountID auto_renew_account_id = 12; diff --git a/sdk/src/main/proto/crypto_add_live_hash.proto b/sdk/src/main/proto/crypto_add_live_hash.proto index 826dd3d165..c508a8724d 100644 --- a/sdk/src/main/proto/crypto_add_live_hash.proto +++ b/sdk/src/main/proto/crypto_add_live_hash.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -32,7 +32,7 @@ import "duration.proto"; /** * A hash---presumably of some kind of credential or certificate---along with a list of keys, each - * of which may be either a primitive or a threshold key. + * of which may be either a primitive or a threshold key. */ message LiveHash { /** diff --git a/sdk/src/main/proto/crypto_approve_allowance.proto b/sdk/src/main/proto/crypto_approve_allowance.proto index 4177788179..88b9f3433a 100644 --- a/sdk/src/main/proto/crypto_approve_allowance.proto +++ b/sdk/src/main/proto/crypto_approve_allowance.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -35,7 +35,7 @@ import "google/protobuf/wrappers.proto"; * hbar/token to any other account of the spender's choice. If the owner is not specified in any allowance, the payer * of transaction is considered to be the owner for that particular allowance. * Setting the amount to zero in CryptoAllowance or TokenAllowance will remove the respective allowance for the spender. - * + * * (So if account 0.0.X pays for this transaction and owner is not specified in the allowance, * then at consensus each spender account will have new allowances to spend hbar or tokens from 0.0.X). */ diff --git a/sdk/src/main/proto/crypto_create.proto b/sdk/src/main/proto/crypto_create.proto index 5281a65918..2514bde214 100644 --- a/sdk/src/main/proto/crypto_create.proto +++ b/sdk/src/main/proto/crypto_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -46,7 +46,7 @@ import "duration.proto"; * used to extend its expiration as long as possible. If it is has a zero balance when it expires, * then it is deleted. This transaction must be signed by the payer account. If receiverSigRequired * is false, then the transaction does not have to be signed by the keys in the keys field. If it is - * true, then it must be signed by them, in addition to the keys of the payer account. If the + * true, then it must be signed by them, in addition to the keys of the payer account. If the * auto_renew_account field is set, the key of the referenced account must sign. * * An entity (account, file, or smart contract instance) must be created in a particular realm. If @@ -169,7 +169,7 @@ message CryptoCreateTransactionBody { * A given alias can map to at most one account on the network at a time. This uniqueness will be enforced * relative to aliases currently on the network at alias assignment. * - * If a transaction creates an account using an alias, any further crypto transfers to that alias will + * If a transaction creates an account using an alias, any further crypto transfers to that alias will * simply be deposited in that account, without creating anything, and with no creation fee being charged. */ bytes alias = 18; diff --git a/sdk/src/main/proto/crypto_delete.proto b/sdk/src/main/proto/crypto_delete.proto index 30719afe42..efd2619c80 100644 --- a/sdk/src/main/proto/crypto_delete.proto +++ b/sdk/src/main/proto/crypto_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_delete_allowance.proto b/sdk/src/main/proto/crypto_delete_allowance.proto index 475df5f869..a398989009 100644 --- a/sdk/src/main/proto/crypto_delete_allowance.proto +++ b/sdk/src/main/proto/crypto_delete_allowance.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_delete_live_hash.proto b/sdk/src/main/proto/crypto_delete_live_hash.proto index 41ba5dfbc3..28ef28965b 100644 --- a/sdk/src/main/proto/crypto_delete_live_hash.proto +++ b/sdk/src/main/proto/crypto_delete_live_hash.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_account_balance.proto b/sdk/src/main/proto/crypto_get_account_balance.proto index 7f72512ddf..ffde341563 100644 --- a/sdk/src/main/proto/crypto_get_account_balance.proto +++ b/sdk/src/main/proto/crypto_get_account_balance.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -76,9 +76,9 @@ message CryptoGetAccountBalanceResponse { uint64 balance = 3; /** - * [DEPRECATED] The balances of the tokens associated to the account. This field was - * deprecated by HIP-367, which allowed - * an account to be associated to an unlimited number of tokens. This scale makes it more + * [DEPRECATED] The balances of the tokens associated to the account. This field was + * deprecated by HIP-367, which allowed + * an account to be associated to an unlimited number of tokens. This scale makes it more * efficient for users to consult mirror nodes to review their token balances. */ repeated TokenBalance tokenBalances = 4 [deprecated = true]; diff --git a/sdk/src/main/proto/crypto_get_account_records.proto b/sdk/src/main/proto/crypto_get_account_records.proto index 1832972490..889989d3a7 100644 --- a/sdk/src/main/proto/crypto_get_account_records.proto +++ b/sdk/src/main/proto/crypto_get_account_records.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_info.proto b/sdk/src/main/proto/crypto_get_info.proto index d217398315..d3c111e2c0 100644 --- a/sdk/src/main/proto/crypto_get_info.proto +++ b/sdk/src/main/proto/crypto_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -139,9 +139,9 @@ message CryptoGetInfoResponse { repeated LiveHash liveHashes = 14; /** - * [DEPRECATED] The metadata of the tokens associated to the account. This field was - * deprecated by HIP-367, which allowed - * an account to be associated to an unlimited number of tokens. This scale makes it more + * [DEPRECATED] The metadata of the tokens associated to the account. This field was + * deprecated by HIP-367, which allowed + * an account to be associated to an unlimited number of tokens. This scale makes it more * efficient for users to consult mirror nodes to review their token associations. */ repeated TokenRelationship tokenRelationships = 15 [deprecated = true]; @@ -167,7 +167,7 @@ message CryptoGetInfoResponse { bytes alias = 19; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 20; diff --git a/sdk/src/main/proto/crypto_get_live_hash.proto b/sdk/src/main/proto/crypto_get_live_hash.proto index 1bf80ef324..98da20e637 100644 --- a/sdk/src/main/proto/crypto_get_live_hash.proto +++ b/sdk/src/main/proto/crypto_get_live_hash.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_stakers.proto b/sdk/src/main/proto/crypto_get_stakers.proto index 44f52eb5a0..008f215e88 100644 --- a/sdk/src/main/proto/crypto_get_stakers.proto +++ b/sdk/src/main/proto/crypto_get_stakers.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_service.proto b/sdk/src/main/proto/crypto_service.proto index 226943555f..0a0ede7761 100644 --- a/sdk/src/main/proto/crypto_service.proto +++ b/sdk/src/main/proto/crypto_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/crypto_transfer.proto b/sdk/src/main/proto/crypto_transfer.proto index 5c25747e3d..47dc017825 100644 --- a/sdk/src/main/proto/crypto_transfer.proto +++ b/sdk/src/main/proto/crypto_transfer.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -37,7 +37,7 @@ import "basic_types.proto"; * hbars, then the entire transaction fails, and none of those transfers occur, though the * transaction fee is still charged. This transaction must be signed by the keys for all the sending * accounts, and for any receiving accounts that have receiverSigRequired == true. The signatures - * are in the same order as the accounts, skipping those accounts that don't need a signature. + * are in the same order as the accounts, skipping those accounts that don't need a signature. */ message CryptoTransferTransactionBody { /** diff --git a/sdk/src/main/proto/crypto_update.proto b/sdk/src/main/proto/crypto_update.proto index c83e8a80a1..cdaf16e9c0 100644 --- a/sdk/src/main/proto/crypto_update.proto +++ b/sdk/src/main/proto/crypto_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -36,8 +36,8 @@ import "google/protobuf/wrappers.proto"; * transaction must be signed by the existing key for this account. If the transaction is changing * the key field, then the transaction must be signed by both the old key (from before the change) * and the new key. The old key must sign for security. The new key must sign as a safeguard to - * avoid accidentally changing to an invalid key, and then having no way to recover. - * If the update transaction sets the auto_renew_account field to anything other + * avoid accidentally changing to an invalid key, and then having no way to recover. + * If the update transaction sets the auto_renew_account field to anything other * than the sentinel 0.0.0, the key of the referenced account must sign. */ message CryptoUpdateTransactionBody { diff --git a/sdk/src/main/proto/custom_fees.proto b/sdk/src/main/proto/custom_fees.proto index bda20b4680..bccb3d9529 100644 --- a/sdk/src/main/proto/custom_fees.proto +++ b/sdk/src/main/proto/custom_fees.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -81,20 +81,20 @@ message FixedFee { * any fungible value, the ledger will assess the fallback fee, if present, to the new NFT owner. * Royalty fees can only be added to tokens of type type NON_FUNGIBLE_UNIQUE. * - * **IMPORTANT:** Users must understand that native royalty fees are _strictly_ a convenience feature, - * and that the network cannot enforce inescapable royalties on the exchange of a non-fractional NFT. - * For example, if the counterparties agree to split their value transfer and NFT exchange into separate - * transactions, the network cannot possibly intervene. (And note the counterparties could use a smart + * **IMPORTANT:** Users must understand that native royalty fees are _strictly_ a convenience feature, + * and that the network cannot enforce inescapable royalties on the exchange of a non-fractional NFT. + * For example, if the counterparties agree to split their value transfer and NFT exchange into separate + * transactions, the network cannot possibly intervene. (And note the counterparties could use a smart * contract to make this split transaction atomic if they do not trust each other.) - * - * Counterparties that _do_ wish to respect creator royalties should follow the pattern the network - * recognizes: The NFT sender and receiver should both sign a single `CryptoTransfer` that credits + * + * Counterparties that _do_ wish to respect creator royalties should follow the pattern the network + * recognizes: The NFT sender and receiver should both sign a single `CryptoTransfer` that credits * the sender with all the fungible value the receiver is exchanging for the NFT. - * - * Similarly, a marketplace using an approved spender account for an escrow transaction should credit - * the account selling the NFT in the same `CryptoTransfer` that deducts fungible value from the buying - * account. - * + * + * Similarly, a marketplace using an approved spender account for an escrow transaction should credit + * the account selling the NFT in the same `CryptoTransfer` that deducts fungible value from the buying + * account. + * * There is an [open HIP discussion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) * that proposes to broaden the class of transactions for which the network automatically collects * royalties. If this interests or concerns you, please add your voice to that discussion. @@ -143,7 +143,7 @@ message CustomFee { /** * If true, exempts all the token's fee collection accounts from this fee. * (The token's treasury and the above fee_collector_account_id will always - * be exempt. Please see HIP-573 + * be exempt. Please see HIP-573 * for details.) */ bool all_collectors_are_exempt = 5; diff --git a/sdk/src/main/proto/duration.proto b/sdk/src/main/proto/duration.proto index 0883f7d595..82bcf88367 100644 --- a/sdk/src/main/proto/duration.proto +++ b/sdk/src/main/proto/duration.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/ethereum_transaction.proto b/sdk/src/main/proto/ethereum_transaction.proto index dad33e10bc..7a2be5bc73 100644 --- a/sdk/src/main/proto/ethereum_transaction.proto +++ b/sdk/src/main/proto/ethereum_transaction.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -31,33 +31,33 @@ import "basic_types.proto"; message EthereumTransactionBody { /** - * The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete + * The raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete * unless the callData field is set. */ bytes ethereum_data = 1; /** * For large transactions (for example contract create) this is the callData - * of the ethereumData. The data in the ethereumData will be re-written with - * the callData element as a zero length string with the original contents in - * the referenced file at time of execution. The ethereumData will need to be + * of the ethereumData. The data in the ethereumData will be re-written with + * the callData element as a zero length string with the original contents in + * the referenced file at time of execution. The ethereumData will need to be * "rehydrated" with the callData for signature validation to pass. */ FileID call_data = 2; /** - * The maximum amount, in tinybars, that the payer of the hedera transaction + * The maximum amount, in tinybars, that the payer of the hedera transaction * is willing to pay to complete the transaction. * - * Ordinarily the account with the ECDSA alias corresponding to the public + * Ordinarily the account with the ECDSA alias corresponding to the public * key that is extracted from the ethereum_data signature is responsible for * fees that result from the execution of the transaction. If that amount of * authorized fees is not sufficient then the payer of the transaction can be - * charged, up to but not exceeding this amount. If the ethereum_data + * charged, up to but not exceeding this amount. If the ethereum_data * transaction authorized an amount that was insufficient then the payer will - * only be charged the amount needed to make up the difference. If the gas - * price in the transaction was set to zero then the payer will be assessed + * only be charged the amount needed to make up the difference. If the gas + * price in the transaction was set to zero then the payer will be assessed * the entire fee. */ int64 max_gas_allowance = 3; -} \ No newline at end of file +} diff --git a/sdk/src/main/proto/exchange_rate.proto b/sdk/src/main/proto/exchange_rate.proto index 0a0c3f7b81..0ed1957749 100644 --- a/sdk/src/main/proto/exchange_rate.proto +++ b/sdk/src/main/proto/exchange_rate.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -30,7 +30,7 @@ import "timestamp.proto"; /** * An exchange rate between hbar and cents (USD) and the time at which the exchange rate will - * expire, and be superseded by a new exchange rate. + * expire, and be superseded by a new exchange rate. */ message ExchangeRate { /** diff --git a/sdk/src/main/proto/file.proto b/sdk/src/main/proto/file.proto index 657af7b4fa..edf11936df 100644 --- a/sdk/src/main/proto/file.proto +++ b/sdk/src/main/proto/file.proto @@ -24,7 +24,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -64,4 +64,4 @@ message File { */ int64 pre_system_delete_expiration_second = 7; -} \ No newline at end of file +} diff --git a/sdk/src/main/proto/file_append.proto b/sdk/src/main/proto/file_append.proto index c70cd18f4e..6be74beb3b 100644 --- a/sdk/src/main/proto/file_append.proto +++ b/sdk/src/main/proto/file_append.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -34,7 +34,7 @@ import "basic_types.proto"; * single FileCreateTransaction, then it can be created with the first part of its contents, and * then appended as many times as necessary to create the entire file. This transaction must be * signed by all initial M-of-M KeyList keys. If keys contains additional KeyList or ThresholdKey - * then M-of-M secondary KeyList or ThresholdKey signing requirements must be meet. + * then M-of-M secondary KeyList or ThresholdKey signing requirements must be meet. */ message FileAppendTransactionBody { /** diff --git a/sdk/src/main/proto/file_create.proto b/sdk/src/main/proto/file_create.proto index b3df3a5926..490487020a 100644 --- a/sdk/src/main/proto/file_create.proto +++ b/sdk/src/main/proto/file_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -38,14 +38,14 @@ import "timestamp.proto"; * at the expirationTime, unless its expiration is extended by another transaction before that time. * If the file is deleted, then its contents will become empty and it will be marked as deleted * until it expires, and then it will cease to exist. - * + * * The keys field is a list of keys. All keys within the top-level key list must sign (M-M) to * create or modify a file. However, to delete the file, only one key (1-M) is required to sign from * the top-level key list. Each of those "keys" may itself be threshold key containing other keys * (including other threshold keys). In other words, the behavior is an AND for create/modify, OR * for delete. This is useful for acting as a revocation server. If it is desired to have the * behavior be AND for all 3 operations (or OR for all 3), then the list should have only a single - * Key, which is a threshold key, with N=1 for OR, N=M for AND. If the auto_renew_account field + * Key, which is a threshold key, with N=1 for OR, N=M for AND. If the auto_renew_account field * is set, the key of the referenced account must sign. * * If a file is created without ANY keys in the keys field, the file is immutable and ONLY the diff --git a/sdk/src/main/proto/file_delete.proto b/sdk/src/main/proto/file_delete.proto index f4b23c988f..ee9fc3a422 100644 --- a/sdk/src/main/proto/file_delete.proto +++ b/sdk/src/main/proto/file_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_get_contents.proto b/sdk/src/main/proto/file_get_contents.proto index ee888d6af0..06138d8f82 100644 --- a/sdk/src/main/proto/file_get_contents.proto +++ b/sdk/src/main/proto/file_get_contents.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_get_info.proto b/sdk/src/main/proto/file_get_info.proto index a408ebd88d..6458fe4fbf 100644 --- a/sdk/src/main/proto/file_get_info.proto +++ b/sdk/src/main/proto/file_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -94,7 +94,7 @@ message FileGetInfoResponse { string memo = 6; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 7; } diff --git a/sdk/src/main/proto/file_service.proto b/sdk/src/main/proto/file_service.proto index 04087353fa..febe0228cd 100644 --- a/sdk/src/main/proto/file_service.proto +++ b/sdk/src/main/proto/file_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; @@ -30,7 +30,7 @@ import "transaction_response.proto"; import "transaction.proto"; /** - * Transactions and queries for the file service. + * Transactions and queries for the file service. */ service FileService { /** diff --git a/sdk/src/main/proto/file_update.proto b/sdk/src/main/proto/file_update.proto index 74e0490ec0..9ed5c50bbd 100644 --- a/sdk/src/main/proto/file_update.proto +++ b/sdk/src/main/proto/file_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -36,7 +36,7 @@ import "google/protobuf/wrappers.proto"; * in the top level of a key list (M-of-M) of the file being updated. If the keys themselves are * being updated, then the transaction must also be signed by all the new keys. If the keys contain * additional KeyList or ThresholdKey then M-of-M secondary KeyList or ThresholdKey signing - * requirements must be meet If the update transaction sets the auto_renew_account_id field + * requirements must be meet If the update transaction sets the auto_renew_account_id field * to anything other than the sentinel 0.0.0, the key of the referenced account must sign. */ message FileUpdateTransactionBody { diff --git a/sdk/src/main/proto/freeze.proto b/sdk/src/main/proto/freeze.proto index a466b41816..31699dea42 100644 --- a/sdk/src/main/proto/freeze.proto +++ b/sdk/src/main/proto/freeze.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/freeze_service.proto b/sdk/src/main/proto/freeze_service.proto index b43d1f8de6..988b31245d 100644 --- a/sdk/src/main/proto/freeze_service.proto +++ b/sdk/src/main/proto/freeze_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "transaction_response.proto"; diff --git a/sdk/src/main/proto/freeze_type.proto b/sdk/src/main/proto/freeze_type.proto index 7abcf47f66..7931ec8630 100644 --- a/sdk/src/main/proto/freeze_type.proto +++ b/sdk/src/main/proto/freeze_type.proto @@ -22,50 +22,50 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** -* The type of network freeze or upgrade operation to be performed. This type dictates which -* fields are required. +* The type of network freeze or upgrade operation to be performed. This type dictates which +* fields are required. */ enum FreezeType { /** - * An (invalid) default value for this enum, to ensure the client explicitly sets + * An (invalid) default value for this enum, to ensure the client explicitly sets * the intended type of freeze transaction. */ UNKNOWN_FREEZE_TYPE = 0; /** - * Freezes the network at the specified time. The start_time field must be provided and - * must reference a future time. Any values specified for the update_file and file_hash - * fields will be ignored. This transaction does not perform any network changes or - * upgrades and requires manual intervention to restart the network. + * Freezes the network at the specified time. The start_time field must be provided and + * must reference a future time. Any values specified for the update_file and file_hash + * fields will be ignored. This transaction does not perform any network changes or + * upgrades and requires manual intervention to restart the network. */ - FREEZE_ONLY = 1; + FREEZE_ONLY = 1; /** - * A non-freezing operation that initiates network wide preparation in advance of a - * scheduled freeze upgrade. The update_file and file_hash fields must be provided and + * A non-freezing operation that initiates network wide preparation in advance of a + * scheduled freeze upgrade. The update_file and file_hash fields must be provided and * valid. The start_time field may be omitted and any value present will be ignored. */ - PREPARE_UPGRADE = 2; + PREPARE_UPGRADE = 2; /** - * Freezes the network at the specified time and performs the previously prepared - * automatic upgrade across the entire network. + * Freezes the network at the specified time and performs the previously prepared + * automatic upgrade across the entire network. */ - FREEZE_UPGRADE = 3; + FREEZE_UPGRADE = 3; /** * Aborts a pending network freeze operation. */ - FREEZE_ABORT = 4; + FREEZE_ABORT = 4; /** - * Performs an immediate upgrade on auxilary services and containers providing - * telemetry/metrics. Does not impact network operations. + * Performs an immediate upgrade on auxilary services and containers providing + * telemetry/metrics. Does not impact network operations. */ - TELEMETRY_UPGRADE = 5; + TELEMETRY_UPGRADE = 5; } diff --git a/sdk/src/main/proto/get_account_details.proto b/sdk/src/main/proto/get_account_details.proto index 98ebe7f271..17db5948fe 100644 --- a/sdk/src/main/proto/get_account_details.proto +++ b/sdk/src/main/proto/get_account_details.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/get_by_key.proto b/sdk/src/main/proto/get_by_key.proto index e166b3367a..2bb5ff2bd1 100644 --- a/sdk/src/main/proto/get_by_key.proto +++ b/sdk/src/main/proto/get_by_key.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/get_by_solidity_id.proto b/sdk/src/main/proto/get_by_solidity_id.proto index 1c9d111c3c..fd26baea4f 100644 --- a/sdk/src/main/proto/get_by_solidity_id.proto +++ b/sdk/src/main/proto/get_by_solidity_id.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/ledger_id.proto b/sdk/src/main/proto/ledger_id.proto index 98e5d42f43..7ad72a6088 100644 --- a/sdk/src/main/proto/ledger_id.proto +++ b/sdk/src/main/proto/ledger_id.proto @@ -33,7 +33,7 @@ package com.hedera.hapi.node.state.roster; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/mirror/consensus_service.proto b/sdk/src/main/proto/mirror/consensus_service.proto index 686f3e7ab1..217d324c12 100644 --- a/sdk/src/main/proto/mirror/consensus_service.proto +++ b/sdk/src/main/proto/mirror/consensus_service.proto @@ -27,7 +27,7 @@ package com.hedera.mirror.api.proto; */ option java_multiple_files = true; -option java_package = "com.hedera.hashgraph.sdk.proto.mirror"; +option java_package = "com.hiero.sdk.proto.mirror"; import "basic_types.proto"; import "timestamp.proto"; diff --git a/sdk/src/main/proto/mirror/mirror_network_service.proto b/sdk/src/main/proto/mirror/mirror_network_service.proto index 460da29f30..d2f8d3c299 100644 --- a/sdk/src/main/proto/mirror/mirror_network_service.proto +++ b/sdk/src/main/proto/mirror/mirror_network_service.proto @@ -23,7 +23,7 @@ syntax = "proto3"; package com.hedera.mirror.api.proto; option java_multiple_files = true; // Required for the reactor-grpc generator to work correctly -option java_package = "com.hedera.hashgraph.sdk.proto.mirror"; +option java_package = "com.hiero.sdk.proto.mirror"; import "basic_types.proto"; import "timestamp.proto"; diff --git a/sdk/src/main/proto/network_get_execution_time.proto b/sdk/src/main/proto/network_get_execution_time.proto index 0c282f1a7b..6093896208 100644 --- a/sdk/src/main/proto/network_get_execution_time.proto +++ b/sdk/src/main/proto/network_get_execution_time.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -31,9 +31,9 @@ import "query_header.proto"; import "response_header.proto"; /** - * Gets the time in nanoseconds spent in handleTransaction for one or more - * TransactionIDs (assuming they have reached consensus "recently", since only a limited - * number of execution times are kept in-memory, depending on the value of the node-local + * Gets the time in nanoseconds spent in handleTransaction for one or more + * TransactionIDs (assuming they have reached consensus "recently", since only a limited + * number of execution times are kept in-memory, depending on the value of the node-local * property stats.executionTimesToTrack). */ message NetworkGetExecutionTimeQuery { diff --git a/sdk/src/main/proto/network_get_version_info.proto b/sdk/src/main/proto/network_get_version_info.proto index 64978788db..ca97df7361 100644 --- a/sdk/src/main/proto/network_get_version_info.proto +++ b/sdk/src/main/proto/network_get_version_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/network_service.proto b/sdk/src/main/proto/network_service.proto index 49f06e5d5e..488e977468 100644 --- a/sdk/src/main/proto/network_service.proto +++ b/sdk/src/main/proto/network_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; @@ -40,9 +40,9 @@ service NetworkService { rpc getVersionInfo (Query) returns (Response); /** - * Retrieves the time in nanoseconds spent in handleTransaction for one or more - * TransactionIDs (assuming they have reached consensus "recently", since only a limited - * number of execution times are kept in-memory, depending on the value of the node-local + * Retrieves the time in nanoseconds spent in handleTransaction for one or more + * TransactionIDs (assuming they have reached consensus "recently", since only a limited + * number of execution times are kept in-memory, depending on the value of the node-local * property stats.executionTimesToTrack). */ rpc getExecutionTime (Query) returns (Response); diff --git a/sdk/src/main/proto/network_staking_rewards.proto b/sdk/src/main/proto/network_staking_rewards.proto index 66d99530e3..608c9f9c87 100644 --- a/sdk/src/main/proto/network_staking_rewards.proto +++ b/sdk/src/main/proto/network_staking_rewards.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/nft.proto b/sdk/src/main/proto/nft.proto index bfb17fcebf..2ecc59a043 100644 --- a/sdk/src/main/proto/nft.proto +++ b/sdk/src/main/proto/nft.proto @@ -25,7 +25,7 @@ package proto; import "timestamp.proto"; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -64,13 +64,13 @@ message Nft { bytes metadata = 5; /** - * If the owner of this NFT is not its token treasury, the id of the previous NFT + * If the owner of this NFT is not its token treasury, the id of the previous NFT * in the owner's "doubly-linked list" of owned NFTs (if any). */ NftID owner_previous_nft_id = 6; /** - * If the owner of this NFT is not its token treasury, the id of the next NFT in + * If the owner of this NFT is not its token treasury, the id of the next NFT in * the owner's "doubly-linked list" of owned NFTs (if any). */ NftID owner_next_nft_id = 7; diff --git a/sdk/src/main/proto/node.proto b/sdk/src/main/proto/node.proto index 9b99cf1d06..57ce0df896 100644 --- a/sdk/src/main/proto/node.proto +++ b/sdk/src/main/proto/node.proto @@ -20,7 +20,7 @@ package com.hedera.hapi.node.state.addressbook; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_create.proto b/sdk/src/main/proto/node_create.proto index 8d828c724d..9fe24f7702 100644 --- a/sdk/src/main/proto/node_create.proto +++ b/sdk/src/main/proto/node_create.proto @@ -18,7 +18,7 @@ package com.hedera.hapi.node.addressbook; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_delete.proto b/sdk/src/main/proto/node_delete.proto index 48395312c4..c30a79629e 100644 --- a/sdk/src/main/proto/node_delete.proto +++ b/sdk/src/main/proto/node_delete.proto @@ -18,7 +18,7 @@ package com.hedera.hapi.node.addressbook; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_stake_update.proto b/sdk/src/main/proto/node_stake_update.proto index a8afdb2c3b..51062220f1 100644 --- a/sdk/src/main/proto/node_stake_update.proto +++ b/sdk/src/main/proto/node_stake_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -62,7 +62,7 @@ message NodeStakeUpdateTransactionBody { int64 staking_periods_stored = 5; /** - * The number of minutes in a staking period. Note for the special case of 1440 minutes, periods are + * The number of minutes in a staking period. Note for the special case of 1440 minutes, periods are * treated as UTC calendar days, rather than repeating 1440 minute periods left-aligned at the epoch. */ int64 staking_period = 6; @@ -78,40 +78,40 @@ message NodeStakeUpdateTransactionBody { int64 staking_start_threshold = 8; /** - * (DEPRECATED) The maximum total number of tinybars to be distributed as staking rewards in the + * (DEPRECATED) The maximum total number of tinybars to be distributed as staking rewards in the * ending period. Please consult the max_total_reward field instead. */ int64 staking_reward_rate = 9 [deprecated = true]; /** - * The amount of the staking reward funds (account 0.0.800) reserved to pay pending rewards that + * The amount of the staking reward funds (account 0.0.800) reserved to pay pending rewards that * have been earned but not collected. */ int64 reserved_staking_rewards = 10; /** - * The unreserved balance of account 0.0.800 at the close of the just-ending period; this value is + * The unreserved balance of account 0.0.800 at the close of the just-ending period; this value is * used to compute the HIP-782 balance ratio. */ int64 unreserved_staking_reward_balance = 11; /** - * The unreserved tinybar balance of account 0.0.800 required to achieve the maximum per-hbar reward + * The unreserved tinybar balance of account 0.0.800 required to achieve the maximum per-hbar reward * rate in any period; please see HIP-782 for details. */ int64 reward_balance_threshold = 12; /** - * The maximum amount of tinybar that can be staked for reward while still achieving the maximum + * The maximum amount of tinybar that can be staked for reward while still achieving the maximum * per-hbar reward rate in any period; please see HIP-782 for details. */ int64 max_stake_rewarded = 13; /** - * The maximum total tinybars that could be paid as staking rewards in the ending period, after + * The maximum total tinybars that could be paid as staking rewards in the ending period, after * applying the settings for the 0.0.800 balance threshold and the maximum stake rewarded. This - * field replaces the deprecated field staking_reward_rate. It is only for convenience, since a - * mirror node could also calculate its value by iterating the node_stake list and summing + * field replaces the deprecated field staking_reward_rate. It is only for convenience, since a + * mirror node could also calculate its value by iterating the node_stake list and summing * stake_rewarded fields; then multiplying this sum by the max_staking_reward_rate_per_hbar. */ int64 max_total_reward = 14; @@ -123,14 +123,14 @@ message NodeStakeUpdateTransactionBody { message NodeStake { /** * The maximum stake (rewarded or not rewarded) this node can have as consensus weight. If its stake to - * reward is above this maximum at the start of a period, then accounts staking to the node in that + * reward is above this maximum at the start of a period, then accounts staking to the node in that * period will be rewarded at a lower rate scaled by (maxStake / stakeRewardStart). */ int64 max_stake = 1; /** * The minimum stake (rewarded or not rewarded) this node must reach before having non-zero consensus weight. - * If its total stake is below this minimum at the start of a period, then accounts staking to the node in + * If its total stake is below this minimum at the start of a period, then accounts staking to the node in * that period will receive no rewards. */ int64 min_stake = 2; @@ -141,8 +141,8 @@ message NodeStake { int64 node_id = 3; /** - * The reward rate _per whole hbar_ that was staked to this node with declineReward=false from the start of - * the staking period that is ending. + * The reward rate _per whole hbar_ that was staked to this node with declineReward=false from the start of + * the staking period that is ending. */ int64 reward_rate = 4; @@ -152,13 +152,13 @@ message NodeStake { int64 stake = 5; /** - * Total of (balance + stakedToMe) for all accounts staked to this node with declineReward=true, at the + * Total of (balance + stakedToMe) for all accounts staked to this node with declineReward=true, at the * beginning of the new staking period. */ int64 stake_not_rewarded = 6; /** - * Total of (balance + stakedToMe) for all accounts staked to this node with declineReward=false, at the + * Total of (balance + stakedToMe) for all accounts staked to this node with declineReward=false, at the * beginning of the new staking period. */ int64 stake_rewarded = 7; diff --git a/sdk/src/main/proto/node_update.proto b/sdk/src/main/proto/node_update.proto index 25eed414c8..0b20565625 100644 --- a/sdk/src/main/proto/node_update.proto +++ b/sdk/src/main/proto/node_update.proto @@ -18,7 +18,7 @@ package com.hedera.hapi.node.addressbook; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/primitives.proto b/sdk/src/main/proto/primitives.proto index 7917055e1d..6c2fc73c58 100644 --- a/sdk/src/main/proto/primitives.proto +++ b/sdk/src/main/proto/primitives.proto @@ -24,7 +24,7 @@ package proto; * type instead. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/query.proto b/sdk/src/main/proto/query.proto index 7bf38eb0c6..a7734d611c 100644 --- a/sdk/src/main/proto/query.proto +++ b/sdk/src/main/proto/query.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/query_header.proto b/sdk/src/main/proto/query_header.proto index c96aa250ad..6f9061ced3 100644 --- a/sdk/src/main/proto/query_header.proto +++ b/sdk/src/main/proto/query_header.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -34,7 +34,7 @@ import "transaction.proto"; * (allowing it to tailor the payment transaction accordingly). If the payment in the query fails * the precheck, then the response may have some fields blank. The state proof is only available for * some types of information. It is available for a Record, but not a receipt. It is available for - * the information in each kind of *GetInfo request. + * the information in each kind of *GetInfo request. */ enum ResponseType { /** @@ -61,7 +61,7 @@ enum ResponseType { /** * Each query from the client to the node will contain the QueryHeader, which gives the requested * response type, and includes a payment transaction that will compensate the node for responding to - * the query. The payment can be blank if the query is free. + * the query. The payment can be blank if the query is free. */ message QueryHeader { /** diff --git a/sdk/src/main/proto/recordcache.proto b/sdk/src/main/proto/recordcache.proto index 5398675d5c..c3cd55f489 100644 --- a/sdk/src/main/proto/recordcache.proto +++ b/sdk/src/main/proto/recordcache.proto @@ -34,7 +34,7 @@ import "basic_types.proto"; import "transaction_record.proto"; import "response_code.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/response.proto b/sdk/src/main/proto/response.proto index 62daa7fb63..42ccb7a4ba 100644 --- a/sdk/src/main/proto/response.proto +++ b/sdk/src/main/proto/response.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/response_code.proto b/sdk/src/main/proto/response_code.proto index 81a6bc4733..0d11f7ee34 100644 --- a/sdk/src/main/proto/response_code.proto +++ b/sdk/src/main/proto/response_code.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/response_header.proto b/sdk/src/main/proto/response_header.proto index 56f9c35710..03b5909707 100644 --- a/sdk/src/main/proto/response_header.proto +++ b/sdk/src/main/proto/response_header.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/roster.proto b/sdk/src/main/proto/roster.proto index 853856c308..5249b54e49 100644 --- a/sdk/src/main/proto/roster.proto +++ b/sdk/src/main/proto/roster.proto @@ -20,7 +20,7 @@ package com.hedera.hapi.node.state.roster; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/roster_state.proto b/sdk/src/main/proto/roster_state.proto index 6532694e13..00ec76dacc 100644 --- a/sdk/src/main/proto/roster_state.proto +++ b/sdk/src/main/proto/roster_state.proto @@ -20,7 +20,7 @@ package com.hedera.hapi.node.state.roster; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/running_hashes.proto b/sdk/src/main/proto/running_hashes.proto index 856de26b8d..331104c613 100644 --- a/sdk/src/main/proto/running_hashes.proto +++ b/sdk/src/main/proto/running_hashes.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedulable_transaction_body.proto b/sdk/src/main/proto/schedulable_transaction_body.proto index 1cfa1cd286..9e665a07ef 100644 --- a/sdk/src/main/proto/schedulable_transaction_body.proto +++ b/sdk/src/main/proto/schedulable_transaction_body.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule.proto b/sdk/src/main/proto/schedule.proto index b8abb6c9e1..d69f79f1d1 100644 --- a/sdk/src/main/proto/schedule.proto +++ b/sdk/src/main/proto/schedule.proto @@ -27,7 +27,7 @@ import "timestamp.proto"; import "schedulable_transaction_body.proto"; import "transaction_body.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule_create.proto b/sdk/src/main/proto/schedule_create.proto index c7536aeee6..87884104e5 100644 --- a/sdk/src/main/proto/schedule_create.proto +++ b/sdk/src/main/proto/schedule_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -44,40 +44,40 @@ import "schedulable_transaction_body.proto"; * or ScheduleSign. * * Upon `SUCCESS`, the receipt also includes the scheduledTransactionID to - * use to query for the record of the scheduled transaction's execution (if it occurs). - * + * use to query for the record of the scheduled transaction's execution (if it occurs). + * * The expiration time of a schedule is controlled by it's expiration_time. It remains in state and can be queried * using GetScheduleInfo until expiration, no matter if the scheduled transaction has * executed or marked deleted. If Long Term Scheduled Transactions are disabled, the expiration_time is always * 30 minutes in the future. - * + * * If the adminKey field is omitted, the resulting schedule is immutable. If the * adminKey is set, the ScheduleDelete transaction can be used to mark it as * deleted. The creator may also specify an optional memo whose UTF-8 encoding is at most * 100 bytes and does not include the zero byte is also supported. - * + * * When a scheduledTransactionBody is executed, the * network only charges its payer the service fee, and not the node and network fees. If the * optional payerAccountID is set, the network charges this account. Otherwise it charges - * the payer of the originating ScheduleCreate. - * + * the payer of the originating ScheduleCreate. + * * Two ScheduleCreate transactions are identical if they are equal in all their * fields other than payerAccountID. (For the scheduledTransactionBody field, * "equal" should be understood in the sense of * gRPC object equality in the network software runtime. In particular, a gRPC object with unknown fields is - * not equal to a gRPC object without unknown fields, even if they agree on all known fields.) - * + * not equal to a gRPC object without unknown fields, even if they agree on all known fields.) + * * A ScheduleCreate transaction that attempts to re-create an identical schedule already in * state will receive a receipt with status IDENTICAL_SCHEDULE_ALREADY_CREATED; the receipt * will include the ScheduleID of the extant schedule, which may be used in a subsequent * ScheduleSign transaction. (The receipt will also include the TransactionID to * use in querying for the receipt or record of the scheduled transaction.) - * + * * Other notable response codes include, INVALID_ACCOUNT_ID, * UNSCHEDULABLE_TRANSACTION, UNRESOLVABLE_REQUIRED_SIGNERS, * INVALID_SIGNATURE. For more information please see the section of this documentation on - * the ResponseCode enum. + * the ResponseCode enum. */ message ScheduleCreateTransactionBody { /** diff --git a/sdk/src/main/proto/schedule_delete.proto b/sdk/src/main/proto/schedule_delete.proto index 4f6de56473..ef3524e125 100644 --- a/sdk/src/main/proto/schedule_delete.proto +++ b/sdk/src/main/proto/schedule_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -36,7 +36,7 @@ import "basic_types.proto"; * Other notable response codes include, INVALID_SCHEDULE_ID, SCHEDULE_PENDING_EXPIRATION, * SCHEDULE_ALREADY_DELETED, SCHEDULE_ALREADY_EXECUTED, SCHEDULE_IS_IMMUTABLE. * For more information please see the section of this documentation on the ResponseCode - * enum. + * enum. */ message ScheduleDeleteTransactionBody { /** diff --git a/sdk/src/main/proto/schedule_get_info.proto b/sdk/src/main/proto/schedule_get_info.proto index e723764104..b6db558bf3 100644 --- a/sdk/src/main/proto/schedule_get_info.proto +++ b/sdk/src/main/proto/schedule_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -34,7 +34,7 @@ import "schedulable_transaction_body.proto"; /** * Gets information about a schedule in the network's action queue. - * + * * Responds with INVALID_SCHEDULE_ID if the requested schedule doesn't exist. */ message ScheduleGetInfoQuery { @@ -53,7 +53,7 @@ message ScheduleGetInfoQuery { /** * Information summarizing schedule state */ -message ScheduleInfo { +message ScheduleInfo { /** * The id of the schedule */ @@ -117,7 +117,7 @@ message ScheduleInfo { TransactionID scheduledTransactionID = 11; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 12; @@ -130,7 +130,7 @@ message ScheduleInfo { * Note: this field is unused until Long Term Scheduled Transactions are enabled. */ bool wait_for_expiry = 13; -} +} /** * Response wrapper for the ScheduleInfo diff --git a/sdk/src/main/proto/schedule_service.proto b/sdk/src/main/proto/schedule_service.proto index 2289f586de..cc9d8eb4c0 100644 --- a/sdk/src/main/proto/schedule_service.proto +++ b/sdk/src/main/proto/schedule_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/schedule_sign.proto b/sdk/src/main/proto/schedule_sign.proto index 784970377e..ccc1076530 100644 --- a/sdk/src/main/proto/schedule_sign.proto +++ b/sdk/src/main/proto/schedule_sign.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -37,10 +37,10 @@ import "basic_types.proto"; * Otherwise, if the resulting set of signing keys satisfy the * scheduled transaction's signing requirements, it will be executed immediately after the * triggering ScheduleSign. - * + * * Upon SUCCESS, the receipt includes the scheduledTransactionID to use to query - * for the record of the scheduled transaction's execution (if it occurs). - * + * for the record of the scheduled transaction's execution (if it occurs). + * * Other notable response codes include INVALID_SCHEDULE_ID, SCHEDULE_ALREADY_DELETED, * SCHEDULE_PENDING_EXPIRATION, SCHEDULE_ALREADY_EXPIRED, * INVALID_ACCOUNT_ID, UNRESOLVABLE_REQUIRED_SIGNERS, diff --git a/sdk/src/main/proto/smart_contract_service.proto b/sdk/src/main/proto/smart_contract_service.proto index 05fc6c9bcc..a4f8762166 100644 --- a/sdk/src/main/proto/smart_contract_service.proto +++ b/sdk/src/main/proto/smart_contract_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "transaction_response.proto"; @@ -30,7 +30,7 @@ import "response.proto"; import "transaction.proto"; /** - * Transactions and queries for the file service. + * Transactions and queries for the file service. */ service SmartContractService { /** diff --git a/sdk/src/main/proto/staking_node_info.proto b/sdk/src/main/proto/staking_node_info.proto index 508acee943..35daae8b09 100644 --- a/sdk/src/main/proto/staking_node_info.proto +++ b/sdk/src/main/proto/staking_node_info.proto @@ -25,7 +25,7 @@ package proto; import "common.proto"; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/storage_slot.proto b/sdk/src/main/proto/storage_slot.proto index 3df5527b28..2a360674d7 100644 --- a/sdk/src/main/proto/storage_slot.proto +++ b/sdk/src/main/proto/storage_slot.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -30,8 +30,8 @@ import "basic_types.proto"; /** * The key of a storage slot. A slot is scoped to a specific contract number. - * - * For each contract, its EVM storage is a mapping of 256-bit keys (or "words") to 256-bit values. + * + * For each contract, its EVM storage is a mapping of 256-bit keys (or "words") to 256-bit values. */ message SlotKey { /** @@ -47,10 +47,10 @@ message SlotKey { /** * The value of a contract storage slot. For the EVM, this is a single word. - * + * * Because we iterate through all the storage slots for an expired contract * when purging it from state, our slot values also include the words - * of the previous and next keys in this contract's storage "list". + * of the previous and next keys in this contract's storage "list". */ message SlotValue { /** diff --git a/sdk/src/main/proto/system_delete.proto b/sdk/src/main/proto/system_delete.proto index a49b9ec810..a1cbe1605a 100644 --- a/sdk/src/main/proto/system_delete.proto +++ b/sdk/src/main/proto/system_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -35,7 +35,7 @@ import "timestamp.proto"; * stored internally until the expiration time, at which time it is truly and permanently deleted. * Until that time, it can be undeleted by the Hedera administrative multisignature. When a smart * contract is deleted, the cryptocurrency account within it continues to exist, and is not affected - * by the expiration time here. + * by the expiration time here. */ message SystemDeleteTransactionBody { oneof id { diff --git a/sdk/src/main/proto/system_undelete.proto b/sdk/src/main/proto/system_undelete.proto index 4eab2349a3..c4ea24e778 100644 --- a/sdk/src/main/proto/system_undelete.proto +++ b/sdk/src/main/proto/system_undelete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -30,7 +30,7 @@ import "basic_types.proto"; /** * Undelete a file or smart contract that was deleted by SystemDelete; requires a Hedera - * administrative multisignature. + * administrative multisignature. */ message SystemUndeleteTransactionBody { oneof id { diff --git a/sdk/src/main/proto/throttle_definitions.proto b/sdk/src/main/proto/throttle_definitions.proto index 4be3aef644..2917919120 100644 --- a/sdk/src/main/proto/throttle_definitions.proto +++ b/sdk/src/main/proto/throttle_definitions.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -77,9 +77,9 @@ message ThrottleBucket { * A list of throttle buckets which, simultaneously enforced, define the system's throttling policy. *
    *
  1. When an operation appears in more than one throttling bucket, all its buckets must have room - * or it will be throttled.
  2. + * or it will be throttled. *
  3. An operation assigned to no buckets is always throttled.
  4. - *
+ * */ message ThrottleDefinitions { repeated ThrottleBucket throttleBuckets = 1; diff --git a/sdk/src/main/proto/throttle_usage_snapshots.proto b/sdk/src/main/proto/throttle_usage_snapshots.proto index b325b6b269..71187dd74d 100644 --- a/sdk/src/main/proto/throttle_usage_snapshots.proto +++ b/sdk/src/main/proto/throttle_usage_snapshots.proto @@ -24,7 +24,7 @@ package proto; import "timestamp.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/timestamp.proto b/sdk/src/main/proto/timestamp.proto index 0ca2798a7d..7e612b8cdc 100644 --- a/sdk/src/main/proto/timestamp.proto +++ b/sdk/src/main/proto/timestamp.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token.proto b/sdk/src/main/proto/token.proto index 78a6c60a98..f3cc2fe757 100644 --- a/sdk/src/main/proto/token.proto +++ b/sdk/src/main/proto/token.proto @@ -25,7 +25,7 @@ package proto; import "basic_types.proto"; import "custom_fees.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_airdrop.proto b/sdk/src/main/proto/token_airdrop.proto index cef39a2850..88a2851634 100644 --- a/sdk/src/main/proto/token_airdrop.proto +++ b/sdk/src/main/proto/token_airdrop.proto @@ -30,7 +30,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_associate.proto b/sdk/src/main/proto/token_associate.proto index b1438b01a7..ae763bb4e2 100644 --- a/sdk/src/main/proto/token_associate.proto +++ b/sdk/src/main/proto/token_associate.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_burn.proto b/sdk/src/main/proto/token_burn.proto index fba56c492a..7c0f1c0dc6 100644 --- a/sdk/src/main/proto/token_burn.proto +++ b/sdk/src/main/proto/token_burn.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -36,7 +36,7 @@ import "basic_types.proto"; * Token A has 2 decimals. In order to burn 100 tokens, one must provide amount of 10000. In order * to burn 100.55 tokens, one must provide amount of 10055. * For non fungible tokens the transaction body accepts serialNumbers list of integers as a parameter. - * + * * If the serialNumbers don't get filled for non-fungible token type, a INVALID_TOKEN_BURN_AMOUNT response * code will be returned. * If a zero amount is provided for a fungible token type, it will be treated as a regular transaction. diff --git a/sdk/src/main/proto/token_cancel_airdrop.proto b/sdk/src/main/proto/token_cancel_airdrop.proto index 074aee7eee..34bbb319f9 100644 --- a/sdk/src/main/proto/token_cancel_airdrop.proto +++ b/sdk/src/main/proto/token_cancel_airdrop.proto @@ -28,7 +28,7 @@ package proto; * */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_claim_airdrop.proto b/sdk/src/main/proto/token_claim_airdrop.proto index 2d89789c4a..e331b66621 100644 --- a/sdk/src/main/proto/token_claim_airdrop.proto +++ b/sdk/src/main/proto/token_claim_airdrop.proto @@ -28,7 +28,7 @@ package proto; * */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_create.proto b/sdk/src/main/proto/token_create.proto index e10be8c3b4..47f97f9cad 100644 --- a/sdk/src/main/proto/token_create.proto +++ b/sdk/src/main/proto/token_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -36,51 +36,51 @@ import "timestamp.proto"; * The specified Treasury Account is receiving the initial supply of tokens as-well as the tokens * from the Token Mint operation once executed. The balance of the treasury account is decreased * when the Token Burn operation is executed. - * + * * The initialSupply is the initial supply of the smallest parts of a token (like a * tinybar, not an hbar). These are the smallest units of the token which may be transferred. - * + * * The supply can change over time. If the total supply at some moment is S parts of tokens, * and the token is using D decimals, then S must be less than or equal to * 263-1, which is 9,223,372,036,854,775,807. The number of whole tokens (not parts) will * be S / 10D. - * + * * If decimals is 8 or 11, then the number of whole tokens can be at most a few billions or * millions, respectively. For example, it could match Bitcoin (21 million whole tokens with 8 * decimals) or hbars (50 billion whole tokens with 8 decimals). It could even match Bitcoin with * milli-satoshis (21 million whole tokens with 11 decimals). - * + * * Note that a created token is immutable if the adminKey is omitted. No property of * an immutable token can ever change, with the sole exception of its expiry. Anyone can pay to * extend the expiry time of an immutable token. - * + * * A token can be either FUNGIBLE_COMMON or NON_FUNGIBLE_UNIQUE, based on its * TokenType. If it has been omitted, FUNGIBLE_COMMON type is used. - * + * * A token can have either INFINITE or FINITE supply type, based on its * TokenType. If it has been omitted, INFINITE type is used. - * + * * If a FUNGIBLE TokenType is used, initialSupply should explicitly be set to a * non-negative. If not, the transaction will resolve to INVALID_TOKEN_INITIAL_SUPPLY. - * + * * If a NON_FUNGIBLE_UNIQUE TokenType is used, initialSupply should explicitly be set * to 0. If not, the transaction will resolve to INVALID_TOKEN_INITIAL_SUPPLY. - * + * * If an INFINITE TokenSupplyType is used, maxSupply should explicitly be set to 0. If * it is not 0, the transaction will resolve to INVALID_TOKEN_MAX_SUPPLY. - * + * * If a FINITE TokenSupplyType is used, maxSupply should be explicitly set to a * non-negative value. If it is not, the transaction will resolve to INVALID_TOKEN_MAX_SUPPLY. */ message TokenCreateTransactionBody { /** - * The publicly visible name of the token. The token name is specified as a Unicode string. + * The publicly visible name of the token. The token name is specified as a Unicode string. * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). */ string name = 1; /** - * The publicly visible token symbol. The token symbol is specified as a Unicode string. + * The publicly visible token symbol. The token symbol is specified as a Unicode string. * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). */ string symbol = 2; diff --git a/sdk/src/main/proto/token_delete.proto b/sdk/src/main/proto/token_delete.proto index 2f6f443f3a..2bf5c3ae58 100644 --- a/sdk/src/main/proto/token_delete.proto +++ b/sdk/src/main/proto/token_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_dissociate.proto b/sdk/src/main/proto/token_dissociate.proto index d51043091e..f10359f4c5 100644 --- a/sdk/src/main/proto/token_dissociate.proto +++ b/sdk/src/main/proto/token_dissociate.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_fee_schedule_update.proto b/sdk/src/main/proto/token_fee_schedule_update.proto index 64ed137398..71d6e42883 100644 --- a/sdk/src/main/proto/token_fee_schedule_update.proto +++ b/sdk/src/main/proto/token_fee_schedule_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -30,13 +30,13 @@ import "basic_types.proto"; import "custom_fees.proto"; /** - * At consensus, updates a token type's fee schedule to the given list of custom fees. - * + * At consensus, updates a token type's fee schedule to the given list of custom fees. + * * If the target token type has no fee_schedule_key, resolves to TOKEN_HAS_NO_FEE_SCHEDULE_KEY. - * Otherwise this transaction must be signed to the fee_schedule_key, or the transaction will + * Otherwise this transaction must be signed to the fee_schedule_key, or the transaction will * resolve to INVALID_SIGNATURE. - * - * If the custom_fees list is empty, clears the fee schedule or resolves to + * + * If the custom_fees list is empty, clears the fee schedule or resolves to * CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES if the fee schedule was already empty. */ message TokenFeeScheduleUpdateTransactionBody { diff --git a/sdk/src/main/proto/token_freeze_account.proto b/sdk/src/main/proto/token_freeze_account.proto index b25d64230a..47afe04dcb 100644 --- a/sdk/src/main/proto/token_freeze_account.proto +++ b/sdk/src/main/proto/token_freeze_account.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_get_account_nft_infos.proto b/sdk/src/main/proto/token_get_account_nft_infos.proto index 3a22091bcc..6131985589 100644 --- a/sdk/src/main/proto/token_get_account_nft_infos.proto +++ b/sdk/src/main/proto/token_get_account_nft_infos.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_get_info.proto b/sdk/src/main/proto/token_get_info.proto index 9eb7bd7c9e..d867ab6ab8 100644 --- a/sdk/src/main/proto/token_get_info.proto +++ b/sdk/src/main/proto/token_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -195,7 +195,7 @@ message TokenInfo { TokenPauseStatus pause_status = 25; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 26; diff --git a/sdk/src/main/proto/token_get_nft_info.proto b/sdk/src/main/proto/token_get_nft_info.proto index b81c323a1d..6daa850485 100644 --- a/sdk/src/main/proto/token_get_nft_info.proto +++ b/sdk/src/main/proto/token_get_nft_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -73,7 +73,7 @@ message TokenNftInfo { bytes metadata = 4; /** - * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. + * The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. */ bytes ledger_id = 5; diff --git a/sdk/src/main/proto/token_get_nft_infos.proto b/sdk/src/main/proto/token_get_nft_infos.proto index 7c782abcd7..09e3df18f1 100644 --- a/sdk/src/main/proto/token_get_nft_infos.proto +++ b/sdk/src/main/proto/token_get_nft_infos.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_grant_kyc.proto b/sdk/src/main/proto/token_grant_kyc.proto index a45d4d109e..b82410f3f3 100644 --- a/sdk/src/main/proto/token_grant_kyc.proto +++ b/sdk/src/main/proto/token_grant_kyc.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_mint.proto b/sdk/src/main/proto/token_mint.proto index bd2c499e7c..0dd38f7057 100644 --- a/sdk/src/main/proto/token_mint.proto +++ b/sdk/src/main/proto/token_mint.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_pause.proto b/sdk/src/main/proto/token_pause.proto index 261b913b65..905a9c4b12 100644 --- a/sdk/src/main/proto/token_pause.proto +++ b/sdk/src/main/proto/token_pause.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -42,4 +42,4 @@ message TokenPauseTransactionBody { * The token to be paused. */ TokenID token = 1; -} \ No newline at end of file +} diff --git a/sdk/src/main/proto/token_reject.proto b/sdk/src/main/proto/token_reject.proto index d90f0051c6..246467ce24 100644 --- a/sdk/src/main/proto/token_reject.proto +++ b/sdk/src/main/proto/token_reject.proto @@ -32,7 +32,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_relation.proto b/sdk/src/main/proto/token_relation.proto index aa594d92de..cc37239877 100644 --- a/sdk/src/main/proto/token_relation.proto +++ b/sdk/src/main/proto/token_relation.proto @@ -24,7 +24,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** diff --git a/sdk/src/main/proto/token_revoke_kyc.proto b/sdk/src/main/proto/token_revoke_kyc.proto index 5cb3bd0993..b207c0e6b0 100644 --- a/sdk/src/main/proto/token_revoke_kyc.proto +++ b/sdk/src/main/proto/token_revoke_kyc.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; option java_multiple_files = true; // <<>> This comment is special code for setting PBJ Compiler java package diff --git a/sdk/src/main/proto/token_service.proto b/sdk/src/main/proto/token_service.proto index 65e30c9eca..a1177ce99e 100644 --- a/sdk/src/main/proto/token_service.proto +++ b/sdk/src/main/proto/token_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/token_unfreeze_account.proto b/sdk/src/main/proto/token_unfreeze_account.proto index d490d128fd..e0cd170c4a 100644 --- a/sdk/src/main/proto/token_unfreeze_account.proto +++ b/sdk/src/main/proto/token_unfreeze_account.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_unpause.proto b/sdk/src/main/proto/token_unpause.proto index e8107f82e8..6954815b4b 100644 --- a/sdk/src/main/proto/token_unpause.proto +++ b/sdk/src/main/proto/token_unpause.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -41,4 +41,4 @@ message TokenUnpauseTransactionBody { * The token to be unpaused. */ TokenID token = 1; -} \ No newline at end of file +} diff --git a/sdk/src/main/proto/token_update.proto b/sdk/src/main/proto/token_update.proto index 9974b403ae..8e528d61a3 100644 --- a/sdk/src/main/proto/token_update.proto +++ b/sdk/src/main/proto/token_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -33,11 +33,11 @@ import "google/protobuf/wrappers.proto"; /** * At consensus, updates an already created token to the given values. - * + * * If no value is given for a field, that field is left unchanged. For an immutable tokens (that is, * a token without an admin key), only the expiry may be updated. Setting any other field in that * case will cause the transaction status to resolve to TOKEN_IS_IMMUTABLE. - * + * * --- Signing Requirements --- * 1. Whether or not a token has an admin key, its expiry can be extended with only the transaction * payer's signature. @@ -47,7 +47,7 @@ import "google/protobuf/wrappers.proto"; * token to become immutable. (Other Key structures without a constituent * Ed25519 key will be rejected with INVALID_ADMIN_KEY.) * 4. If a new treasury is set, the new treasury account's key must sign the transaction. - * + * * --- Nft Requirements --- * 1. If a non fungible token has a positive treasury balance, the operation will abort with * CURRENT_TREASURY_STILL_OWNS_NFTS. @@ -59,13 +59,13 @@ message TokenUpdateTransactionBody { TokenID token = 1; /** - * The new publicly visible token symbol. The token symbol is specified as a Unicode string. + * The new publicly visible token symbol. The token symbol is specified as a Unicode string. * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). */ string symbol = 2; /** - * The new publicly visible name of the token. The token name is specified as a Unicode string. + * The new publicly visible name of the token. The token name is specified as a Unicode string. * Its UTF-8 encoding cannot exceed 100 bytes, and cannot contain the 0 byte (NUL). */ string name = 3; diff --git a/sdk/src/main/proto/token_update_nfts.proto b/sdk/src/main/proto/token_update_nfts.proto index a5ede209c0..42d557cdd0 100644 --- a/sdk/src/main/proto/token_update_nfts.proto +++ b/sdk/src/main/proto/token_update_nfts.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_wipe_account.proto b/sdk/src/main/proto/token_wipe_account.proto index a46c1dab61..8ad292a11c 100644 --- a/sdk/src/main/proto/token_wipe_account.proto +++ b/sdk/src/main/proto/token_wipe_account.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -42,7 +42,7 @@ import "basic_types.proto"; * CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT * On success, tokens are removed from the account and the total supply of the token is decreased by * the wiped amount. - * + * * If both amount and serialNumbers get filled, a INVALID_TRANSACTION_BODY response code will be * returned. * If the serialNumbers don't get filled for a non-fungible token type, a INVALID_WIPING_AMOUNT response @@ -52,7 +52,7 @@ import "basic_types.proto"; * response code will be returned. * If the serialNumbers' list count is greater than the batch size limit global dynamic property, a * BATCH_SIZE_LIMIT_EXCEEDED response code will be returned. - * + * * The amount provided is in the lowest denomination possible. Example: * Token A has 2 decimals. In order to wipe 100 tokens from account, one must provide amount of * 10000. In order to wipe 100.55 tokens, one must provide amount of 10055. diff --git a/sdk/src/main/proto/topic.proto b/sdk/src/main/proto/topic.proto index 8015ce7e4d..5340f9023e 100644 --- a/sdk/src/main/proto/topic.proto +++ b/sdk/src/main/proto/topic.proto @@ -24,25 +24,25 @@ package proto; import "basic_types.proto"; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** * Representation of a Hedera Consensus Service topic in the network Merkle tree. - * - * As with all network entities, a topic has a unique entity number, which is usually given along + * + * As with all network entities, a topic has a unique entity number, which is usually given along * with the network's shard and realm in the form of a shard.realm.number id. - * + * * A topic consists of just two pieces of data: * 1. The total number of messages sent to the topic; and, * 2. The running hash of all those messages. * It also has several metadata elements: * 1. A consensus expiration time in seconds since the epoch. - * 2. (Optional) The number of an auto-renew account, in the same shard and realm as the topic, that - * has signed a transaction allowing the network to use its balance to automatically extend the topic's + * 2. (Optional) The number of an auto-renew account, in the same shard and realm as the topic, that + * has signed a transaction allowing the network to use its balance to automatically extend the topic's * expiration time when it passes. - * 3. The number of seconds the network should automatically extend the topic's expiration by, if the + * 3. The number of seconds the network should automatically extend the topic's expiration by, if the * topic has a valid auto-renew account, and is not deleted upon expiration. * 4. A boolean marking if the topic has been deleted. * 5. A memo string whose UTF-8 encoding is at most 100 bytes. @@ -63,7 +63,7 @@ message Topic { */ int64 expiration_second = 3; /** - * The number of seconds for which the topic will be automatically renewed + * The number of seconds for which the topic will be automatically renewed * upon expiring (if it has a valid auto-renew account). */ int64 auto_renew_period = 4; @@ -80,7 +80,7 @@ message Topic { * When a topic is created, its running hash is initialized to 48 bytes of binary zeros. * For each submitted message, the topic's running hash is then updated to the output * of a particular SHA-384 digest whose input data include the previous running hash. - * + * * See the TransactionReceipt.proto documentation for an exact description of the * data included in the SHA-384 digest used for the update. */ diff --git a/sdk/src/main/proto/transaction.proto b/sdk/src/main/proto/transaction.proto index 2f285f393c..5e2adc7b2c 100644 --- a/sdk/src/main/proto/transaction.proto +++ b/sdk/src/main/proto/transaction.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -35,7 +35,7 @@ import "transaction_body.proto"; * appear in the transaction. For example, a CryptoTransfer will first have a Signature * corresponding to the Key for the paying account, followed by a Signature corresponding to the Key * for each account that is sending or receiving cryptocurrency in the transfer. Each Transaction - * should not have more than 50 levels. + * should not have more than 50 levels. * The SignatureList field is deprecated and succeeded by SignatureMap. */ message Transaction { @@ -49,12 +49,12 @@ message Transaction { * SignatureMap field */ SignatureList sigs = 2 [deprecated = true]; - + /** * The signatures on the body with the new format, to authorize the transaction */ SignatureMap sigMap = 3 [deprecated = true]; - + /** * TransactionBody serialized into bytes, which needs to be signed */ diff --git a/sdk/src/main/proto/transaction_body.proto b/sdk/src/main/proto/transaction_body.proto index 24f4eb3e5e..cc7feb701e 100644 --- a/sdk/src/main/proto/transaction_body.proto +++ b/sdk/src/main/proto/transaction_body.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_contents.proto b/sdk/src/main/proto/transaction_contents.proto index 01f2912216..76826ef792 100644 --- a/sdk/src/main/proto/transaction_contents.proto +++ b/sdk/src/main/proto/transaction_contents.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_get_fast_record.proto b/sdk/src/main/proto/transaction_get_fast_record.proto index 49c0e49f83..bea0e79c93 100644 --- a/sdk/src/main/proto/transaction_get_fast_record.proto +++ b/sdk/src/main/proto/transaction_get_fast_record.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_get_receipt.proto b/sdk/src/main/proto/transaction_get_receipt.proto index a38c5b74eb..7a469aab66 100644 --- a/sdk/src/main/proto/transaction_get_receipt.proto +++ b/sdk/src/main/proto/transaction_get_receipt.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -60,8 +60,8 @@ message TransactionGetReceiptQuery { bool includeDuplicates = 3; /** - * Whether the response should include the receipts of any child transactions spawned by the - * top-level transaction with the given transactionID. + * Whether the response should include the receipts of any child transactions spawned by the + * top-level transaction with the given transactionID. */ bool include_child_receipts = 4; } @@ -94,7 +94,7 @@ message TransactionGetReceiptResponse { repeated TransactionReceipt duplicateTransactionReceipts = 4; /** - * The receipts (if any) of all child transactions spawned by the transaction with the + * The receipts (if any) of all child transactions spawned by the transaction with the * given top-level id, in consensus order. Always empty if the top-level status is UNKNOWN. */ repeated TransactionReceipt child_transaction_receipts = 5; diff --git a/sdk/src/main/proto/transaction_get_record.proto b/sdk/src/main/proto/transaction_get_record.proto index 8f17b99449..8f53e5956a 100644 --- a/sdk/src/main/proto/transaction_get_record.proto +++ b/sdk/src/main/proto/transaction_get_record.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -62,8 +62,8 @@ message TransactionGetRecordQuery { bool includeDuplicates = 3; /** - * Whether the response should include the records of any child transactions spawned by the - * top-level transaction with the given transactionID. + * Whether the response should include the records of any child transactions spawned by the + * top-level transaction with the given transactionID. */ bool include_child_records = 4; } @@ -93,7 +93,7 @@ message TransactionGetRecordResponse { repeated TransactionRecord duplicateTransactionRecords = 4; /** - * The records of processing all child transaction spawned by the transaction with the given + * The records of processing all child transaction spawned by the transaction with the given * top-level id, in consensus order. Always empty if the top-level status is UNKNOWN. */ repeated TransactionRecord child_transaction_records = 5; diff --git a/sdk/src/main/proto/transaction_list.proto b/sdk/src/main/proto/transaction_list.proto index 91e1727407..f0bf8fb85f 100644 --- a/sdk/src/main/proto/transaction_list.proto +++ b/sdk/src/main/proto/transaction_list.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package proto; -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; option java_multiple_files = true; import "transaction.proto"; diff --git a/sdk/src/main/proto/transaction_receipt.proto b/sdk/src/main/proto/transaction_receipt.proto index 156ec6434d..6a715c650f 100644 --- a/sdk/src/main/proto/transaction_receipt.proto +++ b/sdk/src/main/proto/transaction_receipt.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_record.proto b/sdk/src/main/proto/transaction_record.proto index 87b84c1171..7222a404c0 100644 --- a/sdk/src/main/proto/transaction_record.proto +++ b/sdk/src/main/proto/transaction_record.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; @@ -120,12 +120,12 @@ message TransactionRecord { /** * In the record of a CryptoCreate transaction triggered by a user transaction with a - * (previously unused) alias, the new account's alias. + * (previously unused) alias, the new account's alias. */ bytes alias = 16; /** - * The keccak256 hash of the ethereumData. This field will only be populated for + * The keccak256 hash of the ethereumData. This field will only be populated for * EthereumTransaction. */ bytes ethereum_hash = 17; diff --git a/sdk/src/main/proto/transaction_response.proto b/sdk/src/main/proto/transaction_response.proto index 94b98db13b..fceb66b4ab 100644 --- a/sdk/src/main/proto/transaction_response.proto +++ b/sdk/src/main/proto/transaction_response.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/unchecked_submit.proto b/sdk/src/main/proto/unchecked_submit.proto index 86f3e192b7..fbc39b2168 100644 --- a/sdk/src/main/proto/unchecked_submit.proto +++ b/sdk/src/main/proto/unchecked_submit.proto @@ -22,13 +22,13 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** * Submit an arbitrary (serialized) Transaction to the network without prechecks. Requires superuser - * privileges. + * privileges. */ message UncheckedSubmitBody { /** diff --git a/sdk/src/main/proto/util_prng.proto b/sdk/src/main/proto/util_prng.proto index 11ca5d01c9..a13a6f18f8 100644 --- a/sdk/src/main/proto/util_prng.proto +++ b/sdk/src/main/proto/util_prng.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/util_service.proto b/sdk/src/main/proto/util_service.proto index c920c2869c..2c343a17ec 100644 --- a/sdk/src/main/proto/util_service.proto +++ b/sdk/src/main/proto/util_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hedera.hashgraph.sdk.proto"; +option java_package = "com.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "transaction_response.proto"; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.snap deleted file mode 100644 index 278c428dc9..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.AccountAllowanceApproveTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_approve_allowance {\n crypto_allowances {\n amount: 300000000\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n crypto_allowances {\n amount: 300000000\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n nft_allowances {\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n token_allowances {\n amount: 6\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n token_allowances {\n amount: 6\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.snap deleted file mode 100644 index e4c35c14e5..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.AccountAllowanceDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_delete_allowance {\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n serial_numbers: 789\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.snap deleted file mode 100644 index c15c62c73a..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.AccountBalanceQueryTest.shouldSerializeWithAccountId=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncryptoget_account_balance {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] - - -com.hedera.hashgraph.sdk.AccountBalanceQueryTest.shouldSerializeWithContractId=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncryptoget_account_balance {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.snap deleted file mode 100644 index dfc3daf78d..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.AccountCreateTransactionTest.shouldSerialize2=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_create_account {\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.AccountCreateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_create_account {\n alias: \"\\\\V.\\220\\376\\257\\016\\353\\323>\\247]!\\002O$\\235E\\024\\027\"\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.snap deleted file mode 100644 index a390abedf2..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.AccountDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_delete {\n delete_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.snap deleted file mode 100644 index d1bb2f2fc1..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.snap +++ /dev/null @@ -1,88 +0,0 @@ -com.hedera.hashgraph.sdk.AccountIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromBytesAlias=[ - "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromBytesAliasEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromBytesEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromSolidityAddressWith0x=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromString=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromStringWithAliasEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromStringWithAliasKey=[ - "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromStringWithChecksumOnMainnet=[ - "0.0.123-vfmkw" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromStringWithChecksumOnPreviewnet=[ - "0.0.123-ogizo" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromStringWithChecksumOnTestnet=[ - "0.0.123-esxsf" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.fromStringWithEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.toBytes=[ - "188d27" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.toBytesAlias=[ - "22221220114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.toBytesAliasEvmAddress=[ - "2214302a300506032b6570032100114e6abc371b82da" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.toBytesEvmAddress=[ - "2214302a300506032b6570032100114e6abc371b82da" -] - - -com.hedera.hashgraph.sdk.AccountIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.snap deleted file mode 100644 index bf3cb17f93..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.AccountInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncrypto_get_info {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.snap deleted file mode 100644 index 9785e76039..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.AccountRecordsQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncrypto_get_account_records {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.snap deleted file mode 100644 index d85d2964f2..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.AccountStakersQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncrypto_get_proxy_stakers {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.snap deleted file mode 100644 index c0b99c66ed..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.AccountUpdateTransactionTest.shouldSerialize2=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.AccountUpdateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.snap deleted file mode 100644 index f148579e50..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.snap +++ /dev/null @@ -1,13 +0,0 @@ -com.hedera.hashgraph.sdk.AssessedCustomFeeTest.fromProtobuf=[ - "AssessedCustomFee{amount=1, tokenId=2.3.4, feeCollectorAccountId=5.6.7, payerAccountIdList=[8.9.10, 11.12.13, 14.15.16]}" -] - - -com.hedera.hashgraph.sdk.AssessedCustomFeeTest.shouldSerialize=[ - "AssessedCustomFee{amount=201, tokenId=1.2.3, feeCollectorAccountId=4.5.6, payerAccountIdList=[0.0.1, 0.0.2, 0.0.3]}" -] - - -com.hedera.hashgraph.sdk.AssessedCustomFeeTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.AssessedCustomFee@55ba505b\namount: 1\neffective_payer_account_id {\n account_num: 10\n realm_num: 9\n shard_num: 8\n}\neffective_payer_account_id {\n account_num: 13\n realm_num: 12\n shard_num: 11\n}\neffective_payer_account_id {\n account_num: 16\n realm_num: 15\n shard_num: 14\n}\nfee_collector_account_id {\n account_num: 7\n realm_num: 6\n shard_num: 5\n}\ntoken_id {\n realm_num: 3\n shard_num: 2\n token_num: 4\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.snap deleted file mode 100644 index 3bcf495af4..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ContractByteCodeQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncontract_get_bytecode {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.snap deleted file mode 100644 index c758a8b2a7..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.ContractCallQueryTest.setFunctionParameters=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" -] - - -com.hedera.hashgraph.sdk.ContractCallQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\022J\\203\\372\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.snap deleted file mode 100644 index fb650f2133..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.ContractCreateTransactionTest.shouldSerialize2=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n gas: 0\n initcode: \"\\336\\255\\276\\357\"\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.ContractCreateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n file_i_d {\n file_num: 3003\n realm_num: 0\n shard_num: 0\n }\n gas: 0\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.snap deleted file mode 100644 index 82145335e9..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ContractDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncontract_delete_instance {\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_contract_i_d {\n contract_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.snap deleted file mode 100644 index b7dedc94a9..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ContractExecuteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncontract_call {\n amount: 1000\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\030+\\v\"\n gas: 10\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.snap deleted file mode 100644 index e1cba5d74c..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.snap +++ /dev/null @@ -1,48 +0,0 @@ -com.hedera.hashgraph.sdk.ContractIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.fromEvmAddress=[ - "1.2.98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.fromEvmAddressWith0x=[ - "1.2.98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.fromSolidityAddressWith0x=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.fromString=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.fromStringWithEvmAddress=[ - "1.2.98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.toBytes=[ - "188d27" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.toSolidityAddress2=[ - "98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hedera.hashgraph.sdk.ContractIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.snap deleted file mode 100644 index 91b0f3a930..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ContractInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncontract_get_info {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.snap deleted file mode 100644 index 678753ed9c..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.snap +++ /dev/null @@ -1,18 +0,0 @@ -com.hedera.hashgraph.sdk.ContractLogInfoTest.fromBytes=[ - "ContractLogInfo{contractId=0.0.10, bloom=626c6f6f6d, topics=[626c6f6f6d]}" -] - - -com.hedera.hashgraph.sdk.ContractLogInfoTest.fromProtobuf=[ - "ContractLogInfo{contractId=0.0.10, bloom=626c6f6f6d, topics=[626c6f6f6d]}" -] - - -com.hedera.hashgraph.sdk.ContractLogInfoTest.toBytes=[ - "0a02180a1205626c6f6f6d1a05626c6f6f6d" -] - - -com.hedera.hashgraph.sdk.ContractLogInfoTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.ContractLoginfo@cb39e330\nbloom: \"bloom\"\ncontract_i_d {\n contract_num: 10\n realm_num: 0\n shard_num: 0\n}\ntopic: \"bloom\"" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.snap deleted file mode 100644 index 614b0ac21d..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.ContractUpdateTransactionTest.shouldSerialize2=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.ContractUpdateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.snap deleted file mode 100644 index f627277a84..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.CryptoTransferTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_transfer {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n transfers {\n account_amounts {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n account_amounts {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n is_approval: true\n }\n account_amounts {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.snap deleted file mode 100644 index 01cd03c8e7..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.snap +++ /dev/null @@ -1,13 +0,0 @@ -com.hedera.hashgraph.sdk.CustomFixedFeeTest.fromProtobuf=[ - "CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=4, demoninatingTokenId=5.6.7}" -] - - -com.hedera.hashgraph.sdk.CustomFixedFeeTest.toFixedFeeProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.FixedFee@409d860\namount: 4\ndenominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n}" -] - - -com.hedera.hashgraph.sdk.CustomFixedFeeTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.CustomFee@91885f65\nfixed_fee {\n amount: 4\n denominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.snap deleted file mode 100644 index ab84b8b03f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.CustomFractionalFeeTest.fromProtobuf=[ - "CustomFractionalFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, numerator=4, denominator=5, min=6, max=7, assessmentMethod=EXCLUSIVE}" -] - - -com.hedera.hashgraph.sdk.CustomFractionalFeeTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.CustomFee@b2abef2c\nfractional_fee {\n fractional_amount {\n denominator: 5\n numerator: 4\n }\n maximum_amount: 7\n minimum_amount: 6\n net_of_transfers: true\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.snap deleted file mode 100644 index d4dd2ec935..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.CustomRoyaltyFeeTest.fromProtobuf=[ - "CustomRoyaltyFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, numerator=4, denominator=5, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=6, demoninatingTokenId=null}}" -] - - -com.hedera.hashgraph.sdk.CustomRoyaltyFeeTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.CustomFee@1abe2492\nroyalty_fee {\n exchange_value_fraction {\n denominator: 5\n numerator: 4\n }\n fallback_fee {\n amount: 6\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.snap deleted file mode 100644 index e166fe4141..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.snap +++ /dev/null @@ -1,28 +0,0 @@ -com.hedera.hashgraph.sdk.DelegateContractIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.DelegateContractIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.DelegateContractIdTest.fromSolidityAddressWith0x=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.DelegateContractIdTest.fromString=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.DelegateContractIdTest.toBytes=[ - "188d27" -] - - -com.hedera.hashgraph.sdk.DelegateContractIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.snap deleted file mode 100644 index e1076942f7..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.EthereumTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nethereum_transaction {\n call_data {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n ethereum_data: \"\\336\\255\\276\\357\"\n max_gas_allowance: 300000000\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.snap deleted file mode 100644 index 6708bb14bd..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.snap +++ /dev/null @@ -1,23 +0,0 @@ -com.hedera.hashgraph.sdk.FileAppendTransactionTest.shouldGetAllSignatures=[ - "[{0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=40d079bcb4a9fbdf102051328ee5f3903e166c1dd7c1e748efc95a2fdd640e421c0a8e23709b61e4d8110451adecd71cd16d1293ce0e57ea974de5b6b2ef070e, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=0cbdeaac11d392081289fb67a93a7fd995e86f55764e45b3e5eefd2f64056a38b50e8478e64cb1af5c310c321478e09b60d641a6e898820625d2674dc54ce80e, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=1490ad50f0fb5af40ee1d823e4f4b2603c135b3c7979b1b0ee6a323ba494e0b5cca833157c1106b976c876b060249e7ee2db30a8566d8682a42fac2f5f4a3406, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=23a657e362da4b3ea29673c26d8b17b967c53528449d99b3154e1b81676dc8d0aa229b824f9e613803b3262bc9cecc6dc6e2fc01a21830fb1641b5ed03722e07, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=4b4ed404ef9a37752c070c5eb364b0df0fbe06afb0b64e0743d27767c26b1045e8532308288e2f1a40cced0782b87f20b6cfdcd8b9890c600c0e2146a48ace00, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=95444670cecb07fc452a4e3f350eca481e5462e3349a6741cd4e6746b21c66e67825c169f3b4cf82ab1853f1cf0acedc84b2f565346dc173a93f054c19966b08, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=ce2b975f698ca802721c80a3792fca39d73609afaa8961bb91da569463c50eecb07d7e26e7e8febb5163474139e94533e8eb7016e0c149e0823d7102ed2b0502, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=ea31e49f64fd41773561f81459a2381e0194788853e28ffb683caded7a675d386b2a228c67ec83bfc448f14ee4fd2eae41569f06006c515621e1f26514c9bf0a, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=0aedd8f92e68278823397cb0eddc1c07f1fd80c223781280a0ffb0eef21b516444e4521294ad380e8a46c7f22f1723eef8872ccf4d8aa415345e0a7fe1485c06, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=8cf7f0ae116557d5f4a5bbee82dee3cfe950c0ecedbce5d2a7b729dd7614d47c436e6951c401870f85dadd696160ecee1ab8e65aa607ca942051e78b8f09a406, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=47c3e240259603f3e7fa41ced3eb9931bc4350367aa6529994c048fb0aca1853630bf8fbbdf9b2768c52b91b5f5d669a4adab06ef0851107f6e8012d948ba90b, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=d1a4d3349a1bc7cd0242e09ed9b1811ea99fb6123826b946651ee8c9dd593eb40591697fad4360e3941c9eea55cd2173189df349aa16b9a11db62ed28de8ad06, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=aa009ad11594bb981504f8d4063c9d90bfb0bccc4bda8f9e3ffd326fc39e599fae94ba98110342a449437f7c848e2a9dd6de0d008e8d00c8387ff094c93c2700, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=5a2b40589f128f3bac99649d0aec7230e3c993130f36814c742ae37104e93d22e2b548d97e471f583d1c81bbcf6f916cc03f20375499e3a37b2c6b13a5a94507, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=63800201fd378e81946c73104907b0b0aa70ff5913889b21b4eac730e535f8acbf08f63da5824419fc14155d6fc19f23a53bfd3324d8baa68dc5d00e8974de07, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=084bdc8f8580a2ebcc0a5140f766aca111b5488092a41871d104834dda27d6b99288423835bc7114860ce6c740300ebe9f8ab576e7646097eee7d6692b90d109, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=645d9d66e90a104462741e2f49fe77d2edce5d49a033c9c51768a2fba6deda96a71ad95e00416bb5a8a07cfaf543a1fee8730c11af4a380d6f30ec88d2271c0d, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=2bc0f7e72aa2e953741815ac95135e50ece67543683e6da3a26bc95534d9ca538d802d567fcb154bf98001663dc46d8674ff4e9361021fbe2a55e83f9442f802, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=e83759154409ce22146e31ff826a3ee4940916784e5953c4c0502ef5c2f9e7ca2d114223c3461a491dfebdcc11e511e91400007a1dc3827b7b98c7225239460f, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=595653b3f5cedf84e845f0dc2c503aad94b259eee4c10ad32cd86976b246cd81726ae8edc35e41e9ebae9e27a3ed96aff524b9b04481fad2722fdab8a4ee5a0f, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=dea30ba3201c32f5c23afac9d5b013c4e41a30d08205d21a09722f5aebb0760b2452ba254eea5008de68411560081e94ccd78c5008353aa6bb64779e79078702, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=903762ba6159fcf940281d810a268980cdf2fa35683626d52e41ad18202492fef5f8de2002c49cb56ac9d9e78177823f1f97741634237943459c31540f801502, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=c463b37297427a620f739b3a420512f897745a8451315de360391b2f6879e644ba3a8597e4f6e3a1a135bf354bb0911fe421e0174f48b650f54e3fe86247e507, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=342e41dbd4e3ef300192767ffeb9b062b1fae68027153a84f151fdb1d3ce43592f275d87a7b90a9d6db6a67d32c6ec9e585ce199ed199cdcac0b4ef4ac12200f, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=9e4dcb75574c75c7e54cc76ff08bf9e6c28cb2e74f79eb4ed8e4f968e6829bd994d9fadff9fb265988de757b858e4921c7b4db119c31f6156a79eb62ffc4110c, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=195fdc0b4c9730139ede43d8e80befe7bef91ab8fa2f271173bab926cff2c797117a28716112b6d1ab3b6c669a4b923f5885b40f67885b1a64d0445ad75bbe0e, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=0e3e02a08fd3a807c79c1ce2117612c2902557aa7c57da2494744f45b105f3f67b9977564f83baf2cd7dd4fe2cf0421f9367343a92d90199e97f22bc977f3d0f, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=a9ef610d944c989424477a2e31b970033bffcce8899116820f9eac06f2d06226cfe714e6a835135e2fb632dda80b439199e76870156acd6f81d4c3cf342a3706, }, }, ]" -] - - -com.hedera.hashgraph.sdk.FileAppendTransactionTest.shouldGetSignatures=[ - "{0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=a762395ad7e3fa298ed990785699133ca64d11a28fb4dfc83d6d95a9a2639b688d5afc288fcdb8168f4a85876b2b785e3303ddec38666bbae4f5436d6334540b, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=8bea3d52ad5badc4ebf5e20f874cf2e5dec3189d3a471c39fd1062743ba7729de1c484f1e8ac2f15343494799e97b5ac220734a261994d91ffed9e113c09d700, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=4b8fd70342b6c201f08177de53122be909d5d72f97d29fba69e7ac6ef04d96b19ac417c9b84fbb122bce9c8323bc38bd6165b5750ce16ee4a2f23e28d7123006, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=371b502056cbf34c1bd7f9891e82c7a53ab8d92ce1728f790acc9a09989196fbf4c1c111ca010a19f1af82f2480be92229b5a1aadfe4af9142bd212254c88b08, }, }" -] - - -com.hedera.hashgraph.sdk.FileAppendTransactionTest.shouldHash=[ - "[{0.0.555=d2f10044785bb7ecbfc024a171b28ec877a123a2b6f3b2a48db5595208ea8bd036e4c4babb682d87e06ce62d7c2b1bb3, 0.0.444=38603d6b2a449030ea49b7cbd7e19cd66b4e3f2891ca40df861b4840418cb08575b7ce25426b1192545d352a89f0f3da, }, {0.0.555=74ed3e44b14e41ad5964a52adde1c32932b9dd75f589d0985504bbc483dc778493866ae879769d693e2a6fa80c6a118c, 0.0.444=0939a5cbfb9bbbd545d3e9f961e7fc3bcbf49553ce7e3a00414b5b0964ca9aae0ea878e280efa217503aed65d1057880, }, {0.0.555=9ef69da0531b3828cfc5b14cb5df373ae46922ad192df9d488684b845ce4754b2a20c1e966d2835ea178890fdaac9a00, 0.0.444=1332b1dfb679ea2a91b21de2bed0d086c5139893fce55b0471e2b08ec2e0fbbcee48783eda0a1e876ee0a7086416c26a, }, {0.0.555=e62ca0554d6e40461dbecc035165d35716d61eae59a305414a91a6fb85f36ba3adc1f6b963c429366485fe514407d294, 0.0.444=2deb2d9674c3e238c53080ad4d139f172dc907ba4b898210ed9359f3db92f0880503cca4fec35cd6b47c71ba5dd46aa3, }, {0.0.555=8a7721e7a8d8eede13e0ab5adb5c9520af6099c909592f45f9dc89775f69e16a2bea4a392480f1b750c817787a94099f, 0.0.444=dbb52ed2eea79c5cc58bb0b898ce03f4ee7d4ba6ad94c0d718c0c6b46fd8cea9e2ab76c42221fce44933827e382df57f, }, {0.0.555=0292097e1f3bdd4390134f10b51b2c9928fcfbe4fd54de25d407ee8b93c6ede6dda4c4263786d983de47413f541834e0, 0.0.444=16c12a7acaa5754a1e1adfc40550e5d4b09195c2347dc4fda3882d7a2823dd212ea1682642f211290b8985d45be55a0b, }, {0.0.555=e4c53e598718933cc67491218c478c23be4637e9d89107a3c1699f04143c421fd6bf5f2ff11d31ea646103cd7cd00b57, 0.0.444=5571dfcd8a279d4c33c0e9199c865556ab3aec478ddbc1560dd9c41c53423decb95348fb54b63cbc744fd1e496b2a01f, }, ]" -] - - -com.hedera.hashgraph.sdk.FileAppendTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nfile_append {\n contents: \"\\001\\002\\003\\004\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.FileAppendTransactionTest.shouldSerializeBigContents=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nfile_append {\n contents: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\\n\\nSuspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\\n\\nNunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\\n\\nInteger pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\\n\\nPellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\\n\\nCras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\\n\\nUt interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\\n\\nAenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\\n\\nPellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\\n\\nIn hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\\n\\nVivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\\n\\nDonec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\\n\\nFusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\\n\\nNunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\\n\\nDuis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\\n\\nMauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\\n\\nAenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\\n\\nNunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\\n\\nMauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\\n\\nProin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\\n\\nSuspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\\n\\nIn consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nEtiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\\n\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 444\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.snap deleted file mode 100644 index 6f3eb2db24..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.FileContentsQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\nfile_get_contents {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.snap deleted file mode 100644 index f9fb981009..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.FileCreateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nfile_create {\n contents: \"\\001\\002\\003\\004\"\n expiration_time {\n seconds: 1554158728\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo: \"Hello memo\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.snap deleted file mode 100644 index ec04b923e1..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.FileDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nfile_delete {\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.snap deleted file mode 100644 index d890f711e3..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.snap +++ /dev/null @@ -1,23 +0,0 @@ -com.hedera.hashgraph.sdk.FileIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.FileIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.FileIdTest.shouldSerializeFromString=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.FileIdTest.toBytes=[ - "188d27" -] - - -com.hedera.hashgraph.sdk.FileIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.snap deleted file mode 100644 index 43916ce930..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.FileInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\nfile_get_info {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.snap deleted file mode 100644 index 572ce64a7a..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.FileUpdateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nfile_update {\n contents: \"\\001\\002\\003\\004\\005\"\n expiration_time {\n seconds: 1554158728\n }\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo {\n value: \"Hello memo\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.snap deleted file mode 100644 index ba3efc007f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.FreezeTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nfreeze {\n file_hash: \"\\027#\\220E\\207\\022\\t8\\225G\\0024\\230W\"\n freeze_type: TELEMETRY_UPGRADE\n freeze_type_value: 5\n start_time {\n seconds: 1554158542\n }\n update_file {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.snap deleted file mode 100644 index c383adc489..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.LiveHashAddTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_add_live_hash {\n live_hash {\n account_id {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 2592000\n }\n hash: \"hash\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.snap deleted file mode 100644 index 91661995c8..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.LiveHashDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\ncrypto_delete_live_hash {\n account_of_live_hash {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n live_hash_to_delete: \"hash\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.snap deleted file mode 100644 index 65fa054bb3..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.LiveHashQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ncrypto_get_live_hash {\n account_i_d {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n hash: \"\\000\\001\\002\"\n header {\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.snap deleted file mode 100644 index 379f204011..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.MessageSubmitTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nconsensus_submit_message {\n message: \"hello\"\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.snap deleted file mode 100644 index e2b1e4faf0..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.NetworkVersionInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\nnetwork_get_version_info {\n header {\n payment {\n signed_transaction_bytes: \"\\336\\255\\276\\357\"\n }\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.snap deleted file mode 100644 index e3e16ccc11..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.NetworkVersionInfoTest.shouldSerialize=[ - "com.hedera.hashgraph.sdk.NetworkVersionInfo" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.snap deleted file mode 100644 index 4a275b7e4e..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.snap +++ /dev/null @@ -1,33 +0,0 @@ -com.hedera.hashgraph.sdk.NftIdTest.fromBytes=[ - "0.0.5005/574489" -] - - -com.hedera.hashgraph.sdk.NftIdTest.fromString2=[ - "0.0.5005/1234" -] - - -com.hedera.hashgraph.sdk.NftIdTest.fromString=[ - "0.0.5005/1234" -] - - -com.hedera.hashgraph.sdk.NftIdTest.fromStringWithChecksumOnMainnet=[ - "0.0.123-vfmkw/7584" -] - - -com.hedera.hashgraph.sdk.NftIdTest.fromStringWithChecksumOnPreviewnet=[ - "0.0.123-ogizo/487302" -] - - -com.hedera.hashgraph.sdk.NftIdTest.fromStringWithChecksumOnTestnet=[ - "0.0.123-esxsf/584903" -] - - -com.hedera.hashgraph.sdk.NftIdTest.toBytes=[ - "0a03188d2710b826" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.snap deleted file mode 100644 index d8436dd0b3..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.NodeCreateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_create {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description: \"Test description\"\n gossip_ca_certificate: \"\\000\\001\\002\\003\\004\"\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash: \"\\005\\006\\a\\b\\t\"\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.snap deleted file mode 100644 index 456b6ad72c..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.NodeDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_delete {\n node_id: 420\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.snap deleted file mode 100644 index cb5159253f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.NodeUpdateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_update {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description {\n value: \"Test description\"\n }\n gossip_ca_certificate {\n value: \"\\000\\001\\002\\003\\004\"\n }\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash {\n value: \"\\005\\006\\a\\b\\t\"\n }\n node_id: 420\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.snap deleted file mode 100644 index c5a7b90f52..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.PrngTransactionTest.shouldSerialize2=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n range: 100\n}" -] - - -com.hedera.hashgraph.sdk.PrngTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.snap deleted file mode 100644 index 3b28ea5a55..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ProxyStakerTest.fromProtobuf=[ - "ProxyStaker{accountId=0.0.100, amount=10 tℏ}" -] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.snap deleted file mode 100644 index 7099d66c6c..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ScheduleCreateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_create {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n expiration_time {\n seconds: 1554158542\n }\n memo: \"hi\"\n payer_account_i_d {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n scheduled_transaction_body {\n crypto_transfer {\n transfers {\n account_amounts {\n account_i_d {\n account_num: 333\n realm_num: 0\n shard_num: 0\n }\n amount: 1000000000\n }\n account_amounts {\n account_i_d {\n account_num: 555\n realm_num: 0\n shard_num: 0\n }\n amount: -1000000000\n }\n }\n }\n transaction_fee: 100000000\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.snap deleted file mode 100644 index c655b94f5b..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ScheduleDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_delete {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.snap deleted file mode 100644 index cb5c62c8f3..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ScheduleInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\nschedule_get_info {\n header {\n }\n schedule_i_d {\n realm_num: 0\n schedule_num: 5005\n shard_num: 0\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.snap deleted file mode 100644 index 95b7607475..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.ScheduleSignTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_sign {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.snap deleted file mode 100644 index 8d9ca7512f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.SystemDeleteTransactionTest.shouldSerializeContract=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n seconds: 1554158542\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.SystemDeleteTransactionTest.shouldSerializeFile=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n expiration_time {\n seconds: 1554158542\n }\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.snap deleted file mode 100644 index 21fe849f74..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.SystemUndeleteTransactionTest.shouldSerializeContract=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.SystemUndeleteTransactionTest.shouldSerializeFile=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.snap deleted file mode 100644 index 87049b1a06..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenAirdropTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_airdrop {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n nft_transfers {\n is_approval: true\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: 123\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.snap deleted file mode 100644 index 109b1d30de..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenAssociateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_associate {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n tokens {\n realm_num: 0\n shard_num: 0\n token_num: 666\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.snap deleted file mode 100644 index f56199f654..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenAssociationTest.shouldSerializeAccount=[ - "TokenAssociation{tokenId=1.2.3, accountId=4.5.6}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.snap deleted file mode 100644 index 5ecd0f7114..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.TokenBurnTransactionTest.shouldSerializeFungible=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 69\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.TokenBurnTransactionTest.shouldSerializeNft=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 0\n serial_numbers: 420\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.snap deleted file mode 100644 index 478020d764..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenCancelAirdropTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_cancel_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.snap deleted file mode 100644 index 451ab57cd4..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenClaimAirdropTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_claim_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.snap deleted file mode 100644 index d5d7047fc6..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.TokenCreateTransactionTest.shouldSerializeFungible=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 543\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 3\n denominating_token_id {\n realm_num: 3\n shard_num: 4\n token_num: 2\n }\n }\n }\n decimals: 3\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_default: true\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 30\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 0\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.TokenCreateTransactionTest.shouldSerializeNft=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 0\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 500\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n supply_type: FINITE\n supply_type_value: 1\n symbol: \"test symbol\"\n token_type: NON_FUNGIBLE_UNIQUE\n token_type_value: 1\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.snap deleted file mode 100644 index 9408562cda..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_deletion {\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.snap deleted file mode 100644 index 8604fbddbd..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenDissociateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_dissociate {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 1\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 2\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.snap deleted file mode 100644 index efe9d1349f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenFeeScheduleUpdateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_fee_schedule_update {\n custom_fees {\n fee_collector_account_id {\n account_num: 4322\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 10\n denominating_token_id {\n realm_num: 0\n shard_num: 0\n token_num: 483902\n }\n }\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 389042\n realm_num: 0\n shard_num: 0\n }\n fractional_fee {\n fractional_amount {\n denominator: 7\n numerator: 3\n }\n maximum_amount: 100\n minimum_amount: 3\n net_of_transfers: true\n }\n }\n token_id {\n realm_num: 0\n shard_num: 0\n token_num: 8798\n }\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.snap deleted file mode 100644 index c56916ede3..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenFreezeTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_freeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.snap deleted file mode 100644 index 80980fb0bf..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenGrantKycTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_grant_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.snap deleted file mode 100644 index 91fafea344..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ntoken_get_info {\n header {\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.snap deleted file mode 100644 index deb2a4bf7f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.TokenMintTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.TokenMintTransactionTest.shouldSerializeMetadata=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 0\n metadata: \"\\001\\002\\003\\004\\005\"\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.snap deleted file mode 100644 index 3fa3c8b9f3..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenNftInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ntoken_get_nft_info {\n header {\n }\n nft_i_d {\n serial_number: 101\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 5005\n }\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.snap deleted file mode 100644 index 6f138223e4..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenPauseTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_pause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.snap deleted file mode 100644 index 56b7080ccb..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenRejectTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_reject {\n owner {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n rejections {\n fungible_token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n }\n rejections {\n fungible_token {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n rejections {\n fungible_token {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n rejections {\n nft {\n serial_number: 2\n token_i_d {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n }\n rejections {\n nft {\n serial_number: 3\n token_i_d {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.snap deleted file mode 100644 index 6c91f3c12c..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenRevokeKycTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_revoke_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.snap deleted file mode 100644 index 75332a5ce0..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.snap +++ /dev/null @@ -1,10 +0,0 @@ -com.hedera.hashgraph.sdk.TokenSupplyTypeTest.fromProtobuf=[ - "INFINITE", - "FINITE" -] - - -com.hedera.hashgraph.sdk.TokenSupplyTypeTest.toProtobuf=[ - "INFINITE", - "FINITE" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.snap deleted file mode 100644 index 88b53690cb..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.snap +++ /dev/null @@ -1,10 +0,0 @@ -com.hedera.hashgraph.sdk.TokenTypeTest.fromProtobuf=[ - "FUNGIBLE_COMMON", - "NON_FUNGIBLE_UNIQUE" -] - - -com.hedera.hashgraph.sdk.TokenTypeTest.toProtobuf=[ - "FUNGIBLE_COMMON", - "NON_FUNGIBLE_UNIQUE" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.snap deleted file mode 100644 index 82a155a75b..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenUnfreezeTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unfreeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.snap deleted file mode 100644 index 019f591a22..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenUnpauseTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unpause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.snap deleted file mode 100644 index c00b3c6139..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenUpdateNftsTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update_nfts {\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.snap deleted file mode 100644 index 59624b9b44..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TokenUpdateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n key_verification_mode: NO_VALIDATION\n key_verification_mode_value: 1\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n memo {\n value: \"test memo\"\n }\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.snap deleted file mode 100644 index 62706f6caa..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.TokenWipeTransactionTest.shouldSerializeFungible=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 4\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.TokenWipeTransactionTest.shouldSerializeNft=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 0\n serial_numbers: 444\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.snap deleted file mode 100644 index 7bdf12912f..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TopicCreateTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nconsensus_create_topic {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n memo: \"hello memo\"\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.snap deleted file mode 100644 index c27d7345f0..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TopicDeleteTransactionTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nconsensus_delete_topic {\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.snap deleted file mode 100644 index 49f033efda..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.snap +++ /dev/null @@ -1,23 +0,0 @@ -com.hedera.hashgraph.sdk.TopicIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.TopicIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.TopicIdTest.shouldSerializeFromString=[ - "0.0.5005" -] - - -com.hedera.hashgraph.sdk.TopicIdTest.toBytes=[ - "188d27" -] - - -com.hedera.hashgraph.sdk.TopicIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.snap deleted file mode 100644 index 7c658051ed..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TopicInfoQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\nconsensus_get_topic_info {\n header {\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5005\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.snap deleted file mode 100644 index bc899ce78c..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.TopicUpdateTransactionTest.clearShouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n key_list {\n }\n }\n auto_renew_account {\n account_num: 0\n realm_num: 0\n shard_num: 0\n }\n memo {\n }\n submit_key {\n key_list {\n }\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] - - -com.hedera.hashgraph.sdk.TopicUpdateTransactionTest.setShouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158542\n }\n memo {\n value: \"test memo\"\n }\n submit_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.snap deleted file mode 100644 index b6f60979bd..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hedera.hashgraph.sdk.TransactionIdTest.shouldSerialize2=[ - "0.0.23847@1588539964.632521325?scheduled/3" -] - - -com.hedera.hashgraph.sdk.TransactionIdTest.shouldSerialize=[ - "0.0.23847@1588539964.632521325" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.snap deleted file mode 100644 index f27c7718a0..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TransactionReceiptQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ntransaction_get_receipt {\n header {\n }\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.snap b/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.snap deleted file mode 100644 index 1628f83513..0000000000 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hedera.hashgraph.sdk.TransactionRecordQueryTest.shouldSerialize=[ - "# com.hedera.hashgraph.sdk.proto.Query\ntransaction_get_record {\n header {\n }\n include_child_records: true\n include_duplicates: true\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" -] \ No newline at end of file diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java b/sdk/src/test/java/com/hiero/logger/LoggerTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java rename to sdk/src/test/java/com/hiero/logger/LoggerTest.java index 84956f1306..aa3293ab3f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/logger/LoggerTest.java +++ b/sdk/src/test/java/com/hiero/logger/LoggerTest.java @@ -1,5 +1,7 @@ -package com.hedera.hashgraph.sdk.logger; +package com.hiero.logger; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java index 5d325cb878..95a5c7dbdd 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceApproveTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountAllowanceApproveTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap new file mode 100644 index 0000000000..1c14e2afdd --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.AccountAllowanceApproveTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_approve_allowance {\n crypto_allowances {\n amount: 300000000\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n crypto_allowances {\n amount: 300000000\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n nft_allowances {\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n token_allowances {\n amount: 6\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n token_allowances {\n amount: 6\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java index 44bd40cb77..552c2f5524 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountAllowanceDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteAllowanceTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountAllowanceDeleteTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap new file mode 100644 index 0000000000..26a9bb65e5 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.AccountAllowanceDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_delete_allowance {\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n serial_numbers: 789\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java similarity index 85% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java index b43763872d..ae1e587893 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountBalanceQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +41,7 @@ public static void afterAll() { @Test void shouldSerializeWithAccountId() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountBalanceQuery() .setAccountId(AccountId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); @@ -47,7 +50,7 @@ void shouldSerializeWithAccountId() { @Test void shouldSerializeWithContractId() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountBalanceQuery() .setContractId(ContractId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap new file mode 100644 index 0000000000..39f2d34f56 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.AccountBalanceQueryTest.shouldSerializeWithAccountId=[ + "# com.hiero.sdk.proto.Query\ncryptoget_account_balance {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] + + +com.hiero.sdk.AccountBalanceQueryTest.shouldSerializeWithContractId=[ + "# com.hiero.sdk.proto.Query\ncryptoget_account_balance {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java index 23f1dee89d..9da472ebb4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.CryptoCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.EvmAddress; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.CryptoCreateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap new file mode 100644 index 0000000000..fbea71371e --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.AccountCreateTransactionTest.shouldSerialize2=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_create_account {\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.AccountCreateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_create_account {\n alias: \"\\\\V.\\220\\376\\257\\016\\353\\323>\\247]!\\002O$\\235E\\024\\027\"\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java index 12148ec8b2..2ccfb051ce 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java @@ -17,10 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.CryptoDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap new file mode 100644 index 0000000000..46fd270d06 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.AccountDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_delete {\n delete_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java similarity index 98% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountIdTest.java index 12e242ebb4..a2fe15db10 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java @@ -17,9 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.BadEntityIdException; +import com.hiero.sdk.Client; +import com.hiero.sdk.EvmAddress; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap new file mode 100644 index 0000000000..289a1aa090 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap @@ -0,0 +1,88 @@ +com.hiero.sdk.AccountIdTest.fromBytes=[ + "0.0.5005" +] + + +com.hiero.sdk.AccountIdTest.fromBytesAlias=[ + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" +] + + +com.hiero.sdk.AccountIdTest.fromBytesAliasEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +com.hiero.sdk.AccountIdTest.fromBytesEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +com.hiero.sdk.AccountIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +com.hiero.sdk.AccountIdTest.fromSolidityAddressWith0x=[ + "0.0.5005" +] + + +com.hiero.sdk.AccountIdTest.fromString=[ + "0.0.5005" +] + + +com.hiero.sdk.AccountIdTest.fromStringWithAliasEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +com.hiero.sdk.AccountIdTest.fromStringWithAliasKey=[ + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" +] + + +com.hiero.sdk.AccountIdTest.fromStringWithChecksumOnMainnet=[ + "0.0.123-vfmkw" +] + + +com.hiero.sdk.AccountIdTest.fromStringWithChecksumOnPreviewnet=[ + "0.0.123-ogizo" +] + + +com.hiero.sdk.AccountIdTest.fromStringWithChecksumOnTestnet=[ + "0.0.123-esxsf" +] + + +com.hiero.sdk.AccountIdTest.fromStringWithEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +com.hiero.sdk.AccountIdTest.toBytes=[ + "188d27" +] + + +com.hiero.sdk.AccountIdTest.toBytesAlias=[ + "22221220114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" +] + + +com.hiero.sdk.AccountIdTest.toBytesAliasEvmAddress=[ + "2214302a300506032b6570032100114e6abc371b82da" +] + + +com.hiero.sdk.AccountIdTest.toBytesEvmAddress=[ + "2214302a300506032b6570032100114e6abc371b82da" +] + + +com.hiero.sdk.AccountIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java index 4a74a35283..63e03e70fc 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountInfoQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +41,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountInfoQuery() .setAccountId(AccountId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap new file mode 100644 index 0000000000..9e0c4c0e64 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.AccountInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncrypto_get_info {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java b/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java index 2500af52a5..8673a0c453 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java @@ -17,13 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoGetInfoResponse; -import com.hedera.hashgraph.sdk.proto.KeyList; -import com.hedera.hashgraph.sdk.proto.LiveHash; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountInfo; +import com.hiero.sdk.DurationConverter; +import com.hiero.sdk.InstantConverter; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.proto.CryptoGetInfoResponse; +import com.hiero.sdk.proto.KeyList; +import com.hiero.sdk.proto.LiveHash; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.snap similarity index 57% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/AccountInfoTest.snap index 11e3c7785e..40bf1c6000 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.snap @@ -1,18 +1,18 @@ -com.hedera.hashgraph.sdk.AccountInfoTest.fromBytes=[ +com.hiero.sdk.AccountInfoTest.fromBytes=[ "AccountInfo{accountId=0.0.1, contractAccountId=, deleted=true, proxyAccountId=0.0.8, proxyReceived=2 tℏ, key=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, balance=3 tℏ, sendRecordThreshold=4 tℏ, receiveRecordThreshold=5 tℏ, receiverSignatureRequired=true, expirationTime=1970-01-01T00:00:00.006Z, autoRenewPeriod=PT168H, liveHashes=[LiveHash{accountId=0.0.10, hash=[0, 1, 2], keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, duration=PT264H}], tokenRelationships={}, accountMemo=, ownedNfts=0, maxAutomaticTokenAssociations=0, aliasKey=null, ledgerId=previewnet, ethereumNonce=1001, stakingInfo=null}" ] -com.hedera.hashgraph.sdk.AccountInfoTest.fromProtobufWithOtherOptions=[ +com.hiero.sdk.AccountInfoTest.fromProtobufWithOtherOptions=[ "AccountInfo{accountId=0.0.1, contractAccountId=, deleted=true, proxyAccountId=0.0.8, proxyReceived=2 tℏ, key=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, balance=3 tℏ, sendRecordThreshold=4 tℏ, receiveRecordThreshold=5 tℏ, receiverSignatureRequired=true, expirationTime=1970-01-01T00:00:00.006Z, autoRenewPeriod=PT168H, liveHashes=[LiveHash{accountId=0.0.10, hash=[0, 1, 2], keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, duration=PT264H}], tokenRelationships={}, accountMemo=, ownedNfts=0, maxAutomaticTokenAssociations=0, aliasKey=null, ledgerId=previewnet, ethereumNonce=1001, stakingInfo=null}" ] -com.hedera.hashgraph.sdk.AccountInfoTest.toBytes=[ +com.hiero.sdk.AccountInfoTest.toBytes=[ "CgIYARgBIgIYCDACOiISIODI7CdYpYef+sImoTwMUWt5nnLjUUGg3YKPlNN5iKS3QANIBFAFWAFiBRCAm+4CagQIgPUkcjUKAhgKEgMAAQIaJAoiEiDgyOwnWKWHn/rCJqE8DFFreZ5y41FBoN2Cj5TTeYiktyoECICBOqIBAQKoAekH" ] -com.hedera.hashgraph.sdk.AccountInfoTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.CryptoGetInfoResponse$AccountInfo@57c9441\naccount_i_d {\n account_num: 1\n realm_num: 0\n shard_num: 0\n}\nauto_renew_period {\n seconds: 604800\n}\nbalance: 3\ndeleted: true\nethereum_nonce: 1001\nexpiration_time {\n nanos: 6000000\n seconds: 0\n}\ngenerate_receive_record_threshold: 5\ngenerate_send_record_threshold: 4\nkey {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n}\nledger_id: \"\\002\"\nlive_hashes {\n account_id {\n account_num: 10\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 950400\n }\n hash: \"\\000\\001\\002\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n}\nowned_nfts: 0\nproxy_account_i_d {\n account_num: 8\n realm_num: 0\n shard_num: 0\n}\nproxy_received: 2\nreceiver_sig_required: true" -] \ No newline at end of file +com.hiero.sdk.AccountInfoTest.toProtobuf=[ + "# com.hiero.sdk.proto.CryptoGetInfoResponse$AccountInfo@57c9441\naccount_i_d {\n account_num: 1\n realm_num: 0\n shard_num: 0\n}\nauto_renew_period {\n seconds: 604800\n}\nbalance: 3\ndeleted: true\nethereum_nonce: 1001\nexpiration_time {\n nanos: 6000000\n seconds: 0\n}\ngenerate_receive_record_threshold: 5\ngenerate_send_record_threshold: 4\nkey {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n}\nledger_id: \"\\002\"\nlive_hashes {\n account_id {\n account_num: 10\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 950400\n }\n hash: \"\\000\\001\\002\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n}\nowned_nfts: 0\nproxy_account_i_d {\n account_num: 8\n realm_num: 0\n shard_num: 0\n}\nproxy_received: 2\nreceiver_sig_required: true" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java index 5e2d4366e3..abe4e75501 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountRecordsQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountRecordsQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +41,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountRecordsQuery() .setAccountId(AccountId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap new file mode 100644 index 0000000000..cbc326c928 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.AccountRecordsQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncrypto_get_account_records {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java index 2015b2e3cf..e546222942 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountStakersQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountStakersQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +41,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountStakersQuery() .setAccountId(AccountId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap new file mode 100644 index 0000000000..656e9a08af --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.AccountStakersQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncrypto_get_proxy_stakers {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java index 8e6f4655d8..dc1ace2155 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AccountUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java @@ -17,10 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.CryptoUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountUpdateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.CryptoUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap new file mode 100644 index 0000000000..7688ebe677 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.AccountUpdateTransactionTest.shouldSerialize2=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.AccountUpdateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java b/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java similarity index 85% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java rename to sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java index 15b12394e4..2b05f96310 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AddressBookQueryMockTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java @@ -1,6 +1,11 @@ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.mirror.NetworkServiceGrpc; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AddressBookQuery; +import com.hiero.sdk.Client; +import com.hiero.sdk.Endpoint; +import com.hiero.sdk.FileId; +import com.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.Server; import io.grpc.Status; import io.grpc.inprocess.InProcessServerBuilder; @@ -17,7 +22,7 @@ import java.util.List; import java.util.Queue; -import static com.hedera.hashgraph.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatException; @@ -57,13 +62,13 @@ void teardown() throws Exception { @CsvSource({"sync", "async"}) void addressBookQueryWorks(String executeVersion) throws Throwable { addressBookServiceStub.requests.add( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .setLimit(3) .build() ); addressBookServiceStub.responses.add( - new com.hedera.hashgraph.sdk.NodeAddress() + new com.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .toProtobuf() ); @@ -87,12 +92,12 @@ Endpoint spawnEndpoint() { @Test void networkUpdatePeriodWorks() throws Throwable { addressBookServiceStub.requests.add( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build() ); addressBookServiceStub.responses.add( - new com.hedera.hashgraph.sdk.NodeAddress() + new com.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .setAddresses(Collections.singletonList(spawnEndpoint())) .toProtobuf() @@ -119,18 +124,18 @@ void networkUpdatePeriodWorks() throws Throwable { }) void addressBookQueryRetries(String executeVersion, Status.Code code, String description) throws Throwable { addressBookServiceStub.requests.add( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build() ); addressBookServiceStub.requests.add( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build() ); addressBookServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); addressBookServiceStub.responses.add( - new com.hedera.hashgraph.sdk.NodeAddress() + new com.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .toProtobuf() ); @@ -154,7 +159,7 @@ void addressBookQueryRetries(String executeVersion, Status.Code code, String des "async, INVALID_ARGUMENT, " }) void addressBookQueryFails(String executeVersion, Status.Code code, String description) { - addressBookServiceStub.requests.add(com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build() ); @@ -182,12 +187,12 @@ void addressBookQueryStopsAtMaxAttempts(String executeVersion, Status.Code code, addressBookQuery.setMaxAttempts(2); addressBookServiceStub.requests.add( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build() ); addressBookServiceStub.requests.add( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery.newBuilder() + com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build() ); @@ -203,13 +208,13 @@ void addressBookQueryStopsAtMaxAttempts(String executeVersion, Status.Code code, private static class AddressBookQueryStub extends NetworkServiceGrpc.NetworkServiceImplBase { - private final Queue requests = new ArrayDeque<>(); + private final Queue requests = new ArrayDeque<>(); private final Queue responses = new ArrayDeque<>(); @Override public void getNodes( - com.hedera.hashgraph.sdk.proto.mirror.AddressBookQuery addressBookQuery, - StreamObserver streamObserver + com.hiero.sdk.proto.mirror.AddressBookQuery addressBookQuery, + StreamObserver streamObserver ) { var request = requests.poll(); assertThat(request).isNotNull(); @@ -224,7 +229,7 @@ public void getNodes( return; } - streamObserver.onNext((com.hedera.hashgraph.sdk.proto.NodeAddress) response); + streamObserver.onNext((com.hiero.sdk.proto.NodeAddress) response); } streamObserver.onCompleted(); } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java b/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java rename to sdk/src/test/java/com/hiero/sdk/AllowancesTest.java index 11b2353203..9223b537fb 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java @@ -17,9 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.HbarAllowance; +import com.hiero.sdk.TokenAllowance; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenNftAllowance; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.snap b/sdk/src/test/java/com/hiero/sdk/AllowancesTest.snap similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.snap rename to sdk/src/test/java/com/hiero/sdk/AllowancesTest.snap index 6fb7137710..242a2ab5a7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AllowancesTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/AllowancesTest.snap @@ -1,6 +1,6 @@ -com.hedera.hashgraph.sdk.AllowancesTest.shouldSerialize=[ +com.hiero.sdk.AllowancesTest.shouldSerialize=[ "HbarAllowance{ownerAccountId=1.1.1, spenderAccountId=2.2.2, amount=3 ℏ}", "TokenAllowance{tokenId=1.2.3, ownerAccountId=4.5.6, spenderAccountId=5.5.5, amount=777}", "TokenNftAllowance{tokenId=1.1.1, ownerAccountId=2.2.2, spenderAccountId=3.3.3, delegatingSpender=null, serials=[123, 456]}", "TokenNftAllowance{tokenId=1.1.1, ownerAccountId=2.2.2, spenderAccountId=3.3.3, delegatingSpender=null, allSerials=true}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.java b/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.java rename to sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java index d111a21bd2..dcf1414973 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/AssessedCustomFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java @@ -1,5 +1,8 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AssessedCustomFee; +import com.hiero.sdk.TokenId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,8 +23,8 @@ public class AssessedCustomFeeTest { new AccountId(14, 15, 16) ); - private final com.hedera.hashgraph.sdk.proto.AssessedCustomFee fee = - com.hedera.hashgraph.sdk.proto.AssessedCustomFee.newBuilder() + private final com.hiero.sdk.proto.AssessedCustomFee fee = + com.hiero.sdk.proto.AssessedCustomFee.newBuilder() .setAmount(amount) .setTokenId(tokenId.toProtobuf()) .setFeeCollectorAccountId(feeCollector.toProtobuf()) diff --git a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap b/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap new file mode 100644 index 0000000000..8cda9717b8 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap @@ -0,0 +1,13 @@ +com.hiero.sdk.AssessedCustomFeeTest.fromProtobuf=[ + "AssessedCustomFee{amount=1, tokenId=2.3.4, feeCollectorAccountId=5.6.7, payerAccountIdList=[8.9.10, 11.12.13, 14.15.16]}" +] + + +com.hiero.sdk.AssessedCustomFeeTest.shouldSerialize=[ + "AssessedCustomFee{amount=201, tokenId=1.2.3, feeCollectorAccountId=4.5.6, payerAccountIdList=[0.0.1, 0.0.2, 0.0.3]}" +] + + +com.hiero.sdk.AssessedCustomFeeTest.toProtobuf=[ + "# com.hiero.sdk.proto.AssessedCustomFee@55ba505b\namount: 1\neffective_payer_account_id {\n account_num: 10\n realm_num: 9\n shard_num: 8\n}\neffective_payer_account_id {\n account_num: 13\n realm_num: 12\n shard_num: 11\n}\neffective_payer_account_id {\n account_num: 16\n realm_num: 15\n shard_num: 14\n}\nfee_collector_account_id {\n account_num: 7\n realm_num: 6\n shard_num: 5\n}\ntoken_id {\n realm_num: 3\n shard_num: 2\n token_num: 4\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/BaseNodeAddressTest.java b/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/BaseNodeAddressTest.java rename to sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java index 576e5eb630..95c015350e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/BaseNodeAddressTest.java +++ b/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java @@ -17,13 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.BaseNodeAddress; import org.junit.jupiter.api.Test; -import static com.hedera.hashgraph.sdk.BaseNodeAddress.PORT_MIRROR_TLS; -import static com.hedera.hashgraph.sdk.BaseNodeAddress.PORT_NODE_PLAIN; -import static com.hedera.hashgraph.sdk.BaseNodeAddress.PORT_NODE_TLS; +import static com.hiero.sdk.BaseNodeAddress.PORT_MIRROR_TLS; +import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_TLS; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java b/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java rename to sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java index 1751fe65f7..f4f99c4497 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientCloseTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java @@ -1,4 +1,4 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -10,6 +10,10 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.MirrorNetwork; +import com.hiero.sdk.Network; import java.time.Duration; import java.util.Collections; import java.util.HashMap; @@ -17,6 +21,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; public class ClientCloseTest { @@ -45,7 +50,7 @@ void doesNotCloseExternalExecutor() throws TimeoutException { @Test void closeHandlesNetworkTimeout() { var executor = Client.createExecutor(); - var network = mock(Network.class); + var network = Mockito.mock(Network.class); when(network.awaitClose(any(), any())).thenReturn(new TimeoutException("network timeout")); var mirrorNetwork = MirrorNetwork.forNetwork(executor, Collections.emptyList()); var client = new Client(executor, network, mirrorNetwork, null, true, null); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java b/sdk/src/test/java/com/hiero/sdk/ClientTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java rename to sdk/src/test/java/com/hiero/sdk/ClientTest.java index f46e34e706..fe244afd03 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ClientTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ClientTest.java @@ -17,8 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - +package com.hiero.sdk; + +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.NodeAddress; +import com.hiero.sdk.NodeAddressBook; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -44,7 +51,7 @@ import java.util.concurrent.TimeoutException; import java.util.function.Function; -import static com.hedera.hashgraph.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -397,12 +404,12 @@ void testExecuteSyncTimeout(String timeoutSite) throws Exception { client.close(); } - com.hedera.hashgraph.sdk.proto.NodeAddress nodeAddress(long accountNum, String rsaPubKeyHex, byte[] certHash, byte[] ipv4) { - com.hedera.hashgraph.sdk.proto.NodeAddress.Builder builder = com.hedera.hashgraph.sdk.proto.NodeAddress.newBuilder() - .setNodeAccountId(com.hedera.hashgraph.sdk.proto.AccountID.newBuilder() + com.hiero.sdk.proto.NodeAddress nodeAddress(long accountNum, String rsaPubKeyHex, byte[] certHash, byte[] ipv4) { + com.hiero.sdk.proto.NodeAddress.Builder builder = com.hiero.sdk.proto.NodeAddress.newBuilder() + .setNodeAccountId(com.hiero.sdk.proto.AccountID.newBuilder() .setAccountNum(accountNum) .build()) - .addServiceEndpoint(com.hedera.hashgraph.sdk.proto.ServiceEndpoint.newBuilder() + .addServiceEndpoint(com.hiero.sdk.proto.ServiceEndpoint.newBuilder() .setIpAddressV4(ByteString.copyFrom(ipv4)) .setPort(PORT_NODE_PLAIN) .build()) @@ -420,7 +427,7 @@ void setNetworkFromAddressBook() throws Exception { Function nodeAddress = accountNum -> client.network.network.get(new AccountId(accountNum)).get(0).getAddressBookEntry(); // reconfigure client network from addressbook (add new nodes) - client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hedera.hashgraph.sdk.proto.NodeAddressBook.newBuilder() + client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() .addNodeAddress(nodeAddress(10001, "10001", new byte[] {1, 0, 1}, new byte[] {10, 0, 0, 1})) .addNodeAddress(nodeAddress(10002, "10002", new byte[] {1, 0, 2}, new byte[] {10, 0, 0, 2})) .build().toByteString())); @@ -432,7 +439,7 @@ void setNetworkFromAddressBook() throws Exception { assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("10002"); // reconfigure client network from addressbook without `certHash` - client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hedera.hashgraph.sdk.proto.NodeAddressBook.newBuilder() + client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() .addNodeAddress(nodeAddress(10001, "10001", null, new byte[] {10, 0, 0, 1})) .addNodeAddress(nodeAddress(10002, "10002", null, new byte[] {10, 0, 0, 2})) .build().toByteString())); @@ -444,7 +451,7 @@ void setNetworkFromAddressBook() throws Exception { assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("10002"); // reconfigure client network from addressbook (update existing nodes) - client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hedera.hashgraph.sdk.proto.NodeAddressBook.newBuilder() + client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() .addNodeAddress(nodeAddress(10001, "810001", new byte[] {8, 1, 0, 1}, new byte[] {10, 0, 0, 1})) .addNodeAddress(nodeAddress(10002, "810002", new byte[] {8, 1, 0, 2}, new byte[] {10, 0, 0, 2})) .build().toByteString())); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java b/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java rename to sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java index aa279445b5..ccf609808d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ConsumerHelperTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java @@ -1,5 +1,6 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.ConsumerHelper; import org.junit.jupiter.api.Test; import java.util.concurrent.CompletableFuture; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java index 514cd92437..b9dc86042d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractByteCodeQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.ContractByteCodeQuery; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +40,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractByteCodeQuery() .setContractId(ContractId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap new file mode 100644 index 0000000000..b539f7baa9 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ContractByteCodeQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncontract_get_bytecode {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java index 7e1e33cb07..e957dececc 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCallQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java @@ -17,9 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractCallQuery; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -45,7 +50,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractCallQuery() .setContractId(ContractId.fromString("0.0.5005")) .setGas(1541) @@ -60,7 +65,7 @@ void shouldSerialize() { @Test void setFunctionParameters() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractCallQuery() .setContractId(ContractId.fromString("0.0.5005")) .setGas(1541) diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap new file mode 100644 index 0000000000..d35d7ff1ec --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.ContractCallQueryTest.setFunctionParameters=[ + "# com.hiero.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" +] + + +com.hiero.sdk.ContractCallQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\022J\\203\\372\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java index 363174ce1e..ee6d187e09 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.ContractCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ContractCreateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap new file mode 100644 index 0000000000..183da18345 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.ContractCreateTransactionTest.shouldSerialize2=[ + "# com.hiero.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n gas: 0\n initcode: \"\\336\\255\\276\\357\"\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.ContractCreateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n file_i_d {\n file_num: 3003\n realm_num: 0\n shard_num: 0\n }\n gas: 0\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java index f6f7d6f1f2..0f56d68546 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ContractDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ContractDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap new file mode 100644 index 0000000000..f18efcd301 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ContractDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncontract_delete_instance {\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_contract_i_d {\n contract_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java index 4dc337c482..60f3bfea6d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractExecuteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ContractCallTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractExecuteTransaction; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ContractCallTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap new file mode 100644 index 0000000000..726f00f7f5 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ContractExecuteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncontract_call {\n amount: 1000\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\030+\\v\"\n gas: 10\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java b/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java similarity index 99% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java index dddfb5a66c..059d64ac2d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractFunctionSelector; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.snap similarity index 99% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.snap rename to sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.snap index d15abc50c3..c4daf8bac4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionParametersTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.snap @@ -1,4 +1,4 @@ -com.hedera.hashgraph.sdk.ContractFunctionParametersTest.intSizesEncodeCorrectly=[ +com.hiero.sdk.ContractFunctionParametersTest.intSizesEncodeCorrectly=[ [ "bitWidth = 8: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000002ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080", "bitWidth = 16: 00000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000", @@ -33,4 +33,4 @@ com.hedera.hashgraph.sdk.ContractFunctionParametersTest.intSizesEncodeCorrectly= "bitWidth = 248: 00800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000", "bitWidth = 256: 80000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000" ] -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionResultTest.java b/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionResultTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java index 1666542d4b..cc400569e7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionResultTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java @@ -17,10 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractFunctionResult; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractNonceInfo; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -57,7 +61,7 @@ public class ContractFunctionResultTest { @DisplayName("provides results correctly") void providesResultsCorrectly() { var result = new ContractFunctionResult( - com.hedera.hashgraph.sdk.proto.ContractFunctionResult.newBuilder() + com.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(ContractId.fromString("1.2.3").toProtobuf()) .setContractCallResult(ByteString.copyFrom(callResult)) .setEvmAddress(BytesValue.newBuilder().setValue(ByteString.copyFrom(Hex.decode("98329e006610472e6B372C080833f6D79ED833cf"))).build()) @@ -116,7 +120,7 @@ void providesResultsCorrectly() { @DisplayName("can get string array result") void canGetStringArrayResult() { var result = new ContractFunctionResult( - com.hedera.hashgraph.sdk.proto.ContractFunctionResult.newBuilder() + com.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractCallResult(ByteString.copyFrom(stringArrayCallResult)) ); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionSelectorTest.java b/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionSelectorTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java index 7ea8d4a5d8..44ed85292b 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractFunctionSelectorTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java @@ -17,8 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.ContractFunctionSelector; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java similarity index 98% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractIdTest.java index f7522a5f49..fa5da0b8c3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java @@ -17,9 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.ContractId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap new file mode 100644 index 0000000000..6f5b754b88 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap @@ -0,0 +1,48 @@ +com.hiero.sdk.ContractIdTest.fromBytes=[ + "0.0.5005" +] + + +com.hiero.sdk.ContractIdTest.fromEvmAddress=[ + "1.2.98329e006610472e6b372c080833f6d79ed833cf" +] + + +com.hiero.sdk.ContractIdTest.fromEvmAddressWith0x=[ + "1.2.98329e006610472e6b372c080833f6d79ed833cf" +] + + +com.hiero.sdk.ContractIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +com.hiero.sdk.ContractIdTest.fromSolidityAddressWith0x=[ + "0.0.5005" +] + + +com.hiero.sdk.ContractIdTest.fromString=[ + "0.0.5005" +] + + +com.hiero.sdk.ContractIdTest.fromStringWithEvmAddress=[ + "1.2.98329e006610472e6b372c080833f6d79ed833cf" +] + + +com.hiero.sdk.ContractIdTest.toBytes=[ + "188d27" +] + + +com.hiero.sdk.ContractIdTest.toSolidityAddress2=[ + "98329e006610472e6b372c080833f6d79ed833cf" +] + + +com.hiero.sdk.ContractIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java index 6c16d2d193..8ef390fce7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractInfoQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +40,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractInfoQuery() .setContractId(ContractId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap new file mode 100644 index 0000000000..9ba7f7a12d --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ContractInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncontract_get_info {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java index 4188b1391f..2c243aeba1 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java @@ -17,10 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractGetInfoResponse; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractInfo; +import com.hiero.sdk.DurationConverter; +import com.hiero.sdk.InstantConverter; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.proto.ContractGetInfoResponse; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.snap similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/ContractInfoTest.snap index 5875fdf230..09d462744d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.snap @@ -1,19 +1,19 @@ -com.hedera.hashgraph.sdk.ContractInfoTest.fromBytes=[ +com.hiero.sdk.ContractInfoTest.fromBytes=[ "ContractInfo{contractId=0.0.1, accountId=0.0.2, contractAccountId=3, adminKey=null, expirationTime=1970-01-01T00:00:00.004Z, autoRenewPeriod=PT120H, autoRenewAccountId=null, storage=6, contractMemo=7, balance=8 tℏ, isDeleted=false, tokenRelationships={}, ledgerId=testnet, stakingInfo=null}" ] -com.hedera.hashgraph.sdk.ContractInfoTest.fromProtobuf=[ +com.hiero.sdk.ContractInfoTest.fromProtobuf=[ "ContractInfo{contractId=0.0.1, accountId=0.0.2, contractAccountId=3, adminKey=null, expirationTime=1970-01-01T00:00:00.004Z, autoRenewPeriod=PT120H, autoRenewAccountId=null, storage=6, contractMemo=7, balance=8 tℏ, isDeleted=false, tokenRelationships={}, ledgerId=testnet, stakingInfo=null}" ] -com.hedera.hashgraph.sdk.ContractInfoTest.toBytes=[ +com.hiero.sdk.ContractInfoTest.toBytes=[ "0a021801120218021a01332a05108092f40132040880af1a38064201374808620101" ] -com.hedera.hashgraph.sdk.ContractInfoTest.toProtobuf=[ +com.hiero.sdk.ContractInfoTest.toProtobuf=[ { "memoizedHashCode": 0, "memoizedSerializedSize": 2147483647, @@ -99,4 +99,4 @@ com.hedera.hashgraph.sdk.ContractInfoTest.toProtobuf=[ "maxAutomaticTokenAssociations_": 0, "initialized": true } -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java index 358569620e..0fd8a21e23 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractLogInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java @@ -1,8 +1,10 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ContractLoginfo; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractLogInfo; +import com.hiero.sdk.proto.ContractLoginfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap new file mode 100644 index 0000000000..dbfb24c06d --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap @@ -0,0 +1,18 @@ +com.hiero.sdk.ContractLogInfoTest.fromBytes=[ + "ContractLogInfo{contractId=0.0.10, bloom=626c6f6f6d, topics=[626c6f6f6d]}" +] + + +com.hiero.sdk.ContractLogInfoTest.fromProtobuf=[ + "ContractLogInfo{contractId=0.0.10, bloom=626c6f6f6d, topics=[626c6f6f6d]}" +] + + +com.hiero.sdk.ContractLogInfoTest.toBytes=[ + "0a02180a1205626c6f6f6d1a05626c6f6f6d" +] + + +com.hiero.sdk.ContractLogInfoTest.toProtobuf=[ + "# com.hiero.sdk.proto.ContractLoginfo@cb39e330\nbloom: \"bloom\"\ncontract_i_d {\n contract_num: 10\n realm_num: 0\n shard_num: 0\n}\ntopic: \"bloom\"" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java similarity index 85% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java index a9c3c6f5b7..4fc112b0f2 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java @@ -1,6 +1,8 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractNonceInfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; @@ -8,8 +10,8 @@ import org.junit.jupiter.api.Test; public class ContractNonceInfoTest { - private final com.hedera.hashgraph.sdk.proto.ContractNonceInfo info = - com.hedera.hashgraph.sdk.proto.ContractNonceInfo.newBuilder() + private final com.hiero.sdk.proto.ContractNonceInfo info = + com.hiero.sdk.proto.ContractNonceInfo.newBuilder() .setContractId(new ContractId(1).toProtobuf()) .setNonce(2) .build(); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.snap similarity index 76% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.snap index 1e1cc8e763..5b28a93f26 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractNonceInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.snap @@ -1,19 +1,19 @@ -com.hedera.hashgraph.sdk.ContractNonceInfoTest.fromBytes=[ +com.hiero.sdk.ContractNonceInfoTest.fromBytes=[ "ContractNonceInfo{contractId=0.0.1, nonce=2}" ] -com.hedera.hashgraph.sdk.ContractNonceInfoTest.fromProtobuf=[ +com.hiero.sdk.ContractNonceInfoTest.fromProtobuf=[ "ContractNonceInfo{contractId=0.0.1, nonce=2}" ] -com.hedera.hashgraph.sdk.ContractNonceInfoTest.toBytes=[ +com.hiero.sdk.ContractNonceInfoTest.toBytes=[ "0a0218011002" ] -com.hedera.hashgraph.sdk.ContractNonceInfoTest.toProtobuf=[ +com.hiero.sdk.ContractNonceInfoTest.toProtobuf=[ { "memoizedHashCode": 0, "memoizedSerializedSize": 2147483647, @@ -44,4 +44,4 @@ com.hedera.hashgraph.sdk.ContractNonceInfoTest.toProtobuf=[ "nonce_": 2, "initialized": true } -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java index e74b165ab8..df8b1133bf 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ContractUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.ContractUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractUpdateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ContractUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap new file mode 100644 index 0000000000..b085d8d377 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.ContractUpdateTransactionTest.shouldSerialize2=[ + "# com.hiero.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.ContractUpdateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java index 784d71452a..fead24128d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CryptoTransferTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java @@ -17,12 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionList; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; +import com.hiero.sdk.proto.CryptoTransferTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionList; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -142,9 +150,9 @@ void canGetDecimals() { @Test void transactionBodiesMustMatch() throws InvalidProtocolBufferException { - com.hedera.hashgraph.sdk.proto.Transaction tx1 = TransactionList.parseFrom(spawnTestTransaction().toBytes()) + com.hiero.sdk.proto.Transaction tx1 = TransactionList.parseFrom(spawnTestTransaction().toBytes()) .getTransactionList(0); - com.hedera.hashgraph.sdk.proto.Transaction tx2 = TransactionList.parseFrom(spawnModifiedTestTransaction().toBytes()) + com.hiero.sdk.proto.Transaction tx2 = TransactionList.parseFrom(spawnModifiedTestTransaction().toBytes()) .getTransactionList(1); var brokenTxList = TransactionList.newBuilder() .addTransactionList(tx1) diff --git a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap new file mode 100644 index 0000000000..8d59599e77 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.CryptoTransferTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_transfer {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n transfers {\n account_amounts {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n account_amounts {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n is_approval: true\n }\n account_amounts {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java b/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java rename to sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java index 10219974d9..52b7210e22 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java @@ -17,8 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.CustomRoyaltyFee; +import com.hiero.sdk.TokenId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.snap b/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.snap similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.snap rename to sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.snap index aa95cdebb9..2a98757c8e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFeeListTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.snap @@ -1,8 +1,8 @@ -com.hedera.hashgraph.sdk.CustomFeeListTest.deepClone=[ +com.hiero.sdk.CustomFeeListTest.deepClone=[ "[CustomFixedFee{feeCollectorAccountId=0.0.4322, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}, CustomFractionalFee{feeCollectorAccountId=0.0.389042, allCollectorsAreExempt=false, numerator=3, denominator=7, min=3, max=100, assessmentMethod=INCLUSIVE}, CustomRoyaltyFee{feeCollectorAccountId=0.0.23423, allCollectorsAreExempt=false, numerator=5, denominator=8, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}}]" ] -com.hedera.hashgraph.sdk.CustomFeeListTest.shouldSerialize=[ +com.hiero.sdk.CustomFeeListTest.shouldSerialize=[ "[CustomFixedFee{feeCollectorAccountId=0.0.4322, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}, CustomFractionalFee{feeCollectorAccountId=0.0.389042, allCollectorsAreExempt=false, numerator=3, denominator=7, min=3, max=100, assessmentMethod=INCLUSIVE}, CustomRoyaltyFee{feeCollectorAccountId=0.0.23423, allCollectorsAreExempt=false, numerator=5, denominator=8, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}}]" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.java b/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.java rename to sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java index 913709a2f9..f05d1acc0a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFixedFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java @@ -17,9 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.FixedFee; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.proto.FixedFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap b/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap new file mode 100644 index 0000000000..cc4791945e --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap @@ -0,0 +1,13 @@ +com.hiero.sdk.CustomFixedFeeTest.fromProtobuf=[ + "CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=4, demoninatingTokenId=5.6.7}" +] + + +com.hiero.sdk.CustomFixedFeeTest.toFixedFeeProtobuf=[ + "# com.hiero.sdk.proto.FixedFee@409d860\namount: 4\ndenominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n}" +] + + +com.hiero.sdk.CustomFixedFeeTest.toProtobuf=[ + "# com.hiero.sdk.proto.CustomFee@91885f65\nfixed_fee {\n amount: 4\n denominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.java b/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.java rename to sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java index 0771c91ccf..044f46984c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomFractionalFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java @@ -1,7 +1,10 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Fraction; -import com.hedera.hashgraph.sdk.proto.FractionalFee; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.FeeAssessmentMethod; +import com.hiero.sdk.proto.Fraction; +import com.hiero.sdk.proto.FractionalFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap b/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap new file mode 100644 index 0000000000..c9f47a9cda --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.CustomFractionalFeeTest.fromProtobuf=[ + "CustomFractionalFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, numerator=4, denominator=5, min=6, max=7, assessmentMethod=EXCLUSIVE}" +] + + +com.hiero.sdk.CustomFractionalFeeTest.toProtobuf=[ + "# com.hiero.sdk.proto.CustomFee@b2abef2c\nfractional_fee {\n fractional_amount {\n denominator: 5\n numerator: 4\n }\n maximum_amount: 7\n minimum_amount: 6\n net_of_transfers: true\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.java b/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.java rename to sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java index 5ab1dca143..ba2057e838 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/CustomRoyaltyFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java @@ -17,11 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.FixedFee; -import com.hedera.hashgraph.sdk.proto.Fraction; -import com.hedera.hashgraph.sdk.proto.RoyaltyFee; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomRoyaltyFee; +import com.hiero.sdk.proto.FixedFee; +import com.hiero.sdk.proto.Fraction; +import com.hiero.sdk.proto.RoyaltyFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap b/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap new file mode 100644 index 0000000000..5c6f9daf88 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.CustomRoyaltyFeeTest.fromProtobuf=[ + "CustomRoyaltyFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, numerator=4, denominator=5, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=6, demoninatingTokenId=null}}" +] + + +com.hiero.sdk.CustomRoyaltyFeeTest.toProtobuf=[ + "# com.hiero.sdk.proto.CustomFee@1abe2492\nroyalty_fee {\n exchange_value_fraction {\n denominator: 5\n numerator: 4\n }\n fallback_fee {\n amount: 6\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java rename to sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java index 70d17abd11..e8fbb3f185 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/DelegateContractIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java @@ -17,9 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.DelegateContractId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap new file mode 100644 index 0000000000..43fc7644b3 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap @@ -0,0 +1,28 @@ +com.hiero.sdk.DelegateContractIdTest.fromBytes=[ + "0.0.5005" +] + + +com.hiero.sdk.DelegateContractIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +com.hiero.sdk.DelegateContractIdTest.fromSolidityAddressWith0x=[ + "0.0.5005" +] + + +com.hiero.sdk.DelegateContractIdTest.fromString=[ + "0.0.5005" +] + + +com.hiero.sdk.DelegateContractIdTest.toBytes=[ + "188d27" +] + + +com.hiero.sdk.DelegateContractIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java index 0dd799ff27..eb74688794 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/DuplicateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java @@ -1,5 +1,7 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.TransactionId; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java b/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java similarity index 99% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java rename to sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java index efea2a0c93..bb0399dad2 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPrivateKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java @@ -17,9 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.utils.Bip32Utils; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.utils.Bip32Utils; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java b/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java rename to sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java index 3f8ba0fe90..7d488f6942 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ECDSAPublicKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java @@ -17,8 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.HbarUnit; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.PublicKeyECDSA; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java b/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java similarity index 99% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java rename to sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java index 24eec4734f..c6bb9715e5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PrivateKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java @@ -17,8 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.BadKeyException; +import com.hiero.sdk.Mnemonic; +import com.hiero.sdk.PrivateKey; import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java b/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java rename to sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java index ee3a535307..d6f64ed289 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Ed25519PublicKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java @@ -17,8 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.HbarUnit; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.PublicKeyED25519; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -52,7 +63,7 @@ void verifyTransaction() { @Test void keyByteValidation() { byte[] invalidKeyED25519 = new byte[32]; - assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyED25519)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyED25519)); assertDoesNotThrow(() -> PublicKey.fromBytesED25519(invalidKeyED25519)); byte[] invalidKey = new byte[]{ diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumFlowMockTest.java b/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumFlowMockTest.java rename to sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java index 501474e14c..ca33dfeb29 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumFlowMockTest.java +++ b/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java @@ -1,15 +1,21 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.FileID; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionGetReceiptResponse; -import com.hedera.hashgraph.sdk.proto.TransactionReceipt; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.EthereumFlow; +import com.hiero.sdk.EthereumTransactionData; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.proto.FileID; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionGetReceiptResponse; +import com.hiero.sdk.proto.TransactionReceipt; +import com.hiero.sdk.proto.TransactionResponse; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -92,7 +98,7 @@ void extractsCallData(String versionToTest) throws PrecheckStatusException, Time var transactionBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); assertThat(transactionBody.getDataCase()).isEqualByComparingTo(TransactionBody.DataCase.ETHEREUMTRANSACTION); assertThat(transactionBody.hasEthereumTransaction()).isTrue(); - assertThat(EthereumTransactionData.fromBytes(transactionBody.getEthereumTransaction().getEthereumData().toByteArray()).callData).isEmpty(); + Assertions.assertThat(EthereumTransactionData.fromBytes(transactionBody.getEthereumTransaction().getEthereumData().toByteArray()).callData).isEmpty(); return TransactionResponse.newBuilder().setNodeTransactionPrecheckCodeValue(0).build(); }, Response.newBuilder() diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java rename to sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java index e8c67b418e..f6fc5e87be 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionDataLegacyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java @@ -1,5 +1,8 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.EthereumTransactionData; +import com.hiero.sdk.EthereumTransactionDataEip1559; +import com.hiero.sdk.EthereumTransactionDataLegacy; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java index bc817b0ba3..7c2be9f8b5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/EthereumTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java @@ -1,5 +1,13 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.EthereumTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap new file mode 100644 index 0000000000..8a36a32e0e --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.EthereumTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nethereum_transaction {\n call_data {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n ethereum_data: \"\\336\\255\\276\\357\"\n max_gas_allowance: 300000000\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java b/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java rename to sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java index dd29ee090e..a134eca94c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExchangeRatesTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java @@ -17,9 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.ExchangeRates; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java b/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java similarity index 82% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java rename to sdk/src/test/java/com/hiero/sdk/ExecutableTest.java index fd85ccfa39..d955aa51db 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ExecutableTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java @@ -17,16 +17,33 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Executable; +import com.hiero.sdk.Executable.GrpcRequest; +import com.hiero.sdk.ExecutionState; +import com.hiero.sdk.MaxAttemptsExceededException; +import com.hiero.sdk.Network; +import com.hiero.sdk.Node; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Query; +import com.hiero.sdk.Status; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionReceipt; +import com.hiero.sdk.TransactionReceiptQuery; +import com.hiero.sdk.TransactionResponse; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import io.grpc.StatusRuntimeException; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.stubbing.Answer; @@ -92,7 +109,7 @@ void firstNodeHealthy() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - assertThat(node).isEqualTo(node3); + Assertions.assertThat(node).isEqualTo(node3); } @@ -110,8 +127,8 @@ void calloptionsShouldRespectGrpcDeadline() { var grpcRequest = tx.getGrpcRequest(1); var timeRemaining = grpcRequest.getCallOptions().getDeadline().timeRemaining(TimeUnit.MILLISECONDS); - assertThat(timeRemaining).isLessThan(10000); - assertThat(timeRemaining).isGreaterThan(9000); + Assertions.assertThat(timeRemaining).isLessThan(10000); + Assertions.assertThat(timeRemaining).isGreaterThan(9000); } @Test @@ -134,7 +151,7 @@ void executableShouldUseGrpcDeadline() throws InterruptedException, PrecheckStat tx.setGrpcDeadline(Duration.ofMillis(defaultDeadlineMs)); tx.blockingUnaryCall = (grpcRequest) -> { - var grpc = (Executable.GrpcRequest) grpcRequest; + var grpc = (GrpcRequest) grpcRequest; var grpcTimeRemaining = grpc.getCallOptions().getDeadline().timeRemaining(TimeUnit.MILLISECONDS); @@ -146,7 +163,7 @@ void executableShouldUseGrpcDeadline() throws InterruptedException, PrecheckStat assertThat(grpcTimeRemaining).isGreaterThan(0); // transaction's grpc deadline should keep its original value - assertThat(tx.grpcDeadline().toMillis()).isEqualTo(defaultDeadlineMs); + Assertions.assertThat(tx.grpcDeadline().toMillis()).isEqualTo(defaultDeadlineMs); currentTimeRemaining.set(currentTimeRemaining.get() - minimumRetryDelayMs); @@ -183,7 +200,7 @@ void multipleNodesUnhealthy() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - assertThat(node).isEqualTo(node4); + Assertions.assertThat(node).isEqualTo(node4); } @Test @@ -204,7 +221,7 @@ void allNodesUnhealthy() { tx.nodeAccountIds.setIndex(1); var node = tx.getNodeForExecute(1); - assertThat(node).isEqualTo(node4); + Assertions.assertThat(node).isEqualTo(node4); } @Test @@ -223,12 +240,12 @@ void multipleRequestsWithSingleHealthyNode() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - assertThat(node).isEqualTo(node3); + Assertions.assertThat(node).isEqualTo(node3); tx.nodeAccountIds.advance(); tx.nodes.advance(); node = tx.getNodeForExecute(2); - assertThat(node).isEqualTo(node3); + Assertions.assertThat(node).isEqualTo(node3); verify(node4).getRemainingTimeForBackoff(); verify(node5).getRemainingTimeForBackoff(); } @@ -256,15 +273,15 @@ void multipleRequestsWithNoHealthyNodes() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - assertThat(node).isEqualTo(node5); + Assertions.assertThat(node).isEqualTo(node5); i.incrementAndGet(); node = tx.getNodeForExecute(2); - assertThat(node).isEqualTo(node4); + Assertions.assertThat(node).isEqualTo(node4); i.incrementAndGet(); node = tx.getNodeForExecute(3); - assertThat(node).isEqualTo(node3); + Assertions.assertThat(node).isEqualTo(node3); } @Test @@ -273,8 +290,8 @@ void successfulExecute() throws PrecheckStatusException, TimeoutException { var tx = new DummyTransaction() { @Nullable @Override - TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionResponse response, - AccountId nodeId, com.hedera.hashgraph.sdk.proto.Transaction request) { + TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, com.hiero.sdk.proto.Transaction request) { return new TransactionResponse( new AccountId(3), TransactionId.withValidStart(new AccountId(3), now), @@ -292,13 +309,13 @@ TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionRespon tx.setNodeAccountIds(nodeAccountIds); var txResp = - com.hedera.hashgraph.sdk.proto.TransactionResponse + com.hiero.sdk.proto.TransactionResponse .newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hedera.hashgraph.sdk.TransactionResponse resp = (com.hedera.hashgraph.sdk.TransactionResponse) tx.execute( + com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute( client); assertThat(resp.nodeId).isEqualTo(new AccountId(3)); @@ -318,8 +335,8 @@ void executeWithChannelFailure() throws PrecheckStatusException, TimeoutExceptio var tx = new DummyTransaction() { @Nullable @Override - TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionResponse response, - AccountId nodeId, com.hedera.hashgraph.sdk.proto.Transaction request) { + TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, com.hiero.sdk.proto.Transaction request) { return new TransactionResponse( new AccountId(4), TransactionId.withValidStart(new AccountId(4), now), @@ -336,13 +353,13 @@ TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionRespon tx.setNodeAccountIds(nodeAccountIds); var txResp = - com.hedera.hashgraph.sdk.proto.TransactionResponse + com.hiero.sdk.proto.TransactionResponse .newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hedera.hashgraph.sdk.TransactionResponse resp = (com.hedera.hashgraph.sdk.TransactionResponse) tx.execute( + com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute( client); verify(node3).channelFailedToConnect(any(Instant.class)); @@ -375,8 +392,8 @@ void executeWithAllUnhealthyNodes() throws PrecheckStatusException, TimeoutExcep var tx = new DummyTransaction() { @Nullable @Override - TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionResponse response, - AccountId nodeId, com.hedera.hashgraph.sdk.proto.Transaction request) { + TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, com.hiero.sdk.proto.Transaction request) { return new TransactionResponse( new AccountId(3), TransactionId.withValidStart(new AccountId(3), now), @@ -393,13 +410,13 @@ TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionRespon tx.setNodeAccountIds(nodeAccountIds); var txResp = - com.hedera.hashgraph.sdk.proto.TransactionResponse + com.hiero.sdk.proto.TransactionResponse .newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hedera.hashgraph.sdk.TransactionResponse resp = (com.hedera.hashgraph.sdk.TransactionResponse) tx.execute( + com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute( client); verify(node3, times(2)).channelFailedToConnect(any(Instant.class)); @@ -492,7 +509,7 @@ void executeQueryDelay() throws PrecheckStatusException, TimeoutException { AtomicInteger i = new AtomicInteger(); var tx = new DummyQuery() { @Override - Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.Response response) { + Status mapResponseStatus(com.hiero.sdk.proto.Response response) { return Status.RECEIPT_NOT_FOUND; } @@ -508,10 +525,10 @@ ExecutionState getExecutionState(Status status, Response response) { ); tx.setNodeAccountIds(nodeAccountIds); - var receipt = com.hedera.hashgraph.sdk.proto.TransactionReceipt.newBuilder() + var receipt = com.hiero.sdk.proto.TransactionReceipt.newBuilder() .setStatus(ResponseCodeEnum.OK) .build(); - var receiptResp = com.hedera.hashgraph.sdk.proto.TransactionGetReceiptResponse.newBuilder() + var receiptResp = com.hiero.sdk.proto.TransactionGetReceiptResponse.newBuilder() .setReceipt(receipt) .build(); @@ -531,7 +548,7 @@ void executeUserError() throws PrecheckStatusException, TimeoutException { var tx = new DummyTransaction() { @Override - Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.TransactionResponse response) { + Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { return Status.ACCOUNT_DELETED; } }; @@ -543,7 +560,7 @@ Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.TransactionResponse resp tx.setNodeAccountIds(nodeAccountIds); var txResp = - com.hedera.hashgraph.sdk.proto.TransactionResponse + com.hiero.sdk.proto.TransactionResponse .newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.ACCOUNT_DELETED) .build(); @@ -558,12 +575,12 @@ Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.TransactionResponse resp void shouldRetryReturnsCorrectStates() { var tx = new DummyTransaction(); - assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)).isEqualTo( + Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)).isEqualTo( ExecutionState.SERVER_ERROR); - assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)).isEqualTo(ExecutionState.SERVER_ERROR); - assertThat(tx.getExecutionState(Status.BUSY, null)).isEqualTo(ExecutionState.RETRY); - assertThat(tx.getExecutionState(Status.OK, null)).isEqualTo(ExecutionState.SUCCESS); - assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)).isEqualTo(ExecutionState.REQUEST_ERROR); + Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)).isEqualTo(ExecutionState.SERVER_ERROR); + Assertions.assertThat(tx.getExecutionState(Status.BUSY, null)).isEqualTo(ExecutionState.RETRY); + Assertions.assertThat(tx.getExecutionState(Status.OK, null)).isEqualTo(ExecutionState.SUCCESS); + Assertions.assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)).isEqualTo(ExecutionState.REQUEST_ERROR); } @Test @@ -572,14 +589,14 @@ void shouldSetMaxRetry() { tx.setMaxRetry(1); - assertThat(tx.getMaxRetry()).isEqualTo(1); + Assertions.assertThat(tx.getMaxRetry()).isEqualTo(1); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> tx.setMaxRetry(0)); } static class DummyTransaction> extends - Executable { + Executable { @Override void onExecute(Client client) { @@ -593,25 +610,25 @@ CompletableFuture onExecuteAsync(Client client) { @Nullable @Override - com.hedera.hashgraph.sdk.proto.Transaction makeRequest() { + com.hiero.sdk.proto.Transaction makeRequest() { return null; } @Nullable @Override - TransactionResponse mapResponse(com.hedera.hashgraph.sdk.proto.TransactionResponse response, AccountId nodeId, - com.hedera.hashgraph.sdk.proto.Transaction request) { + TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, AccountId nodeId, + com.hiero.sdk.proto.Transaction request) { return null; } @Override - Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.TransactionResponse response) { + Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { return Status.OK; } @Nullable @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return null; } @@ -629,22 +646,22 @@ void onExecute(Client client) { @Override TransactionReceipt mapResponse(Response response, AccountId nodeId, - com.hedera.hashgraph.sdk.proto.Query request) { + com.hiero.sdk.proto.Query request) { return null; } @Override - Status mapResponseStatus(com.hedera.hashgraph.sdk.proto.Response response) { + Status mapResponseStatus(com.hiero.sdk.proto.Response response) { return Status.OK; } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return null; } @Override - void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { } @Override @@ -653,7 +670,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) { + QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { return null; } diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeAssessmentMethodTest.java b/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java similarity index 68% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FeeAssessmentMethodTest.java rename to sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java index 746788c8ca..c141ab2f10 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeAssessmentMethodTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java @@ -1,5 +1,7 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.FeeAssessmentMethod; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -7,7 +9,7 @@ class FeeAssessmentMethodTest { @Test void feeAssessmentMethodToString() { - assertThat(FeeAssessmentMethod.valueOf(true)) + Assertions.assertThat(FeeAssessmentMethod.valueOf(true)) .hasToString(FeeAssessmentMethod.EXCLUSIVE.toString()); assertThat(FeeAssessmentMethod.valueOf(false)) .hasToString(FeeAssessmentMethod.INCLUSIVE.toString()); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java b/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java rename to sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java index fcf9dec412..e3a12faa0a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java @@ -17,8 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.FeeComponents; +import com.hiero.sdk.FeeData; +import com.hiero.sdk.FeeSchedule; +import com.hiero.sdk.FeeSchedules; +import com.hiero.sdk.TransactionFeeSchedule; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.snap b/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.snap similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.snap rename to sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.snap index 5e4ae7ebeb..7048cfec7b 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FeeSchedulesTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.snap @@ -1,3 +1,3 @@ -com.hedera.hashgraph.sdk.FeeSchedulesTest.shouldSerialize=[ +com.hiero.sdk.FeeSchedulesTest.shouldSerialize=[ "FeeSchedules{current=FeeSchedule{transactionFeeSchedules=[TransactionFeeSchedule{requestType=NONE, feeData=null, fees=[FeeData{nodeData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, networkData=FeeComponents{min=2, max=5, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, serviceData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, type=DEFAULT}]}], expirationTime=2019-04-01T22:42:22Z}, next=FeeSchedule{transactionFeeSchedules=[TransactionFeeSchedule{requestType=NONE, feeData=null, fees=[FeeData{nodeData=FeeComponents{min=1, max=2, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, networkData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, serviceData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, type=DEFAULT}]}], expirationTime=2019-04-01T22:37:02Z}}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java index cec89ef1ef..a496c39d08 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileAppendTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java @@ -17,10 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.FileAppendTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileAppendTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.FileAppendTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap new file mode 100644 index 0000000000..38f7f19302 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap @@ -0,0 +1,23 @@ +com.hiero.sdk.FileAppendTransactionTest.shouldGetAllSignatures=[ + "[{0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=40d079bcb4a9fbdf102051328ee5f3903e166c1dd7c1e748efc95a2fdd640e421c0a8e23709b61e4d8110451adecd71cd16d1293ce0e57ea974de5b6b2ef070e, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=0cbdeaac11d392081289fb67a93a7fd995e86f55764e45b3e5eefd2f64056a38b50e8478e64cb1af5c310c321478e09b60d641a6e898820625d2674dc54ce80e, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=1490ad50f0fb5af40ee1d823e4f4b2603c135b3c7979b1b0ee6a323ba494e0b5cca833157c1106b976c876b060249e7ee2db30a8566d8682a42fac2f5f4a3406, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=23a657e362da4b3ea29673c26d8b17b967c53528449d99b3154e1b81676dc8d0aa229b824f9e613803b3262bc9cecc6dc6e2fc01a21830fb1641b5ed03722e07, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=4b4ed404ef9a37752c070c5eb364b0df0fbe06afb0b64e0743d27767c26b1045e8532308288e2f1a40cced0782b87f20b6cfdcd8b9890c600c0e2146a48ace00, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=95444670cecb07fc452a4e3f350eca481e5462e3349a6741cd4e6746b21c66e67825c169f3b4cf82ab1853f1cf0acedc84b2f565346dc173a93f054c19966b08, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=ce2b975f698ca802721c80a3792fca39d73609afaa8961bb91da569463c50eecb07d7e26e7e8febb5163474139e94533e8eb7016e0c149e0823d7102ed2b0502, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=ea31e49f64fd41773561f81459a2381e0194788853e28ffb683caded7a675d386b2a228c67ec83bfc448f14ee4fd2eae41569f06006c515621e1f26514c9bf0a, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=0aedd8f92e68278823397cb0eddc1c07f1fd80c223781280a0ffb0eef21b516444e4521294ad380e8a46c7f22f1723eef8872ccf4d8aa415345e0a7fe1485c06, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=8cf7f0ae116557d5f4a5bbee82dee3cfe950c0ecedbce5d2a7b729dd7614d47c436e6951c401870f85dadd696160ecee1ab8e65aa607ca942051e78b8f09a406, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=47c3e240259603f3e7fa41ced3eb9931bc4350367aa6529994c048fb0aca1853630bf8fbbdf9b2768c52b91b5f5d669a4adab06ef0851107f6e8012d948ba90b, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=d1a4d3349a1bc7cd0242e09ed9b1811ea99fb6123826b946651ee8c9dd593eb40591697fad4360e3941c9eea55cd2173189df349aa16b9a11db62ed28de8ad06, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=aa009ad11594bb981504f8d4063c9d90bfb0bccc4bda8f9e3ffd326fc39e599fae94ba98110342a449437f7c848e2a9dd6de0d008e8d00c8387ff094c93c2700, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=5a2b40589f128f3bac99649d0aec7230e3c993130f36814c742ae37104e93d22e2b548d97e471f583d1c81bbcf6f916cc03f20375499e3a37b2c6b13a5a94507, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=63800201fd378e81946c73104907b0b0aa70ff5913889b21b4eac730e535f8acbf08f63da5824419fc14155d6fc19f23a53bfd3324d8baa68dc5d00e8974de07, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=084bdc8f8580a2ebcc0a5140f766aca111b5488092a41871d104834dda27d6b99288423835bc7114860ce6c740300ebe9f8ab576e7646097eee7d6692b90d109, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=645d9d66e90a104462741e2f49fe77d2edce5d49a033c9c51768a2fba6deda96a71ad95e00416bb5a8a07cfaf543a1fee8730c11af4a380d6f30ec88d2271c0d, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=2bc0f7e72aa2e953741815ac95135e50ece67543683e6da3a26bc95534d9ca538d802d567fcb154bf98001663dc46d8674ff4e9361021fbe2a55e83f9442f802, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=e83759154409ce22146e31ff826a3ee4940916784e5953c4c0502ef5c2f9e7ca2d114223c3461a491dfebdcc11e511e91400007a1dc3827b7b98c7225239460f, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=595653b3f5cedf84e845f0dc2c503aad94b259eee4c10ad32cd86976b246cd81726ae8edc35e41e9ebae9e27a3ed96aff524b9b04481fad2722fdab8a4ee5a0f, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=dea30ba3201c32f5c23afac9d5b013c4e41a30d08205d21a09722f5aebb0760b2452ba254eea5008de68411560081e94ccd78c5008353aa6bb64779e79078702, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=903762ba6159fcf940281d810a268980cdf2fa35683626d52e41ad18202492fef5f8de2002c49cb56ac9d9e78177823f1f97741634237943459c31540f801502, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=c463b37297427a620f739b3a420512f897745a8451315de360391b2f6879e644ba3a8597e4f6e3a1a135bf354bb0911fe421e0174f48b650f54e3fe86247e507, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=342e41dbd4e3ef300192767ffeb9b062b1fae68027153a84f151fdb1d3ce43592f275d87a7b90a9d6db6a67d32c6ec9e585ce199ed199cdcac0b4ef4ac12200f, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=9e4dcb75574c75c7e54cc76ff08bf9e6c28cb2e74f79eb4ed8e4f968e6829bd994d9fadff9fb265988de757b858e4921c7b4db119c31f6156a79eb62ffc4110c, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=195fdc0b4c9730139ede43d8e80befe7bef91ab8fa2f271173bab926cff2c797117a28716112b6d1ab3b6c669a4b923f5885b40f67885b1a64d0445ad75bbe0e, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=0e3e02a08fd3a807c79c1ce2117612c2902557aa7c57da2494744f45b105f3f67b9977564f83baf2cd7dd4fe2cf0421f9367343a92d90199e97f22bc977f3d0f, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=a9ef610d944c989424477a2e31b970033bffcce8899116820f9eac06f2d06226cfe714e6a835135e2fb632dda80b439199e76870156acd6f81d4c3cf342a3706, }, }, ]" +] + + +com.hiero.sdk.FileAppendTransactionTest.shouldGetSignatures=[ + "{0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=a762395ad7e3fa298ed990785699133ca64d11a28fb4dfc83d6d95a9a2639b688d5afc288fcdb8168f4a85876b2b785e3303ddec38666bbae4f5436d6334540b, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=8bea3d52ad5badc4ebf5e20f874cf2e5dec3189d3a471c39fd1062743ba7729de1c484f1e8ac2f15343494799e97b5ac220734a261994d91ffed9e113c09d700, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=4b8fd70342b6c201f08177de53122be909d5d72f97d29fba69e7ac6ef04d96b19ac417c9b84fbb122bce9c8323bc38bd6165b5750ce16ee4a2f23e28d7123006, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=371b502056cbf34c1bd7f9891e82c7a53ab8d92ce1728f790acc9a09989196fbf4c1c111ca010a19f1af82f2480be92229b5a1aadfe4af9142bd212254c88b08, }, }" +] + + +com.hiero.sdk.FileAppendTransactionTest.shouldHash=[ + "[{0.0.555=d2f10044785bb7ecbfc024a171b28ec877a123a2b6f3b2a48db5595208ea8bd036e4c4babb682d87e06ce62d7c2b1bb3, 0.0.444=38603d6b2a449030ea49b7cbd7e19cd66b4e3f2891ca40df861b4840418cb08575b7ce25426b1192545d352a89f0f3da, }, {0.0.555=74ed3e44b14e41ad5964a52adde1c32932b9dd75f589d0985504bbc483dc778493866ae879769d693e2a6fa80c6a118c, 0.0.444=0939a5cbfb9bbbd545d3e9f961e7fc3bcbf49553ce7e3a00414b5b0964ca9aae0ea878e280efa217503aed65d1057880, }, {0.0.555=9ef69da0531b3828cfc5b14cb5df373ae46922ad192df9d488684b845ce4754b2a20c1e966d2835ea178890fdaac9a00, 0.0.444=1332b1dfb679ea2a91b21de2bed0d086c5139893fce55b0471e2b08ec2e0fbbcee48783eda0a1e876ee0a7086416c26a, }, {0.0.555=e62ca0554d6e40461dbecc035165d35716d61eae59a305414a91a6fb85f36ba3adc1f6b963c429366485fe514407d294, 0.0.444=2deb2d9674c3e238c53080ad4d139f172dc907ba4b898210ed9359f3db92f0880503cca4fec35cd6b47c71ba5dd46aa3, }, {0.0.555=8a7721e7a8d8eede13e0ab5adb5c9520af6099c909592f45f9dc89775f69e16a2bea4a392480f1b750c817787a94099f, 0.0.444=dbb52ed2eea79c5cc58bb0b898ce03f4ee7d4ba6ad94c0d718c0c6b46fd8cea9e2ab76c42221fce44933827e382df57f, }, {0.0.555=0292097e1f3bdd4390134f10b51b2c9928fcfbe4fd54de25d407ee8b93c6ede6dda4c4263786d983de47413f541834e0, 0.0.444=16c12a7acaa5754a1e1adfc40550e5d4b09195c2347dc4fda3882d7a2823dd212ea1682642f211290b8985d45be55a0b, }, {0.0.555=e4c53e598718933cc67491218c478c23be4637e9d89107a3c1699f04143c421fd6bf5f2ff11d31ea646103cd7cd00b57, 0.0.444=5571dfcd8a279d4c33c0e9199c865556ab3aec478ddbc1560dd9c41c53423decb95348fb54b63cbc744fd1e496b2a01f, }, ]" +] + + +com.hiero.sdk.FileAppendTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nfile_append {\n contents: \"\\001\\002\\003\\004\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.FileAppendTransactionTest.shouldSerializeBigContents=[ + "# com.hiero.sdk.proto.TransactionBody\nfile_append {\n contents: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\\n\\nSuspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\\n\\nNunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\\n\\nInteger pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\\n\\nPellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\\n\\nCras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\\n\\nUt interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\\n\\nAenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\\n\\nPellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\\n\\nIn hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\\n\\nVivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\\n\\nDonec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\\n\\nFusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\\n\\nNunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\\n\\nDuis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\\n\\nMauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\\n\\nAenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\\n\\nNunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\\n\\nMauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\\n\\nProin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\\n\\nSuspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\\n\\nIn consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nEtiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\\n\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 444\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java index 9911fb2449..f7e5fe776c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileContentsQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.FileContentsQuery; +import com.hiero.sdk.FileId; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +40,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new FileContentsQuery() .setFileId(FileId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap new file mode 100644 index 0000000000..3838913501 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.FileContentsQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\nfile_get_contents {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java index 45b4c4ea10..e2c3cce498 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java @@ -17,10 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.FileCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.FileCreateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap new file mode 100644 index 0000000000..189f3e1ccb --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.FileCreateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nfile_create {\n contents: \"\\001\\002\\003\\004\"\n expiration_time {\n seconds: 1554158728\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo: \"Hello memo\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java index 437ecb270d..febe7f2be3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.FileDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.FileDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap new file mode 100644 index 0000000000..3c48274d8a --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.FileDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nfile_delete {\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java b/sdk/src/test/java/com/hiero/sdk/FileIdTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java rename to sdk/src/test/java/com/hiero/sdk/FileIdTest.java index cbcf26ab67..fc9ed32e53 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileIdTest.java @@ -17,9 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.FileId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/FileIdTest.snap b/sdk/src/test/java/com/hiero/sdk/FileIdTest.snap new file mode 100644 index 0000000000..bebd6f4749 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileIdTest.snap @@ -0,0 +1,23 @@ +com.hiero.sdk.FileIdTest.fromBytes=[ + "0.0.5005" +] + + +com.hiero.sdk.FileIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +com.hiero.sdk.FileIdTest.shouldSerializeFromString=[ + "0.0.5005" +] + + +com.hiero.sdk.FileIdTest.toBytes=[ + "188d27" +] + + +com.hiero.sdk.FileIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java index 2bb229aac8..312214b18d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.FileId; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +40,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new FileInfoQuery() .setFileId(FileId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap new file mode 100644 index 0000000000..2b6a89ad9c --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.FileInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\nfile_get_info {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java b/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/FileInfoTest.java index 3fbbb64b40..39b15977a5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java @@ -17,11 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.FileGetInfoResponse; -import com.hedera.hashgraph.sdk.proto.KeyList; +import com.hiero.sdk.FileId; +import com.hiero.sdk.FileInfo; +import com.hiero.sdk.InstantConverter; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.proto.FileGetInfoResponse; +import com.hiero.sdk.proto.KeyList; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/FileInfoTest.snap similarity index 50% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/FileInfoTest.snap index f82cadf2ac..62c5bc3c36 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/FileInfoTest.snap @@ -1,18 +1,18 @@ -com.hedera.hashgraph.sdk.FileInfoTest.fromBytes=[ +com.hiero.sdk.FileInfoTest.fromBytes=[ "FileInfo{fileId=0.0.1, size=2, expirationTime=1970-01-01T00:00:00.003Z, isDeleted=true, keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, fileMemo=, ledgerId=mainnet}" ] -com.hedera.hashgraph.sdk.FileInfoTest.fromProtobuf=[ +com.hiero.sdk.FileInfoTest.fromProtobuf=[ "FileInfo{fileId=0.0.1, size=2, expirationTime=1970-01-01T00:00:00.003Z, isDeleted=true, keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, fileMemo=, ledgerId=mainnet}" ] -com.hedera.hashgraph.sdk.FileInfoTest.toBytes=[ +com.hiero.sdk.FileInfoTest.toBytes=[ "0a02180110021a0510c08db70120012a240a221220e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b73a0100" ] -com.hedera.hashgraph.sdk.FileInfoTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.FileGetInfoResponse$FileInfo@e51665b9\ndeleted: true\nexpiration_time {\n nanos: 3000000\n seconds: 0\n}\nfile_i_d {\n file_num: 1\n realm_num: 0\n shard_num: 0\n}\nkeys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nledger_id: \"\\000\"\nsize: 2" -] \ No newline at end of file +com.hiero.sdk.FileInfoTest.toProtobuf=[ + "# com.hiero.sdk.proto.FileGetInfoResponse$FileInfo@e51665b9\ndeleted: true\nexpiration_time {\n nanos: 3000000\n seconds: 0\n}\nfile_i_d {\n file_num: 1\n realm_num: 0\n shard_num: 0\n}\nkeys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nledger_id: \"\\000\"\nsize: 2" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java index 31a32ae718..c23380d23f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FileUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.FileUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileId; +import com.hiero.sdk.FileUpdateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.FileUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap new file mode 100644 index 0000000000..8317211ce2 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.FileUpdateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nfile_update {\n contents: \"\\001\\002\\003\\004\\005\"\n expiration_time {\n seconds: 1554158728\n }\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo {\n value: \"Hello memo\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java index ec14100840..c042cf2a5d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/FreezeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java @@ -17,13 +17,21 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.FreezeTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileId; +import com.hiero.sdk.FreezeTransaction; +import com.hiero.sdk.FreezeType; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.FreezeTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap new file mode 100644 index 0000000000..8ad9655009 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.FreezeTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nfreeze {\n file_hash: \"\\027#\\220E\\207\\022\\t8\\225G\\0024\\230W\"\n freeze_type: TELEMETRY_UPGRADE\n freeze_type_value: 5\n start_time {\n seconds: 1554158542\n }\n update_file {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Function.java b/sdk/src/test/java/com/hiero/sdk/Function.java similarity index 86% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/Function.java rename to sdk/src/test/java/com/hiero/sdk/Function.java index 8169952e10..fe0d78ea06 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Function.java +++ b/sdk/src/test/java/com/hiero/sdk/Function.java @@ -1,4 +1,4 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; public interface Function { /** diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java b/sdk/src/test/java/com/hiero/sdk/HbarTest.java similarity index 98% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java rename to sdk/src/test/java/com/hiero/sdk/HbarTest.java index 584c1df6c9..fe5dc7f927 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/HbarTest.java +++ b/sdk/src/test/java/com/hiero/sdk/HbarTest.java @@ -17,8 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.HbarUnit; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/HederaTrustManagerTest.java b/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/HederaTrustManagerTest.java rename to sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java index af41ae3bef..c2d2b19547 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/HederaTrustManagerTest.java +++ b/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java @@ -17,9 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.HederaTrustManager; +import com.hiero.sdk.LedgerId; import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java b/sdk/src/test/java/com/hiero/sdk/KeyListTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java rename to sdk/src/test/java/com/hiero/sdk/KeyListTest.java index 20fe1397ab..80baf06794 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyListTest.java +++ b/sdk/src/test/java/com/hiero/sdk/KeyListTest.java @@ -1,7 +1,10 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.Key; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.proto.Key; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -32,7 +35,7 @@ void fromProtobuf() { var protoKey1 = Key.newBuilder().setEd25519(ByteString.copyFrom(mTestPublicKey1.toBytes())).build(); var protoKey3 = Key.newBuilder().setEd25519(ByteString.copyFrom(mTestPublicKey2.toBytes())).build(); var protoKey2 = Key.newBuilder().setEd25519(ByteString.copyFrom(mTestPublicKey3.toBytes())).build(); - var protoKeyList = com.hedera.hashgraph.sdk.proto.KeyList.newBuilder() + var protoKeyList = com.hiero.sdk.proto.KeyList.newBuilder() .addAllKeys(List.of(protoKey1, protoKey2, protoKey3)).build(); // When diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyTest.java b/sdk/src/test/java/com/hiero/sdk/KeyTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/KeyTest.java rename to sdk/src/test/java/com/hiero/sdk/KeyTest.java index 4ca77a79e0..15053af587 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/KeyTest.java @@ -17,13 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.Key; -import com.hedera.hashgraph.sdk.proto.KeyList; -import com.hedera.hashgraph.sdk.proto.ThresholdKey; +import com.hiero.sdk.Crypto; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PrivateKeyECDSA; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.PublicKeyECDSA; +import com.hiero.sdk.PublicKeyED25519; +import com.hiero.sdk.proto.Key; +import com.hiero.sdk.proto.KeyList; +import com.hiero.sdk.proto.ThresholdKey; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -31,7 +37,7 @@ import java.math.BigInteger; import java.util.List; -import static com.hedera.hashgraph.sdk.Key.fromBytes; +import static com.hiero.sdk.Key.fromBytes; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -147,12 +153,12 @@ void fromProtoKeyKeyList() { var protoKey = Key.newBuilder().setKeyList(protoKeyList).build(); // when - var cut = com.hedera.hashgraph.sdk.Key.fromProtobufKey(protoKey); + var cut = com.hiero.sdk.Key.fromProtobufKey(protoKey); // then - assertThat(cut.getClass()).isEqualTo(com.hedera.hashgraph.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); - var keyList = (com.hedera.hashgraph.sdk.KeyList) cut; + var keyList = (com.hiero.sdk.KeyList) cut; var actual = keyList.toProtobufKey().getKeyList(); assertThat(actual.getKeysCount()).isEqualTo(2); @@ -179,12 +185,12 @@ void fromProtoKeyThresholdKey() { var protoKey = Key.newBuilder().setThresholdKey(protoThresholdKey).build(); // when - var cut = com.hedera.hashgraph.sdk.Key.fromProtobufKey(protoKey); + var cut = com.hiero.sdk.Key.fromProtobufKey(protoKey); // then - assertThat(cut.getClass()).isEqualTo(com.hedera.hashgraph.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); - var thresholdKey = (com.hedera.hashgraph.sdk.KeyList) cut; + var thresholdKey = (com.hiero.sdk.KeyList) cut; var actual = thresholdKey.toProtobufKey().getThresholdKey(); assertThat(actual.getThreshold()).isEqualTo(1); @@ -199,7 +205,7 @@ void throwsUnsupportedKey() { byte[] keyBytes = {0, 1, 2}; var protoKey = Key.newBuilder().setRSA3072(ByteString.copyFrom(keyBytes)).build(); assertThatExceptionOfType(IllegalStateException.class).isThrownBy( - () -> com.hedera.hashgraph.sdk.Key.fromProtobufKey(protoKey) + () -> com.hiero.sdk.Key.fromProtobufKey(protoKey) ); } @@ -238,7 +244,7 @@ void keyListMethods() { var key3 = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12"); - var keyList = com.hedera.hashgraph.sdk.KeyList.withThreshold(1); + var keyList = com.hiero.sdk.KeyList.withThreshold(1); keyList.add(key1); keyList.addAll(List.of(key2, key3)); @@ -253,7 +259,7 @@ void keyListMethods() { assertThat(arr[1]).isEqualTo(key2); assertThat(arr[2]).isEqualTo(key3); - arr = new com.hedera.hashgraph.sdk.Key[]{null, null, null}; + arr = new com.hiero.sdk.Key[]{null, null, null}; keyList.toArray(arr); assertThat(arr[0]).isEqualTo(key1); assertThat(arr[1]).isEqualTo(key2); @@ -319,9 +325,9 @@ void fromBytesKeyList() throws InvalidProtocolBufferException { var cut = fromBytes(bytes); - assertThat(cut.getClass()).isEqualTo(com.hedera.hashgraph.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); - var keyList = (com.hedera.hashgraph.sdk.KeyList) cut; + var keyList = (com.hiero.sdk.KeyList) cut; var actual = keyList.toProtobufKey().getKeyList(); assertThat(actual.getKeysCount()).isEqualTo(2); @@ -349,9 +355,9 @@ void fromBytesThresholdKey() throws InvalidProtocolBufferException { var cut = fromBytes(bytes); - assertThat(cut.getClass()).isEqualTo(com.hedera.hashgraph.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); - var thresholdKey = (com.hedera.hashgraph.sdk.KeyList) cut; + var thresholdKey = (com.hiero.sdk.KeyList) cut; var actual = thresholdKey.toProtobufKey().getThresholdKey(); assertThat(actual.getThreshold()).isEqualTo(1); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeystoreTest.java b/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/KeystoreTest.java rename to sdk/src/test/java/com/hiero/sdk/KeystoreTest.java index d4922eb8f8..c7a49ba933 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/KeystoreTest.java +++ b/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java @@ -17,8 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.Keystore; +import com.hiero.sdk.PrivateKey; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ListInputTest.java b/sdk/src/test/java/com/hiero/sdk/ListInputTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ListInputTest.java rename to sdk/src/test/java/com/hiero/sdk/ListInputTest.java index c21bd43b9e..e19e79e488 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ListInputTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ListInputTest.java @@ -17,8 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenBurnTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDissociateTransaction; +import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenWipeTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java index 180cb18790..3bd79d56ca 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashAddTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java @@ -1,6 +1,11 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.LiveHashAddTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap new file mode 100644 index 0000000000..e156af428b --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.LiveHashAddTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_add_live_hash {\n live_hash {\n account_id {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 2592000\n }\n hash: \"hash\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java index 1fc0a7a86c..dd9f70585a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java @@ -1,6 +1,11 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.LiveHashDeleteTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap new file mode 100644 index 0000000000..f9223e1d88 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.LiveHashDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\ncrypto_delete_live_hash {\n account_of_live_hash {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n live_hash_to_delete: \"hash\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java b/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java similarity index 80% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java index 5bc859aab2..1db655aabd 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/LiveHashQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java @@ -1,6 +1,8 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.LiveHashQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -21,7 +23,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new LiveHashQuery() .setAccountId(AccountId.fromString("0.0.100")) .setHash(hash) diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap new file mode 100644 index 0000000000..780c3a122d --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.LiveHashQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ncrypto_get_live_hash {\n account_i_d {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n hash: \"\\000\\001\\002\"\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MaxQueryPaymentExceededExceptionTest.java b/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/MaxQueryPaymentExceededExceptionTest.java rename to sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java index 96200bcd63..b51fe5ae14 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MaxQueryPaymentExceededExceptionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java @@ -17,8 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxQueryPaymentExceededException; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java index 390bffa9dd..5de78e8887 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MessageSubmitTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java @@ -17,10 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ConsensusSubmitMessageTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FreezeTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.TopicMessageSubmitTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap new file mode 100644 index 0000000000..882564a254 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.MessageSubmitTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nconsensus_submit_message {\n message: \"hello\"\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MirrorNodeContractQueryTest.java b/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/MirrorNodeContractQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java index 888672bd1c..869d176138 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MirrorNodeContractQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -27,6 +27,12 @@ import com.google.gson.JsonObject; import com.google.protobuf.ByteString; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.MirrorNodeContractCallQuery; +import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import com.hiero.sdk.MirrorNodeContractQuery; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MirrorNodeContractQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.snap similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/MirrorNodeContractQueryTest.snap rename to sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.snap index 2394e7ccfa..cc85b80081 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MirrorNodeContractQueryTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.snap @@ -1,3 +1,3 @@ -com.hedera.hashgraph.sdk.MirrorNodeContractQueryTest.shouldSerialize=[ +com.hiero.sdk.MirrorNodeContractQueryTest.shouldSerialize=[ "MirrorNodeContractEstimateGasQuery{contractId=null, contractEvmAddress='0x1234567890abcdef1234567890abcdef12345678', sender=null, senderEvmAddress='0xabcdefabcdefabcdefabcdefabcdefabcdef', callData=[116, 101, 115, 116, 68, 97, 116, 97], value=1000, gasLimit=500000, gasPrice=20, blockNumber=123456}MirrorNodeContractCallQuery{contractId=null, contractEvmAddress='0x1234567890abcdef1234567890abcdef12345678', sender=null, senderEvmAddress='0xabcdefabcdefabcdefabcdefabcdefabcdef', callData=[116, 101, 115, 116, 68, 97, 116, 97], value=1000, gasLimit=500000, gasPrice=20, blockNumber=123456}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MnemonicTest.java b/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java similarity index 99% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/MnemonicTest.java rename to sdk/src/test/java/com/hiero/sdk/MnemonicTest.java index 9cac6a7c63..6e88f91d06 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MnemonicTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java @@ -17,9 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.utils.Bip32Utils; +import com.hiero.sdk.BadMnemonicException; +import com.hiero.sdk.BadMnemonicReason; +import com.hiero.sdk.Mnemonic; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.utils.Bip32Utils; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java b/sdk/src/test/java/com/hiero/sdk/Mocker.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java rename to sdk/src/test/java/com/hiero/sdk/Mocker.java index 211b82926d..77d0618c54 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Mocker.java +++ b/sdk/src/test/java/com/hiero/sdk/Mocker.java @@ -17,15 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.logger.LogLevel; -import com.hedera.hashgraph.sdk.logger.Logger; -import com.hedera.hashgraph.sdk.proto.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; +import com.hiero.sdk.proto.ConsensusServiceGrpc; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import io.grpc.Server; import io.grpc.ServerMethodDefinition; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java b/sdk/src/test/java/com/hiero/sdk/MockingTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java rename to sdk/src/test/java/com/hiero/sdk/MockingTest.java index 7bd857deef..92709f5e89 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/MockingTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MockingTest.java @@ -17,28 +17,48 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.AccountID; -import com.hedera.hashgraph.sdk.proto.CryptoGetAccountBalanceResponse; -import com.hedera.hashgraph.sdk.proto.CryptoGetInfoResponse; -import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc; -import com.hedera.hashgraph.sdk.proto.FileServiceGrpc; -import com.hedera.hashgraph.sdk.proto.Query; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; -import com.hedera.hashgraph.sdk.proto.ResponseHeader; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.SmartContractServiceGrpc; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionGetReceiptResponse; -import com.hedera.hashgraph.sdk.proto.TransactionGetRecordResponse; -import com.hedera.hashgraph.sdk.proto.TransactionReceipt; -import com.hedera.hashgraph.sdk.proto.TransactionRecord; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.AccountBalance; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountInfoFlow; +import com.hiero.sdk.ContractCreateFlow; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.FileAppendTransaction; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxAttemptsExceededException; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionReceiptQuery; +import com.hiero.sdk.proto.AccountID; +import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse; +import com.hiero.sdk.proto.CryptoGetInfoResponse; +import com.hiero.sdk.proto.CryptoServiceGrpc; +import com.hiero.sdk.proto.FileServiceGrpc; +import com.hiero.sdk.proto.Query; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.proto.ResponseHeader; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.SmartContractServiceGrpc; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionGetReceiptResponse; +import com.hiero.sdk.proto.TransactionGetRecordResponse; +import com.hiero.sdk.proto.TransactionReceipt; +import com.hiero.sdk.proto.TransactionRecord; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; import io.grpc.stub.StreamObserver; import org.junit.jupiter.api.Assertions; @@ -96,10 +116,10 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetReceipt(St var server = new TestServer("getReceiptRetry" + sync, service); server.client.setMaxAttempts(3); - service.buffer.enqueueResponse(TestResponse.transaction(com.hedera.hashgraph.sdk.Status.PLATFORM_NOT_ACTIVE)); + service.buffer.enqueueResponse(TestResponse.transaction(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)); service.buffer.enqueueResponse(TestResponse.transactionOk()); - com.hedera.hashgraph.sdk.TransactionResponse transactionResponse; + com.hiero.sdk.TransactionResponse transactionResponse; if (sync.equals("sync")) { transactionResponse = new AccountCreateTransaction().execute(server.client); } else { @@ -115,7 +135,7 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetReceipt(St .build() ).build() )) - .enqueueResponse(TestResponse.receipt(com.hedera.hashgraph.sdk.Status.PLATFORM_NOT_ACTIVE)) + .enqueueResponse(TestResponse.receipt(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)) .enqueueResponse(TestResponse.successfulReceipt()); if (sync.equals("sync")) { @@ -132,10 +152,10 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetRecord(Str var server = new TestServer("getRecordRetry" + sync, service); server.client.setMaxAttempts(3); - service.buffer.enqueueResponse(TestResponse.transaction(com.hedera.hashgraph.sdk.Status.PLATFORM_NOT_ACTIVE)); + service.buffer.enqueueResponse(TestResponse.transaction(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)); service.buffer.enqueueResponse(TestResponse.transactionOk()); - com.hedera.hashgraph.sdk.TransactionResponse transactionResponse; + com.hiero.sdk.TransactionResponse transactionResponse; if (sync.equals("sync")) { transactionResponse = new AccountCreateTransaction().execute(server.client); } else { @@ -246,11 +266,11 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws Assertions.assertEquals(3, cryptoService.buffer.queryRequestsReceived.size()); Assertions.assertEquals(3, fileService.buffer.transactionRequestsReceived.size()); Assertions.assertEquals(1, contractService.buffer.transactionRequestsReceived.size()); - var transactions = new ArrayList>(); + var transactions = new ArrayList>(); for (var request : fileService.buffer.transactionRequestsReceived) { - transactions.add(com.hedera.hashgraph.sdk.Transaction.fromBytes(request.toByteArray())); + transactions.add(com.hiero.sdk.Transaction.fromBytes(request.toByteArray())); } - transactions.add(com.hedera.hashgraph.sdk.Transaction.fromBytes( + transactions.add(com.hiero.sdk.Transaction.fromBytes( contractService.buffer.transactionRequestsReceived.get(0).toByteArray() )); @@ -496,7 +516,7 @@ void hitsTxMaxAttemptsCorrectly(Integer numberOfErrors, Integer maxAttempts, Str "PLATFORM_TRANSACTION_NOT_CREATED, 3, async", "TRANSACTION_EXPIRED, 3, async" }) - void shouldRetryFunctionsCorrectly(com.hedera.hashgraph.sdk.Status status, int numberOfErrors, String sync) throws Exception { + void shouldRetryFunctionsCorrectly(com.hiero.sdk.Status status, int numberOfErrors, String sync) throws Exception { var service = new TestCryptoService(); var server = new TestServer("shouldRetryFunctionsCorrectly" + status + numberOfErrors + sync, service); @@ -534,7 +554,7 @@ void shouldRetryFunctionsCorrectly(com.hedera.hashgraph.sdk.Status status, int n "PLATFORM_TRANSACTION_NOT_CREATED, async", "PLATFORM_NOT_ACTIVE, async", }) - void hitsClientMaxAttemptsCorrectly(com.hedera.hashgraph.sdk.Status status, String sync) throws Exception { + void hitsClientMaxAttemptsCorrectly(com.hiero.sdk.Status status, String sync) throws Exception { var service = new TestCryptoService(); var server = new TestServer("shouldRetryFunctionsCorrectly" + status + sync, service); @@ -606,9 +626,9 @@ void defaultMaxTransactionFeeTest() throws Exception { .execute(server.client); Assertions.assertEquals(4, service.buffer.transactionRequestsReceived.size()); - var transactions = new ArrayList>(); + var transactions = new ArrayList>(); for (var request : service.buffer.transactionRequestsReceived) { - transactions.add(com.hedera.hashgraph.sdk.Transaction.fromBytes(request.toByteArray())); + transactions.add(com.hiero.sdk.Transaction.fromBytes(request.toByteArray())); } Assertions.assertEquals(new Hbar(2), transactions.get(0).getMaxTransactionFee()); Assertions.assertEquals(new Hbar(5), transactions.get(1).getMaxTransactionFee()); @@ -699,7 +719,7 @@ void canCancelExecuteAsync() throws Exception { TransactionGetReceiptResponse.newBuilder() .setHeader( ResponseHeader.newBuilder() - .setNodeTransactionPrecheckCode(com.hedera.hashgraph.sdk.Status.RECEIPT_NOT_FOUND.code) + .setNodeTransactionPrecheckCode(com.hiero.sdk.Status.RECEIPT_NOT_FOUND.code) ) ).build() ); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.java similarity index 82% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.java index d05f3fec6f..2613ae582d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.java @@ -1,8 +1,10 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.QueryHeader; -import com.hedera.hashgraph.sdk.proto.Transaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NetworkVersionInfoQuery; +import com.hiero.sdk.proto.QueryHeader; +import com.hiero.sdk.proto.Transaction; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -21,7 +23,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new NetworkVersionInfoQuery() .setMaxQueryPayment(Hbar.fromTinybars(100_000)) .onMakeRequest( diff --git a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap new file mode 100644 index 0000000000..176369a5d9 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.NetworkVersionInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\nnetwork_get_version_info {\n header {\n payment {\n signed_transaction_bytes: \"\\336\\255\\276\\357\"\n }\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.java index 3920aa6b39..1fa7becdbb 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NetworkVersionInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.java @@ -1,5 +1,7 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.NetworkVersionInfo; +import com.hiero.sdk.SemanticVersion; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap new file mode 100644 index 0000000000..0b585e931c --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.NetworkVersionInfoTest.shouldSerialize=[ + "com.hiero.sdk.NetworkVersionInfo" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java b/sdk/src/test/java/com/hiero/sdk/NftIdTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java rename to sdk/src/test/java/com/hiero/sdk/NftIdTest.java index cb313d93f7..aca213b80d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NftIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NftIdTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.Client; +import com.hiero.sdk.NftId; +import com.hiero.sdk.TokenId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/NftIdTest.snap b/sdk/src/test/java/com/hiero/sdk/NftIdTest.snap new file mode 100644 index 0000000000..3f39bd22b9 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/NftIdTest.snap @@ -0,0 +1,33 @@ +com.hiero.sdk.NftIdTest.fromBytes=[ + "0.0.5005/574489" +] + + +com.hiero.sdk.NftIdTest.fromString2=[ + "0.0.5005/1234" +] + + +com.hiero.sdk.NftIdTest.fromString=[ + "0.0.5005/1234" +] + + +com.hiero.sdk.NftIdTest.fromStringWithChecksumOnMainnet=[ + "0.0.123-vfmkw/7584" +] + + +com.hiero.sdk.NftIdTest.fromStringWithChecksumOnPreviewnet=[ + "0.0.123-ogizo/487302" +] + + +com.hiero.sdk.NftIdTest.fromStringWithChecksumOnTestnet=[ + "0.0.123-esxsf/584903" +] + + +com.hiero.sdk.NftIdTest.toBytes=[ + "0a03188d2710b826" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.java index b08f4f90bd..c03be4442b 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.java @@ -17,15 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.NodeCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Endpoint; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NodeCreateTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.NodeCreateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap new file mode 100644 index 0000000000..b21a01b450 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.NodeCreateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_create {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description: \"Test description\"\n gossip_ca_certificate: \"\\000\\001\\002\\003\\004\"\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash: \"\\005\\006\\a\\b\\t\"\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java index 9aff4aaf79..1164e4d2e6 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java @@ -17,14 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hedera.hashgraph.sdk.proto.NodeDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NodeDeleteTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.NodeDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap new file mode 100644 index 0000000000..14a521e4c4 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.NodeDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_delete {\n node_id: 420\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java index 3ce37b29dc..46330c7de5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -25,9 +25,17 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.NodeUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Endpoint; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NodeUpdateTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.NodeUpdateTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap new file mode 100644 index 0000000000..9d5b085893 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.NodeUpdateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_update {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description {\n value: \"Test description\"\n }\n gossip_ca_certificate {\n value: \"\\000\\001\\002\\003\\004\"\n }\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash {\n value: \"\\005\\006\\a\\b\\t\"\n }\n node_id: 420\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/PendingAirdropIdTest.java b/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/PendingAirdropIdTest.java rename to sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java index 8ecbdc6f16..aae431a4ff 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/PendingAirdropIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java @@ -18,13 +18,17 @@ * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PendingAirdropId; +import com.hiero.sdk.TokenId; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -97,7 +101,7 @@ void testSetNftId() { @Test void testToProtobufWithTokenId() { PendingAirdropId pendingAirdropId = new PendingAirdropId(sender, receiver, tokenId); - com.hedera.hashgraph.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); + com.hiero.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); assertNotNull(proto); assertEquals(sender.toProtobuf(), proto.getSenderId()); @@ -108,7 +112,7 @@ void testToProtobufWithTokenId() { @Test void testToProtobufWithNftId() { PendingAirdropId pendingAirdropId = new PendingAirdropId(sender, receiver, nftId); - com.hedera.hashgraph.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); + com.hiero.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); assertNotNull(proto); assertEquals(sender.toProtobuf(), proto.getSenderId()); @@ -118,7 +122,7 @@ void testToProtobufWithNftId() { @Test void testFromProtobufWithTokenId() { - com.hedera.hashgraph.sdk.proto.PendingAirdropId proto = com.hedera.hashgraph.sdk.proto.PendingAirdropId.newBuilder() + com.hiero.sdk.proto.PendingAirdropId proto = com.hiero.sdk.proto.PendingAirdropId.newBuilder() .setSenderId(sender.toProtobuf()) .setReceiverId(receiver.toProtobuf()) .setFungibleTokenType(tokenId.toProtobuf()) @@ -135,7 +139,7 @@ void testFromProtobufWithTokenId() { @Test void testFromProtobufWithNftId() { - com.hedera.hashgraph.sdk.proto.PendingAirdropId proto = com.hedera.hashgraph.sdk.proto.PendingAirdropId.newBuilder() + com.hiero.sdk.proto.PendingAirdropId proto = com.hiero.sdk.proto.PendingAirdropId.newBuilder() .setSenderId(sender.toProtobuf()) .setReceiverId(receiver.toProtobuf()) .setNonFungibleToken(nftId.toProtobuf()) diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java b/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java rename to sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java index d527c33362..c575079c2e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrivateKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java @@ -17,9 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java index 948076080a..a471e4d447 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/PrngTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java @@ -17,8 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PrngTransaction; +import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap new file mode 100644 index 0000000000..992751a36b --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.PrngTransactionTest.shouldSerialize2=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n range: 100\n}" +] + + +com.hiero.sdk.PrngTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java b/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java similarity index 77% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java rename to sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java index 0ab2f70eb9..69490dd5a6 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ProxyStakerTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java @@ -1,6 +1,7 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ProxyStaker; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.proto.ProxyStaker; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -24,7 +25,7 @@ public static void afterAll() { @Test void fromProtobuf() { - SnapshotMatcher.expect(com.hedera.hashgraph.sdk.ProxyStaker.fromProtobuf(proxyStaker).toString()) + SnapshotMatcher.expect(com.hiero.sdk.ProxyStaker.fromProtobuf(proxyStaker).toString()) .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap b/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap new file mode 100644 index 0000000000..e56fbd1b71 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ProxyStakerTest.fromProtobuf=[ + "ProxyStaker{accountId=0.0.100, amount=10 tℏ}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java b/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java similarity index 74% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java rename to sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java index 650814f086..9b7a4fa4ff 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ReceiptStatusExceptionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java @@ -1,6 +1,10 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionReceipt; +import com.hiero.sdk.proto.ResponseCodeEnum; import org.junit.jupiter.api.Test; import java.time.Instant; @@ -14,7 +18,7 @@ void shouldHaveMessage() { var validStart = Instant.ofEpochSecond(1554158542); var txId = new TransactionId(new AccountId(0, 0, 100), validStart); var txReceipt = TransactionReceipt.fromProtobuf( - com.hedera.hashgraph.sdk.proto.TransactionReceipt + com.hiero.sdk.proto.TransactionReceipt .newBuilder() .setStatusValue(ResponseCodeEnum.INSUFFICIENT_TX_FEE_VALUE) .build()); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/RegenerateTransactionIdsTest.java b/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/RegenerateTransactionIdsTest.java rename to sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java index 7bd7ccaa21..953df0dd07 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/RegenerateTransactionIdsTest.java +++ b/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java @@ -17,13 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java b/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java rename to sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java index 13b2f92c0d..290a8e28f4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/RequestTypeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java @@ -1,6 +1,7 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.HederaFunctionality; +import com.hiero.sdk.RequestType; +import com.hiero.sdk.proto.HederaFunctionality; import org.junit.jupiter.api.Test; import java.util.Map; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java index 2eae10a1f2..3d9e1231f1 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java @@ -17,8 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ScheduleCreateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap new file mode 100644 index 0000000000..b821d28d4f --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ScheduleCreateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_create {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n expiration_time {\n seconds: 1554158542\n }\n memo: \"hi\"\n payer_account_i_d {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n scheduled_transaction_body {\n crypto_transfer {\n transfers {\n account_amounts {\n account_i_d {\n account_num: 333\n realm_num: 0\n shard_num: 0\n }\n amount: 1000000000\n }\n account_amounts {\n account_i_d {\n account_num: 555\n realm_num: 0\n shard_num: 0\n }\n amount: -1000000000\n }\n }\n }\n transaction_fee: 100000000\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java index 9d61c9c15f..70b0917ce7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.ScheduleDeleteTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ScheduleDeleteTransaction; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.ScheduleDeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap new file mode 100644 index 0000000000..98969d291f --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ScheduleDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_delete {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java index 31d584475e..c8fe4949c0 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.ScheduleInfoQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +41,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new ScheduleInfoQuery() .setScheduleId(ScheduleId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap new file mode 100644 index 0000000000..9d76470d77 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ScheduleInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\nschedule_get_info {\n header {\n }\n schedule_i_d {\n realm_num: 0\n schedule_num: 5005\n shard_num: 0\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java index 4f15f7c45b..a4f58e8fd2 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java @@ -1,7 +1,15 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.ScheduleInfo; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.CryptoDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.snap similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.snap index 68bdcb1db6..abd42d9a89 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.snap @@ -1,8 +1,8 @@ -com.hedera.hashgraph.sdk.ScheduleInfoTest.shouldSerialize=[ +com.hiero.sdk.ScheduleInfoTest.shouldSerialize=[ "ScheduleInfo{scheduleId=1.2.3, scheduledTransactionId=0.0.5006.000000000, creatorAccountId=4.5.6, payerAccountId=2.3.4, signatories=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, expirationTime=2019-04-01T22:42:22Z, memo=memo, executedAt=2019-04-01T22:42:22Z, deletedAt=null, ledgerId=testnet, waitForExpiry=true}" ] -com.hedera.hashgraph.sdk.ScheduleInfoTest.shouldSerializeDeleted=[ +com.hiero.sdk.ScheduleInfoTest.shouldSerializeDeleted=[ "ScheduleInfo{scheduleId=1.2.3, scheduledTransactionId=0.0.5006.000000000, creatorAccountId=4.5.6, payerAccountId=2.3.4, signatories=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, expirationTime=2019-04-01T22:42:22Z, memo=memo, executedAt=null, deletedAt=2019-04-01T22:42:22Z, ledgerId=testnet, waitForExpiry=true}" ] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java index 6a98e11a6c..60bbee85c5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/ScheduleSignTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java @@ -17,8 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.ScheduleSignTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap new file mode 100644 index 0000000000..553484a7f9 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.ScheduleSignTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_sign {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/Snapshot.java b/sdk/src/test/java/com/hiero/sdk/Snapshot.java similarity index 98% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/Snapshot.java rename to sdk/src/test/java/com/hiero/sdk/Snapshot.java index 8487204e85..50255565d7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/Snapshot.java +++ b/sdk/src/test/java/com/hiero/sdk/Snapshot.java @@ -1,4 +1,4 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java b/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java index e4af2fdcd4..a699493fc9 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java @@ -1,5 +1,8 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.StakingInfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.snap similarity index 71% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/StakingInfoTest.snap index 144277bc1f..f98a1e9bd4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/StakingInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.snap @@ -1,8 +1,8 @@ -com.hedera.hashgraph.sdk.StakingInfoTest.shouldSerializeAccount=[ +com.hiero.sdk.StakingInfoTest.shouldSerializeAccount=[ "StakingInfo{declineStakingReward=true, stakePeriodStart=2019-04-01T22:42:22Z, pendingReward=5 ℏ, stakedToMe=10 ℏ, stakedAccountId=1.2.3, stakedNodeId=null}" ] -com.hedera.hashgraph.sdk.StakingInfoTest.shouldSerializeNode=[ +com.hiero.sdk.StakingInfoTest.shouldSerializeNode=[ "StakingInfo{declineStakingReward=true, stakePeriodStart=2019-04-01T22:42:22Z, pendingReward=5 ℏ, stakedToMe=10 ℏ, stakedAccountId=null, stakedNodeId=3}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/StatusTest.java b/sdk/src/test/java/com/hiero/sdk/StatusTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/StatusTest.java rename to sdk/src/test/java/com/hiero/sdk/StatusTest.java index cc44244e1b..3e846477a4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/StatusTest.java +++ b/sdk/src/test/java/com/hiero/sdk/StatusTest.java @@ -17,9 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum; +import com.hiero.sdk.Status; +import com.hiero.sdk.proto.ResponseCodeEnum; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java index 8020fb58e8..1788a4aee1 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java @@ -17,16 +17,24 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SystemDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.TimestampSeconds; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ScheduleDeleteTransaction; +import com.hiero.sdk.SystemDeleteTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SystemDeleteTransactionBody; +import com.hiero.sdk.proto.TimestampSeconds; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap new file mode 100644 index 0000000000..c0ea93ae92 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.SystemDeleteTransactionTest.shouldSerializeContract=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n seconds: 1554158542\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.SystemDeleteTransactionTest.shouldSerializeFile=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n expiration_time {\n seconds: 1554158542\n }\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java index 7f29d55d84..4ecff01844 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/SystemUndeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java @@ -17,10 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.SystemUndeleteTransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ScheduleDeleteTransaction; +import com.hiero.sdk.SystemUndeleteTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.SystemUndeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap new file mode 100644 index 0000000000..a07e93154e --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.SystemUndeleteTransactionTest.shouldSerializeContract=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.SystemUndeleteTransactionTest.shouldSerializeFile=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestResponse.java b/sdk/src/test/java/com/hiero/sdk/TestResponse.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TestResponse.java rename to sdk/src/test/java/com/hiero/sdk/TestResponse.java index 7dadb11075..b7672793ad 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestResponse.java +++ b/sdk/src/test/java/com/hiero/sdk/TestResponse.java @@ -17,12 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.TransactionGetReceiptResponse; -import com.hedera.hashgraph.sdk.proto.TransactionReceipt; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.Status; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.TransactionGetReceiptResponse; +import com.hiero.sdk.proto.TransactionReceipt; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; import javax.annotation.Nullable; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java b/sdk/src/test/java/com/hiero/sdk/TestServer.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java rename to sdk/src/test/java/com/hiero/sdk/TestServer.java index 62bbaefe49..70a8ad325e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestServer.java +++ b/sdk/src/test/java/com/hiero/sdk/TestServer.java @@ -17,8 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.PrivateKey; import io.grpc.BindableService; import io.grpc.Server; import io.grpc.inprocess.InProcessServerBuilder; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestService.java b/sdk/src/test/java/com/hiero/sdk/TestService.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TestService.java rename to sdk/src/test/java/com/hiero/sdk/TestService.java index 7b12d5e66b..74a06b5ebd 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TestService.java +++ b/sdk/src/test/java/com/hiero/sdk/TestService.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.Query; -import com.hedera.hashgraph.sdk.proto.Response; -import com.hedera.hashgraph.sdk.proto.Transaction; -import com.hedera.hashgraph.sdk.proto.TransactionResponse; +import com.hiero.sdk.proto.Query; +import com.hiero.sdk.proto.Response; +import com.hiero.sdk.proto.Transaction; +import com.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java index f0389ce68b..31448216ce 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAirdropTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -25,9 +25,18 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenAirdropTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenAirdropTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenNftTransfer; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenAirdropTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap new file mode 100644 index 0000000000..e929d51f35 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenAirdropTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_airdrop {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n nft_transfers {\n is_approval: true\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: 123\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java index 9a38876103..45dfcf3868 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAllowanceTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java @@ -1,5 +1,8 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.TokenAllowance; +import com.hiero.sdk.TokenId; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java index 6fd0295db7..a416d40d1e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenAssociateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenAssociateTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap new file mode 100644 index 0000000000..6ea2349de8 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenAssociateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_associate {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n tokens {\n realm_num: 0\n shard_num: 0\n token_num: 666\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java index d2adbfee70..b17332940a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenAssociationTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java @@ -1,6 +1,9 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.TokenAssociation; +import com.hiero.sdk.TokenId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap new file mode 100644 index 0000000000..dcb4715ca5 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenAssociationTest.shouldSerializeAccount=[ + "TokenAssociation{tokenId=1.2.3, accountId=4.5.6}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java index e62fce3893..75d5b2b679 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenBurnTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenBurnTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenBurnTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenBurnTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap new file mode 100644 index 0000000000..afdec5cce2 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.TokenBurnTransactionTest.shouldSerializeFungible=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 69\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.TokenBurnTransactionTest.shouldSerializeNft=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 0\n serial_numbers: 420\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java index be4cbcddb0..fa996c0fab 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCancelAirdropTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java @@ -17,14 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenCancelAirdropTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PendingAirdropId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenCancelAirdropTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenCancelAirdropTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap new file mode 100644 index 0000000000..03cd3aea82 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenCancelAirdropTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_cancel_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java index 2a912ae733..1cdb201e52 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenClaimAirdropTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java @@ -17,14 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenClaimAirdropTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenServiceGrpc; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PendingAirdropId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenClaimAirdropTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenClaimAirdropTransactionBody; +import com.hiero.sdk.proto.TokenServiceGrpc; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap new file mode 100644 index 0000000000..4d1e4ebf65 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenClaimAirdropTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_claim_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java index e7c4640d5b..7161a8e4d8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java @@ -17,17 +17,29 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TokenCreateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TokenCreateTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; @@ -167,7 +179,7 @@ void constructTokenCreateTransactionFungibleFromTransactionBodyProtobuf() { .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()).setSupplyKey(testSupplyKey.toProtobufKey()) .setAdminKey(testAdminKey.toProtobufKey()).setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) .setAutoRenewPeriod( - com.hedera.hashgraph.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) + com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) .build()).setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) .setDecimals(testDecimals).setFreezeDefault(testFreezeDefault).setFreezeKey(testFreezeKey.toProtobufKey()) .setWipeKey(testWipeKey.toProtobufKey()).setSymbol(testTokenSymbol).setKycKey(testKycKey.toProtobufKey()) @@ -210,10 +222,10 @@ void constructTokenCreateTransactionNftFromTransactionBodyProtobuf() { .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()).setSupplyKey(testSupplyKey.toProtobufKey()) .setMaxSupply(testMaxSupply).setAdminKey(testAdminKey.toProtobufKey()) .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()).setAutoRenewPeriod( - com.hedera.hashgraph.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) + com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) .build()).setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) - .setTokenType(com.hedera.hashgraph.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE) - .setSupplyType(com.hedera.hashgraph.sdk.proto.TokenSupplyType.FINITE) + .setTokenType(com.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE) + .setSupplyType(com.hiero.sdk.proto.TokenSupplyType.FINITE) .setFreezeKey(testFreezeKey.toProtobufKey()).setWipeKey(testWipeKey.toProtobufKey()) .setSymbol(testTokenSymbol).setKycKey(testKycKey.toProtobufKey()).setPauseKey(testPauseKey.toProtobufKey()) .setMetadataKey(testMetadataKey.toProtobufKey()) diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap new file mode 100644 index 0000000000..8ff80fb208 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.TokenCreateTransactionTest.shouldSerializeFungible=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 543\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 3\n denominating_token_id {\n realm_num: 3\n shard_num: 4\n token_num: 2\n }\n }\n }\n decimals: 3\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_default: true\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 30\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 0\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.TokenCreateTransactionTest.shouldSerializeNft=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 0\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 500\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n supply_type: FINITE\n supply_type_value: 1\n symbol: \"test symbol\"\n token_type: NON_FUNGIBLE_UNIQUE\n token_type_value: 1\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java index c7f22095fd..2a04834b2e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenDeleteTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap new file mode 100644 index 0000000000..8de52185d9 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_deletion {\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java index 16733ec733..5844d31fa0 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenDissociateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenDissociateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenDissociateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenDissociateTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap new file mode 100644 index 0000000000..cf7c1596d7 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenDissociateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_dissociate {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 1\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 2\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java index 1ec0049d50..01e8709655 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFeeScheduleUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java @@ -17,11 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenFeeScheduleUpdateTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.FeeAssessmentMethod; +import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap new file mode 100644 index 0000000000..9a65ab46d8 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenFeeScheduleUpdateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_fee_schedule_update {\n custom_fees {\n fee_collector_account_id {\n account_num: 4322\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 10\n denominating_token_id {\n realm_num: 0\n shard_num: 0\n token_num: 483902\n }\n }\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 389042\n realm_num: 0\n shard_num: 0\n }\n fractional_fee {\n fractional_amount {\n denominator: 7\n numerator: 3\n }\n maximum_amount: 100\n minimum_amount: 3\n net_of_transfers: true\n }\n }\n token_id {\n realm_num: 0\n shard_num: 0\n token_num: 8798\n }\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java index 82a064723f..4298c7a853 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenFreezeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenFreezeAccountTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenFreezeTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenFreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap new file mode 100644 index 0000000000..afa0e2a6b3 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenFreezeTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_freeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java index 3131d761ce..e9148b5963 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenGrantKycTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenGrantKycTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenGrantKycTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenGrantKycTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap new file mode 100644 index 0000000000..d9dc6b4c4a --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenGrantKycTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_grant_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java index 5579b4e359..269b886d59 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java @@ -17,9 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenInfoQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -42,7 +45,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new TokenInfoQuery().setTokenId(testTokenId).setMaxQueryPayment(Hbar.fromTinybars(100_000)) .onMakeRequest(builder, QueryHeader.newBuilder().build()); SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap new file mode 100644 index 0000000000..b542f14a69 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ntoken_get_info {\n header {\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java b/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java index 6e0dfa52fc..6ea17b1557 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java @@ -17,9 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenInfo; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -232,9 +243,9 @@ void toProtobuf() { testExpirationTime.getEpochSecond()); assertThat(tokenInfoProto.getTokenInfo().getMemo()).isEqualTo(testTokenMemo); assertThat(tokenInfoProto.getTokenInfo().getTokenType()).isEqualTo( - com.hedera.hashgraph.sdk.proto.TokenType.valueOf(testTokenType.name())); + com.hiero.sdk.proto.TokenType.valueOf(testTokenType.name())); assertThat(tokenInfoProto.getTokenInfo().getSupplyType()).isEqualTo( - com.hedera.hashgraph.sdk.proto.TokenSupplyType.valueOf(testTokenSupplyType.name())); + com.hiero.sdk.proto.TokenSupplyType.valueOf(testTokenSupplyType.name())); assertThat(tokenInfoProto.getTokenInfo().getMaxSupply()).isEqualTo(testTokenMaxSupply); assertThat(tokenInfoProto.getTokenInfo().getFeeScheduleKey().getEd25519().toByteArray()).isEqualTo( testFeeScheduleKey.toBytesRaw()); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.snap similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/TokenInfoTest.snap index 6ad928bd08..904d2c4049 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.snap @@ -1,3 +1,3 @@ -com.hedera.hashgraph.sdk.TokenInfoTest.shouldSerialize=[ +com.hiero.sdk.TokenInfoTest.shouldSerialize=[ "TokenInfo{tokenId=0.6.9, name=test token name, symbol=TTN, decimals=3, totalSupply=1000, treasuryAccountId=7.7.7, adminKey=302a300506032b6570032100da87701097866e73f0dd942cbb3e97063329f905588621b178d21759688d47fc, kycKey=302a300506032b6570032100fb88b337dfd765617be4322ae7ef8533d61e6483050e20ec4845a533bddca4b1, freezeKey=302a300506032b65700321003ded53e32233532f3d8462324cd113abbe4f73216df06d54a11cb691c15b27cd, wipeKey=302a300506032b6570032100525b9c155f902b912dbd81bea6d43a077d7a62dd1fefcfc77de96144d5fac3ee, supplyKey=302a300506032b65700321003b913853afa59b55abc581c2ac0d36580ac2eca4bd101c02173fef02e677ddd5, feeScheduleKey=302a300506032b65700321004bbe95a86d24f8f96773b12826fcbe009688cb0dca88cff117a3a8af50c37113, defaultFreezeStatus=true, defaultKycStatus=true, isDeleted=false, autoRenewAccount=8.9.0, autoRenewPeriod=PT10H, expirationTime=2019-04-01T22:42:22Z, tokenMemo=memo, customFees=[CustomFixedFee{feeCollectorAccountId=0.0.4322, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}, CustomFractionalFee{feeCollectorAccountId=0.0.389042, allCollectorsAreExempt=false, numerator=3, denominator=7, min=3, max=100, assessmentMethod=INCLUSIVE}], tokenType=FUNGIBLE_COMMON, supplyType=FINITE, maxSupply=1000000, pauseKey=302a300506032b6570032100d16865a98cf8b0b7f8fa3776b20dafc5be04ffeb9a2497720783ce991e2b1974, pauseStatus=true, metadata=[1, 2, 3, 4, 5], metadataKey=302a300506032b6570032100146dec92320a6e46eb1a43767bb1ec95a2e6c0251ab0dd780fe37474d4bac415, ledgerId=mainnet}" ] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java index 4dd1ab71c3..b0ffc29a4a 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenMintTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java @@ -1,10 +1,18 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenUpdateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenMintTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap new file mode 100644 index 0000000000..35a7a1c651 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.TokenMintTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.TokenMintTransactionTest.shouldSerializeMetadata=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 0\n metadata: \"\\001\\002\\003\\004\\005\"\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java similarity index 85% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java index d3910563ed..4890920251 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java @@ -1,6 +1,10 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenNftInfoQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -21,7 +25,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new TokenNftInfoQuery() .setNftId(TokenId.fromString("0.0.5005").nft(101)) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap new file mode 100644 index 0000000000..85148c5795 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenNftInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ntoken_get_nft_info {\n header {\n }\n nft_i_d {\n serial_number: 101\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 5005\n }\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java index 4d290be154..f190ebf480 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java @@ -1,5 +1,9 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenNftInfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.snap similarity index 70% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.snap index 4b4007c092..ff92edc2a1 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenNftInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.snap @@ -1,8 +1,8 @@ -com.hedera.hashgraph.sdk.TokenNftInfoTest.shouldSerialize=[ +com.hiero.sdk.TokenNftInfoTest.shouldSerialize=[ "TokenNftInfo{nftId=1.2.3/4, accountId=5.6.7, creationTime=2019-04-01T22:42:22Z, metadata=[-34, -83, -66, -17], ledgerId=mainnet, spenderId=8.9.10}" ] -com.hedera.hashgraph.sdk.TokenNftInfoTest.shouldSerializeNullSpender=[ +com.hiero.sdk.TokenNftInfoTest.shouldSerializeNullSpender=[ "TokenNftInfo{nftId=1.2.3/4, accountId=5.6.7, creationTime=2019-04-01T22:42:22Z, metadata=[-34, -83, -66, -17], ledgerId=mainnet, spenderId=null}" ] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java index fa86516a8a..8c510c47ee 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenPauseTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenPauseTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenPauseTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenPauseTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap new file mode 100644 index 0000000000..6520861ed5 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenPauseTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_pause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java index 5698fd8857..e57cc973d8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRejectTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java @@ -17,15 +17,24 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenReference; -import com.hedera.hashgraph.sdk.proto.TokenRejectTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenRejectTransaction; +import com.hiero.sdk.TokenUpdateNftsTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenReference; +import com.hiero.sdk.proto.TokenRejectTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap new file mode 100644 index 0000000000..7bdc6ec768 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenRejectTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_reject {\n owner {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n rejections {\n fungible_token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n }\n rejections {\n fungible_token {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n rejections {\n fungible_token {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n rejections {\n nft {\n serial_number: 2\n token_i_d {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n }\n rejections {\n nft {\n serial_number: 3\n token_i_d {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java b/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java index a0e202fb5f..9a11b4c239 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java @@ -1,5 +1,7 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenRelationship; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.snap similarity index 61% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.snap rename to sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.snap index 5334a5510c..8221c009b0 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRelationshipTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.snap @@ -1,3 +1,3 @@ -com.hedera.hashgraph.sdk.TokenRelationshipTest.shouldSerializeTokenRelationship=[ +com.hiero.sdk.TokenRelationshipTest.shouldSerializeTokenRelationship=[ "TokenRelationship{tokenId=1.2.3, symbol=ABC, balance=55, kycStatus=true, freezeStatus=true, decimals=4, automaticAssociation=true}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java index 04264afc76..e9eda529af 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenRevokeKycTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenRevokeKycTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenRevokeKycTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenRevokeKycTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap new file mode 100644 index 0000000000..9aee784b32 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenRevokeKycTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_revoke_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.java b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java similarity index 57% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java index fbfdf4067a..bcf1964aa8 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenSupplyTypeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java @@ -1,6 +1,6 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.TokenSupplyType; +import com.hiero.sdk.proto.TokenSupplyType; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -25,22 +25,22 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hedera.hashgraph.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite).toString(), - com.hedera.hashgraph.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite).toString()) + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite).toString(), + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite).toString()) .toMatchSnapshot(); } @Test void toProtobuf() { SnapshotMatcher.expect( - com.hedera.hashgraph.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite).toProtobuf(), - com.hedera.hashgraph.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite).toProtobuf()) + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite).toProtobuf(), + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite).toProtobuf()) .toMatchSnapshot(); } @Test void tokenSupplyTestToString() { - assertThat(com.hedera.hashgraph.sdk.TokenSupplyType.INFINITE).hasToString("INFINITE"); - assertThat(com.hedera.hashgraph.sdk.TokenSupplyType.FINITE).hasToString("FINITE"); + assertThat(com.hiero.sdk.TokenSupplyType.INFINITE).hasToString("INFINITE"); + assertThat(com.hiero.sdk.TokenSupplyType.FINITE).hasToString("FINITE"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap new file mode 100644 index 0000000000..fcf92cee57 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap @@ -0,0 +1,10 @@ +com.hiero.sdk.TokenSupplyTypeTest.fromProtobuf=[ + "INFINITE", + "FINITE" +] + + +com.hiero.sdk.TokenSupplyTypeTest.toProtobuf=[ + "INFINITE", + "FINITE" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.java b/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java similarity index 75% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java index dbc37dba6c..19faa8eb70 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenTypeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.TokenType; +import com.hiero.sdk.proto.TokenType; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -43,16 +43,16 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hedera.hashgraph.sdk.TokenType.valueOf(tokenTypeFungible).toString(), - com.hedera.hashgraph.sdk.TokenType.valueOf(tokenTypeNonFungible).toString()) + com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toString(), + com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toString()) .toMatchSnapshot(); } @Test void toProtobuf() { SnapshotMatcher.expect( - com.hedera.hashgraph.sdk.TokenType.valueOf(tokenTypeFungible).toProtobuf(), - com.hedera.hashgraph.sdk.TokenType.valueOf(tokenTypeNonFungible).toProtobuf()) + com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toProtobuf(), + com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toProtobuf()) .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap new file mode 100644 index 0000000000..97be08a8f8 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap @@ -0,0 +1,10 @@ +com.hiero.sdk.TokenTypeTest.fromProtobuf=[ + "FUNGIBLE_COMMON", + "NON_FUNGIBLE_UNIQUE" +] + + +com.hiero.sdk.TokenTypeTest.toProtobuf=[ + "FUNGIBLE_COMMON", + "NON_FUNGIBLE_UNIQUE" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java index e06365273f..d8a4c87504 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnfreezeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenUnfreezeAccountTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenUnfreezeTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap new file mode 100644 index 0000000000..55f4effc6a --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenUnfreezeTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unfreeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java index 2ae2822cb8..a9121dab07 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUnpauseTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java @@ -17,11 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenUnpauseTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenUnpauseTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenUnpauseTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap new file mode 100644 index 0000000000..58df5430f5 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenUnpauseTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unpause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java similarity index 92% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java index 9c79503523..65b8e0985e 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateNftsTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java @@ -17,16 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenUpdateNftsTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenUpdateNftsTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenUpdateNftsTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap new file mode 100644 index 0000000000..50b78973c3 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenUpdateNftsTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update_nfts {\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java index a728b10487..abe79949f3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -25,10 +25,19 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TokenUpdateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenKeyValidation; +import com.hiero.sdk.TokenUpdateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TokenUpdateTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; @@ -136,13 +145,13 @@ void constructTokenUpdateTransactionFromTransactionBodyProtobuf() { .setFreezeKey(testFreezeKey.toProtobufKey()).setWipeKey(testWipeKey.toProtobufKey()) .setSupplyKey(testSupplyKey.toProtobufKey()).setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) .setAutoRenewPeriod( - com.hedera.hashgraph.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) + com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) .build()).setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) .setMemo(StringValue.newBuilder().setValue(testTokenMemo).build()) .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()).setPauseKey(testPauseKey.toProtobufKey()) .setMetadataKey(testMetadataKey.toProtobufKey()) .setMetadata(BytesValue.of(ByteString.copyFrom(testMetadata))) - .setKeyVerificationMode(com.hedera.hashgraph.sdk.proto.TokenKeyValidation.NO_VALIDATION).build(); + .setKeyVerificationMode(com.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION).build(); var tx = TransactionBody.newBuilder().setTokenUpdate(transactionBody).build(); var tokenUpdateTransaction = new TokenUpdateTransaction(tx); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap new file mode 100644 index 0000000000..46b4478035 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TokenUpdateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n key_verification_mode: NO_VALIDATION\n key_verification_mode_value: 1\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n memo {\n value: \"test memo\"\n }\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java index e8d9a043b8..c81d25c4a5 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TokenWipeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java @@ -17,11 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; - -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TokenWipeAccountTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +package com.hiero.sdk; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenWipeTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TokenWipeAccountTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap new file mode 100644 index 0000000000..cc62e90c67 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.TokenWipeTransactionTest.shouldSerializeFungible=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 4\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.TokenWipeTransactionTest.shouldSerializeNft=[ + "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 0\n serial_numbers: 444\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java index b832663681..e63402a4d6 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java @@ -17,10 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ConsensusCreateTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap new file mode 100644 index 0000000000..acc2d389fe --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TopicCreateTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nconsensus_create_topic {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n memo: \"hello memo\"\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java similarity index 88% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java index 941f552c7e..a74b220725 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java @@ -17,10 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.ConsensusDeleteTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TopicDeleteTransaction; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap new file mode 100644 index 0000000000..aa514810e5 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TopicDeleteTransactionTest.shouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nconsensus_delete_topic {\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java similarity index 95% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicIdTest.java index a2d5df673c..0fa1a8159c 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TopicId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap new file mode 100644 index 0000000000..5877a59b92 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap @@ -0,0 +1,23 @@ +com.hiero.sdk.TopicIdTest.fromBytes=[ + "0.0.5005" +] + + +com.hiero.sdk.TopicIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +com.hiero.sdk.TopicIdTest.shouldSerializeFromString=[ + "0.0.5005" +] + + +com.hiero.sdk.TopicIdTest.toBytes=[ + "188d27" +] + + +com.hiero.sdk.TopicIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java index 23d2d16421..4132bc3101 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.TopicInfoQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -38,7 +40,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new TopicInfoQuery() .setTopicId(TopicId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap new file mode 100644 index 0000000000..ed165ff364 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TopicInfoQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\nconsensus_get_topic_info {\n header {\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5005\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java b/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java similarity index 89% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java index a75437b51b..b753a9f7cf 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java @@ -17,12 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.ConsensusGetTopicInfoResponse; -import com.hedera.hashgraph.sdk.proto.ConsensusTopicInfo; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.DurationConverter; +import com.hiero.sdk.InstantConverter; +import com.hiero.sdk.LedgerId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TopicInfo; +import com.hiero.sdk.proto.ConsensusGetTopicInfoResponse; +import com.hiero.sdk.proto.ConsensusTopicInfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.snap similarity index 50% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.snap rename to sdk/src/test/java/com/hiero/sdk/TopicInfoTest.snap index 27fcc2903d..582a7d1d25 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicInfoTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.snap @@ -1,18 +1,18 @@ -com.hedera.hashgraph.sdk.TopicInfoTest.fromBytes=[ +com.hiero.sdk.TopicInfoTest.fromBytes=[ "TopicInfo{topicId=0.0.0, topicMemo=1, runningHash=[2], sequenceNumber=3, expirationTime=1970-01-01T00:00:00.004Z, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, submitKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, autoRenewPeriod=PT120H, autoRenewAccountId=0.0.4, ledgerId=testnet}" ] -com.hedera.hashgraph.sdk.TopicInfoTest.fromProtobuf=[ +com.hiero.sdk.TopicInfoTest.fromProtobuf=[ "TopicInfo{topicId=0.0.0, topicMemo=1, runningHash=[2], sequenceNumber=3, expirationTime=1970-01-01T00:00:00.004Z, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, submitKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, autoRenewPeriod=PT120H, autoRenewAccountId=0.0.4, ledgerId=testnet}" ] -com.hedera.hashgraph.sdk.TopicInfoTest.toBytes=[ +com.hiero.sdk.TopicInfoTest.toBytes=[ "12002a640a013112010218032205108092f4012a221220e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b732221220e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b73a040880af1a420218044a0101" ] -com.hedera.hashgraph.sdk.TopicInfoTest.toProtobuf=[ - "# com.hedera.hashgraph.sdk.proto.ConsensusGetTopicInfoResponse@a2d5b392\ntopic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 0\n}\ntopic_info {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 432000\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n ledger_id: \"\\001\"\n memo: \"1\"\n running_hash: \"\\002\"\n sequence_number: 3\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}" -] \ No newline at end of file +com.hiero.sdk.TopicInfoTest.toProtobuf=[ + "# com.hiero.sdk.proto.ConsensusGetTopicInfoResponse@a2d5b392\ntopic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 0\n}\ntopic_info {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 432000\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n ledger_id: \"\\001\"\n memo: \"1\"\n running_hash: \"\\002\"\n sequence_number: 3\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java similarity index 84% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java index 0bb9517ac0..9e20b5e416 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageChunkTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java @@ -1,9 +1,12 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ConsensusMessageChunkInfo; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.TopicMessageChunk; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusMessageChunkInfo; +import com.hiero.sdk.proto.Timestamp; import org.junit.jupiter.api.Test; import java.time.Instant; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java similarity index 96% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java index 18adba0c17..71de50efb7 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java @@ -17,20 +17,26 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.common.base.Stopwatch; import com.google.common.primitives.Longs; import com.google.common.util.concurrent.Uninterruptibles; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.AccountID; -import com.hedera.hashgraph.sdk.proto.ConsensusMessageChunkInfo; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TopicID; -import com.hedera.hashgraph.sdk.proto.TransactionID; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusServiceGrpc; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicQuery; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.Client; +import com.hiero.sdk.SubscriptionHandle; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.TopicMessage; +import com.hiero.sdk.TopicMessageChunk; +import com.hiero.sdk.TopicMessageQuery; +import com.hiero.sdk.proto.AccountID; +import com.hiero.sdk.proto.ConsensusMessageChunkInfo; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TopicID; +import com.hiero.sdk.proto.TransactionID; +import com.hiero.sdk.proto.mirror.ConsensusServiceGrpc; +import com.hiero.sdk.proto.mirror.ConsensusTopicQuery; +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; import io.github.jsonSnapshot.SnapshotMatcher; import io.grpc.Server; import io.grpc.Status; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.snap similarity index 100% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageQueryTest.snap rename to sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.snap diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java similarity index 91% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java index d4241074df..cf4f8476c4 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java @@ -1,9 +1,15 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ConsensusSubmitMessageTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.TopicMessageSubmitTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.snap similarity index 100% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageSubmitTransactionTest.snap rename to sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.snap diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java similarity index 93% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java index d3bb8ad63f..6111b538f9 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicMessageTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java @@ -1,9 +1,13 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.proto.ConsensusMessageChunkInfo; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.mirror.ConsensusTopicResponse; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.TopicMessage; +import com.hiero.sdk.TopicMessageChunk; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusMessageChunkInfo; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; import org.junit.jupiter.api.Test; import java.time.Instant; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java index 9cda568a9b..455ff33f17 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TopicUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java @@ -17,14 +17,22 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.StringValue; -import com.hedera.hashgraph.sdk.proto.ConsensusUpdateTopicTransactionBody; -import com.hedera.hashgraph.sdk.proto.CryptoDeleteTransactionBody; -import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.TopicUpdateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; +import com.hiero.sdk.proto.CryptoDeleteTransactionBody; +import com.hiero.sdk.proto.SchedulableTransactionBody; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -114,7 +122,7 @@ void constructTopicUpdateTransactionFromTransactionBodyProtobuf() { .setMemo(StringValue.newBuilder().setValue(testTopicMemo).build()) .setExpirationTime(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) .setAdminKey(testAdminKey.toProtobufKey()).setSubmitKey(testSubmitKey.toProtobufKey()).setAutoRenewPeriod( - com.hedera.hashgraph.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) + com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) .build()).setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()).build(); var tx = TransactionBody.newBuilder().setConsensusUpdateTopic(transactionBody).build(); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap new file mode 100644 index 0000000000..f2ee0eac88 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.TopicUpdateTransactionTest.clearShouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n key_list {\n }\n }\n auto_renew_account {\n account_num: 0\n realm_num: 0\n shard_num: 0\n }\n memo {\n }\n submit_key {\n key_list {\n }\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] + + +com.hiero.sdk.TopicUpdateTransactionTest.setShouldSerialize=[ + "# com.hiero.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158542\n }\n memo {\n value: \"test memo\"\n }\n submit_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java similarity index 98% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java rename to sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java index 17e212adf8..8ea60320d3 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java @@ -17,9 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap new file mode 100644 index 0000000000..aca3726f13 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap @@ -0,0 +1,8 @@ +com.hiero.sdk.TransactionIdTest.shouldSerialize2=[ + "0.0.23847@1588539964.632521325?scheduled/3" +] + + +com.hiero.sdk.TransactionIdTest.shouldSerialize=[ + "0.0.23847@1588539964.632521325" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java index 946b36c97c..6ba61fc284 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java @@ -17,9 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionReceiptQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -45,7 +49,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); new TransactionReceiptQuery() .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5005"), validStart)) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap new file mode 100644 index 0000000000..435dfc80a3 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TransactionReceiptQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ntransaction_get_receipt {\n header {\n }\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java similarity index 84% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java rename to sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java index 5e950a62fd..ff2816c02f 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java @@ -1,6 +1,16 @@ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ExchangeRate; +import com.hiero.sdk.FileId; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TopicId; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionReceipt; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.snap b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.snap similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.snap rename to sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.snap index 9a19e2b5d3..6ccfa3e262 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionReceiptTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.snap @@ -1,3 +1,3 @@ -com.hedera.hashgraph.sdk.TransactionReceiptTest.shouldSerialize=[ +com.hiero.sdk.TransactionReceiptTest.shouldSerialize=[ "TransactionReceipt{transactionId=null, status=SCHEDULE_ALREADY_DELETED, exchangeRate=ExchangeRate{hbars=3, cents=4, expirationTime=2019-04-01T22:42:22Z, exchangeRateInCents=1.3333333333333333}, accountId=1.2.3, fileId=4.5.6, contractId=3.2.1, topicId=9.8.7, tokenId=6.5.4, topicSequenceNumber=3, topicRunningHash=[54, 56, 54, 102, 55, 55, 50, 48, 54, 101, 54, 102, 55, 55, 50, 48, 54, 50, 55, 50, 54, 102, 55, 55, 54, 101, 50, 48, 54, 51, 54, 102, 55, 55], totalSupply=30, scheduleId=1.1.1, scheduledTransactionId=3.3.3@1554158542.000000000, serials=[1, 2, 3], nodeId=1, duplicates=[], children=[]}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java rename to sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java index 15590be199..f8dfc01de9 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java @@ -17,9 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; -import com.hedera.hashgraph.sdk.proto.QueryHeader; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionRecordQuery; +import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -45,7 +49,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hedera.hashgraph.sdk.proto.Query.newBuilder(); + var builder = com.hiero.sdk.proto.Query.newBuilder(); spawnQuery().onMakeRequest(builder, QueryHeader.newBuilder().build()); SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); } diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap new file mode 100644 index 0000000000..4b71c83598 --- /dev/null +++ b/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap @@ -0,0 +1,3 @@ +com.hiero.sdk.TransactionRecordQueryTest.shouldSerialize=[ + "# com.hiero.sdk.proto.Query\ntransaction_get_record {\n header {\n }\n include_child_records: true\n include_duplicates: true\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java similarity index 85% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java rename to sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java index f68ed794f7..2b12ae979d 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java @@ -17,10 +17,27 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AssessedCustomFee; +import com.hiero.sdk.ContractFunctionResult; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PendingAirdropId; +import com.hiero.sdk.PendingAirdropRecord; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.TokenAssociation; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenNftTransfer; +import com.hiero.sdk.TokenTransfer; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionRecord; +import com.hiero.sdk.Transfer; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; @@ -34,8 +51,8 @@ import java.util.List; import java.util.Map; -import static com.hedera.hashgraph.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; -import static com.hedera.hashgraph.sdk.TransactionReceiptTest.spawnReceiptExample; +import static com.hiero.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; +import static com.hiero.sdk.TransactionReceiptTest.spawnReceiptExample; import static org.assertj.core.api.Assertions.assertThat; public class TransactionRecordTest { @@ -61,7 +78,7 @@ private static TransactionRecord spawnRecordExample(@Nullable ByteString prngByt "memo", 3000L, new ContractFunctionResult( - com.hedera.hashgraph.sdk.proto.ContractFunctionResult.newBuilder() + com.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(ContractId.fromString("1.2.3").toProtobuf()) .setContractCallResult(ByteString.copyFrom(callResult)) .setEvmAddress(BytesValue.newBuilder().setValue(ByteString.copyFrom(Hex.decode("98329e006610472e6B372C080833f6D79ED833cf"))).build()) diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.snap b/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.snap similarity index 97% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.snap rename to sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.snap index d0e9381928..08e20be479 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionRecordTest.snap +++ b/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.snap @@ -1,8 +1,8 @@ -com.hedera.hashgraph.sdk.TransactionRecordTest.shouldSerialize2=[ +com.hiero.sdk.TransactionRecordTest.shouldSerialize2=[ "TransactionRecord{receipt=TransactionReceipt{transactionId=null, status=SCHEDULE_ALREADY_DELETED, exchangeRate=ExchangeRate{hbars=3, cents=4, expirationTime=2019-04-01T22:42:22Z, exchangeRateInCents=1.3333333333333333}, accountId=1.2.3, fileId=4.5.6, contractId=3.2.1, topicId=9.8.7, tokenId=6.5.4, topicSequenceNumber=3, topicRunningHash=[54, 56, 54, 102, 55, 55, 50, 48, 54, 101, 54, 102, 55, 55, 50, 48, 54, 50, 55, 50, 54, 102, 55, 55, 54, 101, 50, 48, 54, 51, 54, 102, 55, 55], totalSupply=30, scheduleId=1.1.1, scheduledTransactionId=3.3.3@1554158542.000000000, serials=[1, 2, 3], nodeId=1, duplicates=[], children=[]}, transactionHash=68656c6c6f, consensusTimestamp=2019-04-01T22:42:22Z, transactionId=3.3.3@1554158542.000000000, transactionMemo=memo, transactionFee=3000 tℏ, contractFunctionResult=ContractFunctionResult{contractId=1.2.3, evmAddress=1.2.98329e006610472e6b372c080833f6d79ed833cf, errorMessage=null, bloom=, gasUsed=0, logs=[], createdContractIds=[], stateChanges=[], gas=0, hbarAmount=0 tℏ, contractFunctionparametersBytes=, rawResult=00000000000000000000000000000000000000000000000000000000ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000011223344556677889900aabbccddeeff00112233ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001448656c6c6f2c20776f726c642c20616761696e21000000000000000000000000, senderAccountId=1.2.3, contractNonces=[], signerNonce=0}, transfers=[Transfer{accountId=4.4.4, amount=5 ℏ}], tokenTransfers={6.6.6={1.1.1=4}}, tokenNftTransfers={4.4.4=[TokenNftTransfer{tokenId=4.4.4, sender=1.2.3, receiver=3.2.1, serial=4, isApproved=true}]}, scheduleRef=3.3.3, assessedCustomFees=[AssessedCustomFee{amount=4, tokenId=4.5.6, feeCollectorAccountId=8.6.5, payerAccountIdList=[3.3.3]}], automaticTokenAssociations=[TokenAssociation{tokenId=5.4.3, accountId=8.7.6}], aliasKey=3036301006072a8648ce3d020106052b8104000a03220002703a9370b0443be6ae7c507b0aec81a55e94e4a863b9655360bd65358caa6588, children=[], duplicates=[], parentConsensusTimestamp=2019-04-01T22:42:22Z, ethereumHash=536f6d652068617368, paidStakingRewards=[Transfer{accountId=1.2.3, amount=8 ℏ}], prngBytes=null, prngNumber=4, evmAddress=30783030, pendingAirdropRecords=[PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=null, nftId=0.0.5005/1234}, pendingAirdropAmount=123}, PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=0.0.12345, nftId=null}, pendingAirdropAmount=123}]}" ] -com.hedera.hashgraph.sdk.TransactionRecordTest.shouldSerialize=[ +com.hiero.sdk.TransactionRecordTest.shouldSerialize=[ "TransactionRecord{receipt=TransactionReceipt{transactionId=null, status=SCHEDULE_ALREADY_DELETED, exchangeRate=ExchangeRate{hbars=3, cents=4, expirationTime=2019-04-01T22:42:22Z, exchangeRateInCents=1.3333333333333333}, accountId=1.2.3, fileId=4.5.6, contractId=3.2.1, topicId=9.8.7, tokenId=6.5.4, topicSequenceNumber=3, topicRunningHash=[54, 56, 54, 102, 55, 55, 50, 48, 54, 101, 54, 102, 55, 55, 50, 48, 54, 50, 55, 50, 54, 102, 55, 55, 54, 101, 50, 48, 54, 51, 54, 102, 55, 55], totalSupply=30, scheduleId=1.1.1, scheduledTransactionId=3.3.3@1554158542.000000000, serials=[1, 2, 3], nodeId=1, duplicates=[], children=[]}, transactionHash=68656c6c6f, consensusTimestamp=2019-04-01T22:42:22Z, transactionId=3.3.3@1554158542.000000000, transactionMemo=memo, transactionFee=3000 tℏ, contractFunctionResult=ContractFunctionResult{contractId=1.2.3, evmAddress=1.2.98329e006610472e6b372c080833f6d79ed833cf, errorMessage=null, bloom=, gasUsed=0, logs=[], createdContractIds=[], stateChanges=[], gas=0, hbarAmount=0 tℏ, contractFunctionparametersBytes=, rawResult=00000000000000000000000000000000000000000000000000000000ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000011223344556677889900aabbccddeeff00112233ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001448656c6c6f2c20776f726c642c20616761696e21000000000000000000000000, senderAccountId=1.2.3, contractNonces=[], signerNonce=0}, transfers=[Transfer{accountId=4.4.4, amount=5 ℏ}], tokenTransfers={6.6.6={1.1.1=4}}, tokenNftTransfers={4.4.4=[TokenNftTransfer{tokenId=4.4.4, sender=1.2.3, receiver=3.2.1, serial=4, isApproved=true}]}, scheduleRef=3.3.3, assessedCustomFees=[AssessedCustomFee{amount=4, tokenId=4.5.6, feeCollectorAccountId=8.6.5, payerAccountIdList=[3.3.3]}], automaticTokenAssociations=[TokenAssociation{tokenId=5.4.3, accountId=8.7.6}], aliasKey=3036301006072a8648ce3d020106052b8104000a03220002703a9370b0443be6ae7c507b0aec81a55e94e4a863b9655360bd65358caa6588, children=[], duplicates=[], parentConsensusTimestamp=2019-04-01T22:42:22Z, ethereumHash=536f6d652068617368, paidStakingRewards=[Transfer{accountId=1.2.3, amount=8 ℏ}], prngBytes=766572792072616e646f6d206279746573, prngNumber=null, evmAddress=30783030, pendingAirdropRecords=[PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=null, nftId=0.0.5005/1234}, pendingAirdropAmount=123}, PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=0.0.12345, nftId=null}, pendingAirdropAmount=123}]}" -] \ No newline at end of file +] diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionTest.java similarity index 90% rename from sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java rename to sdk/src/test/java/com/hiero/sdk/TransactionTest.java index db62bd65ff..8017977954 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/TransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionTest.java @@ -17,12 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk; +package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.TokenAssociateTransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionBody; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.TokenAssociateTransactionBody; +import com.hiero.sdk.proto.TransactionBody; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; @@ -30,7 +37,7 @@ import java.util.Arrays; import java.util.List; -import static com.hedera.hashgraph.sdk.Transaction.fromBytes; +import static com.hiero.sdk.Transaction.fromBytes; import static org.assertj.core.api.Assertions.assertThat; @@ -93,7 +100,7 @@ void tokenAssociateTransactionFromTransactionBytes() throws InvalidProtocolBuffe .build(); var signedTransactionBodyProto = TransactionBody.parseFrom(signedTransactionProto.getBodyBytes()); - var transactionSignedProto = com.hedera.hashgraph.sdk.proto.Transaction.newBuilder() + var transactionSignedProto = com.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(signedTransactionBodyProto.toByteString()).build(); var transactionSignedBodyProto = TransactionBody.parseFrom(transactionSignedProto.getSignedTransactionBytes()); diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountAllowanceIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountAllowanceIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java index 8f4fb7eae2..f5ef05622f 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountAllowanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountAllowanceApproveTransaction; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountBalanceIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountBalanceIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java index 0669f2a570..217e08c4ff 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountBalanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java index 4dcd7886d2..de453898cb 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.*; +import com.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.Duration; @@ -122,7 +122,7 @@ void canCreateWithAliasKey() throws Exception { assertThat(key.getPublicKey()).isEqualTo(info.aliasKey); - } + } } @Test diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java index a3ed868797..5b78f07fad 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.AccountInfoQuery; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.AccountInfoQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.Duration; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountIdPopulationIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java index cff3131038..41659613b9 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TransactionReceiptQuery; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TransactionReceiptQuery; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -81,7 +81,7 @@ void canPopulateAccountIdNumAsync() throws Exception { var accountId = idMirror.populateAccountNumAsync(testEnv.client).get(); assertThat(newAccountId.num).isEqualTo(accountId.num); - + } } diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java index 45d47016cc..e08cbe0371 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountInfoFlow; -import com.hedera.hashgraph.sdk.AccountInfoQuery; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.Transaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountInfoFlow; +import com.hiero.sdk.AccountInfoQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.Transaction; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -105,7 +105,7 @@ void getCostSmallMaxAccountInfoForClientOperator() throws Exception { assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> { info.execute(testEnv.client); - }).withMessage("com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException: cost for AccountInfoQuery, of " + cost.toString() + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); + }).withMessage("com.hiero.sdk.MaxQueryPaymentExceededException: cost for AccountInfoQuery, of " + cost.toString() + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); } } diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountRecordsIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java similarity index 87% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountRecordsIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java index 9dc2a46976..0839343abe 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountRecordsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountRecordsQuery; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountRecordsQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountStakersIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java similarity index 85% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountStakersIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java index 222b6b5a75..0e40d97851 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountStakersIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.AccountStakersQuery; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; +import com.hiero.sdk.AccountStakersQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java index f2aff5de2f..48208ee225 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountInfoQuery; -import com.hedera.hashgraph.sdk.AccountUpdateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountInfoQuery; +import com.hiero.sdk.AccountUpdateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.Duration; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java index 08da7ffbbd..063aa78980 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.*; +import com.hiero.sdk.*; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/Contents.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/Contents.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java index e3dadb7ca1..14bf407a3d 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/Contents.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; public class Contents { private Contents() { diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java index 1bbd481bf5..74ec3ec4ff 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractBytecodeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java @@ -17,18 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.ContractByteCodeQuery; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.ContractByteCodeQuery; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxQueryPaymentExceededException; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java index 141bf9467f..e919d0d2ba 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCallIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java @@ -17,20 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.ContractCallQuery; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; -import com.hedera.hashgraph.sdk.MirrorNodeContractEstimateGasQuery; -import com.hedera.hashgraph.sdk.MirrorNodeContractQuery; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.ContractCallQuery; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxQueryPaymentExceededException; +import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import com.hiero.sdk.MirrorNodeContractQuery; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateFlowIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateFlowIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java index 14cf3231d0..36988a1e09 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.*; +import com.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java index d4e5f22953..ae8f0edc1d 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractInfoQuery; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractInfoQuery; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java index c7ec9a1d88..179b30bf1c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractInfoQuery; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractInfoQuery; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractExecuteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractExecuteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java index 9f2b099bd9..dc580f9cf8 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractExecuteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java @@ -17,22 +17,22 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractExecuteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.MirrorNodeContractEstimateGasQuery; -import com.hedera.hashgraph.sdk.MirrorNodeContractQuery; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractExecuteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import com.hiero.sdk.MirrorNodeContractQuery; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractFunctionParametersIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractFunctionParametersIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java index 3ef94829bd..c834903301 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractFunctionParametersIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java @@ -17,23 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.abi.Address; -import com.hedera.hashgraph.sdk.ContractCallQuery; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractId; -import com.hedera.hashgraph.sdk.FileAppendTransaction; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileId; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MirrorNodeContractEstimateGasQuery; -import com.hedera.hashgraph.sdk.MirrorNodeContractQuery; +import com.hiero.sdk.ContractCallQuery; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.FileAppendTransaction; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import com.hiero.sdk.MirrorNodeContractQuery; import java.math.BigInteger; import java.util.Arrays; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractIdPopulationIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java index 74e3f5f9a7..f756c2033f 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractId; -import com.hedera.hashgraph.sdk.ContractInfoQuery; -import com.hedera.hashgraph.sdk.FileCreateTransaction; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractInfoQuery; +import com.hiero.sdk.FileCreateTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -108,7 +108,7 @@ void canPopulateContractIdNumAsync() throws Exception { var newContractId = idMirror.populateContractNumAsync(testEnv.client).get(); assertThat(contractId.num).isEqualTo(newContractId.num); - + } } } diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java index 08435ce466..7c8e51e672 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.*; +import com.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractNonceInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java similarity index 91% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractNonceInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java index 5a2b7c2361..250d7a4bb6 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractNonceInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractId; -import com.hedera.hashgraph.sdk.ContractNonceInfo; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.ContractNonceInfo; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java index 902a231dba..a7682e6751 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ContractUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java @@ -17,18 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractInfoQuery; -import com.hedera.hashgraph.sdk.ContractUpdateTransaction; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractInfoQuery; +import com.hiero.sdk.ContractUpdateTransaction; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EntityHelper.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java similarity index 92% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EntityHelper.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java index 78053bd3f7..fcdec63407 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EntityHelper.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java @@ -17,21 +17,21 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.ContractCreateFlow; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractId; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.Key; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenId; -import com.hedera.hashgraph.sdk.TokenSupplyType; -import com.hedera.hashgraph.sdk.TokenType; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.ContractCreateFlow; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.Key; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; import java.util.concurrent.TimeoutException; /** diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EthereumTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EthereumTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java index 80c7c68497..3a4f7112d7 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/EthereumTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java @@ -17,23 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.rlp.RLPEncoder; import com.esaulpaugh.headlong.util.Integers; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractExecuteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.EthereumTransaction; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PrivateKeyECDSA; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractExecuteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.EthereumTransaction; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PrivateKeyECDSA; +import com.hiero.sdk.TransferTransaction; import java.math.BigInteger; import java.util.List; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FeeSchedulesTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FeeSchedulesTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java index 08f408ed8e..31cfe72a00 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FeeSchedulesTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.FeeSchedules; -import com.hedera.hashgraph.sdk.FileContentsQuery; -import com.hedera.hashgraph.sdk.FileId; +import com.hiero.sdk.FeeSchedules; +import com.hiero.sdk.FileContentsQuery; +import com.hiero.sdk.FileId; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileAppendIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileAppendIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java index 8a9c6d4b4e..c29caa880e 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileAppendIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.FileAppendTransaction; -import com.hedera.hashgraph.sdk.FileContentsQuery; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileInfoQuery; -import com.hedera.hashgraph.sdk.KeyList; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.FileAppendTransaction; +import com.hiero.sdk.FileContentsQuery; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.KeyList; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.Duration; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java index 929ff8f8d6..a28a771ac4 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileContentsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.FileContentsQuery; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.FileContentsQuery; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxQueryPaymentExceededException; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java index 92a93c1989..ef53d14a1c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileInfoQuery; -import com.hedera.hashgraph.sdk.KeyList; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.KeyList; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java index 04bc27eb27..fe178aece9 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileInfoQuery; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java index 8eef3c92a7..d9cd09a17d 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileInfoQuery; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; -import com.hedera.hashgraph.sdk.PrecheckStatusException; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.MaxQueryPaymentExceededException; +import com.hiero.sdk.PrecheckStatusException; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java index f41a62f998..28383e34c1 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/FileUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java @@ -17,19 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileId; -import com.hedera.hashgraph.sdk.FileInfoQuery; -import com.hedera.hashgraph.sdk.FileUpdateTransaction; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileId; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.FileUpdateTransaction; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java index 86037ebdc7..17857f7358 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java @@ -17,19 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.TokenId; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TransferTransaction; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashAddIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java similarity index 85% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashAddIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java index 8d590d749f..ee4878f675 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashAddIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.LiveHashAddTransaction; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.Status; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.LiveHashAddTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Status; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java similarity index 85% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java index 4c313c074d..daaea4443f 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LiveHashDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.LiveHashDeleteTransaction; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.Status; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.LiveHashDeleteTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Status; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LoadIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LoadIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java index b03abbc0d6..6b0692598a 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/LoadIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java @@ -18,14 +18,14 @@ * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.fail; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.PrivateKey; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.PrivateKey; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java index 1b24e271cd..af59ed4f10 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java @@ -18,26 +18,26 @@ * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import static com.hedera.hashgraph.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; +import static com.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.ContractCallQuery; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractExecuteTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.ContractId; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MirrorNodeContractCallQuery; -import com.hedera.hashgraph.sdk.MirrorNodeContractEstimateGasQuery; -import com.hedera.hashgraph.sdk.MirrorNodeContractQuery; -import com.hedera.hashgraph.sdk.PrivateKey; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.ContractCallQuery; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractExecuteTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.ContractId; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MirrorNodeContractCallQuery; +import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import com.hiero.sdk.MirrorNodeContractQuery; +import com.hiero.sdk.PrivateKey; import java.util.Objects; import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NetworkVersionInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java similarity index 90% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NetworkVersionInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java index e006fb5f7c..67c85e393c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NetworkVersionInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.NetworkVersionInfoQuery; +import com.hiero.sdk.NetworkVersionInfoQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftAllowancesIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftAllowancesIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java index a10dfcd24e..638ca67627 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftAllowancesIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java @@ -17,27 +17,27 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; -import com.hedera.hashgraph.sdk.AccountAllowanceDeleteTransaction; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.NftId; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenId; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenNftInfoQuery; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountAllowanceApproveTransaction; +import com.hiero.sdk.AccountAllowanceDeleteTransaction; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenNftInfoQuery; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import java.nio.charset.StandardCharsets; import java.util.List; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftMetadataGenerator.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftMetadataGenerator.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java index 2c731905cf..aed75ab689 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NftMetadataGenerator.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import java.util.ArrayList; import java.util.Collections; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java index bda6cb10ba..ade4449aed 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import static com.hedera.hashgraph.sdk.test.integration.IntegrationTestEnv.LOCAL_CONSENSUS_NODE_ACCOUNT_ID; +import static com.hiero.sdk.test.integration.IntegrationTestEnv.LOCAL_CONSENSUS_NODE_ACCOUNT_ID; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.Endpoint; -import com.hedera.hashgraph.sdk.NodeCreateTransaction; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PrivateKeyECDSA; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Endpoint; +import com.hiero.sdk.NodeCreateTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PrivateKeyECDSA; import java.util.HashMap; import java.util.List; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java index e2e1601101..0208677f93 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ReceiptQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TransactionReceiptQuery; -import com.hedera.hashgraph.sdk.TransactionRecordQuery; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TransactionReceiptQuery; +import com.hiero.sdk.TransactionRecordQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ScheduleCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ScheduleCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java index 2f6e483d19..7087b0c6d7 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ScheduleCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java @@ -17,34 +17,34 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.AccountUpdateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.ScheduleCreateTransaction; -import com.hedera.hashgraph.sdk.ScheduleId; -import com.hedera.hashgraph.sdk.ScheduleInfo; -import com.hedera.hashgraph.sdk.ScheduleInfoQuery; -import com.hedera.hashgraph.sdk.ScheduleSignTransaction; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicMessageSubmitTransaction; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransactionReceipt; -import com.hedera.hashgraph.sdk.TransactionResponse; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountUpdateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.ScheduleCreateTransaction; +import com.hiero.sdk.ScheduleId; +import com.hiero.sdk.ScheduleInfo; +import com.hiero.sdk.ScheduleInfoQuery; +import com.hiero.sdk.ScheduleSignTransaction; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicMessageSubmitTransaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransactionReceipt; +import com.hiero.sdk.TransactionResponse; +import com.hiero.sdk.TransferTransaction; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/SystemIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/SystemIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java index f94f4a675e..694a454783 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/SystemIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.ContractCreateTransaction; -import com.hedera.hashgraph.sdk.ContractFunctionParameters; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.SystemDeleteTransaction; -import com.hedera.hashgraph.sdk.SystemUndeleteTransaction; +import com.hiero.sdk.ContractCreateTransaction; +import com.hiero.sdk.ContractFunctionParameters; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.SystemDeleteTransaction; +import com.hiero.sdk.SystemUndeleteTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.Instant; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropCancelIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropCancelIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java index 3d15da8e23..b0284e4286 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropCancelIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java @@ -17,29 +17,29 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import static com.hedera.hashgraph.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static com.hedera.hashgraph.sdk.test.integration.EntityHelper.mitedNfts; +import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static com.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.PendingAirdropId; -import com.hedera.hashgraph.sdk.PendingAirdropRecord; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAirdropTransaction; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCancelAirdropTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenFreezeTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenPauseTransaction; -import com.hedera.hashgraph.sdk.TransactionId; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.PendingAirdropId; +import com.hiero.sdk.PendingAirdropRecord; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAirdropTransaction; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCancelAirdropTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenFreezeTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenPauseTransaction; +import com.hiero.sdk.TransactionId; import java.util.ArrayList; import java.util.Collections; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropClaimIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropClaimIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java index 07817fbc00..de3954fcc6 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropClaimIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java @@ -17,28 +17,28 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import static com.hedera.hashgraph.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static com.hedera.hashgraph.sdk.test.integration.EntityHelper.mitedNfts; +import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static com.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.PendingAirdropId; -import com.hedera.hashgraph.sdk.PendingAirdropRecord; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAirdropTransaction; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenClaimAirdropTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenFreezeTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenPauseTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.PendingAirdropId; +import com.hiero.sdk.PendingAirdropRecord; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAirdropTransaction; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenClaimAirdropTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenFreezeTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenPauseTransaction; import java.util.ArrayList; import java.util.Collections; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java index 899d6c3742..1575309589 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java @@ -17,33 +17,33 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import static com.hedera.hashgraph.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static com.hedera.hashgraph.sdk.test.integration.EntityHelper.mitedNfts; +import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static com.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; -import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.CustomFixedFee; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAirdropTransaction; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenSupplyType; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountAllowanceApproveTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAirdropTransaction; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java similarity index 97% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java index 80d98aef93..350aeb682f 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java @@ -17,18 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountInfoQuery; -import com.hedera.hashgraph.sdk.AccountUpdateTransaction; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransferTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountAllowanceApproveTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountInfoQuery; +import com.hiero.sdk.AccountUpdateTransaction; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import java.util.ArrayList; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenBurnIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenBurnIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java index dde7405f2d..3e0118cb32 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenBurnIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java @@ -17,20 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenBurnTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TransferTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenBurnTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java index 598d259691..ec802549f7 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java @@ -17,22 +17,22 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.CustomFee; -import com.hedera.hashgraph.sdk.CustomFixedFee; -import com.hedera.hashgraph.sdk.CustomFractionalFee; -import com.hedera.hashgraph.sdk.CustomRoyaltyFee; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenType; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.CustomRoyaltyFee; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenType; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java index 31f909c1e1..5244bcb652 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDissociateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDissociateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java index f6dcaceacd..d02acb3ab9 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenDissociateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDissociateTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDissociateTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java index fa544a9498..910f9fccad 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.CustomFee; -import com.hedera.hashgraph.sdk.CustomFixedFee; -import com.hedera.hashgraph.sdk.CustomFractionalFee; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenFeeScheduleUpdateTransaction; -import com.hedera.hashgraph.sdk.TokenInfoQuery; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.CustomFee; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; +import com.hiero.sdk.TokenInfoQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFreezeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFreezeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java index c9fb87a6db..cffa70da7c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenFreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenFreezeTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenFreezeTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -111,7 +111,7 @@ void cannotFreezeAccountOnTokenWhenTokenIDIsNotSet() throws Exception { .getReceipt(testEnv.client); }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - } + } } @Test diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenGrantKycIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenGrantKycIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java index 08b7efb4e6..79cbcfc785 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenGrantKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenGrantKycTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenGrantKycTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java index ee79505363..ff1f3f6a1f 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java @@ -17,18 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenInfoQuery; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenSupplyType; -import com.hedera.hashgraph.sdk.TokenType; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxQueryPaymentExceededException; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenInfoQuery; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenManualAssociationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenManualAssociationIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java index e41bdcb61f..aad2da6ef4 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenManualAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java @@ -17,20 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.AccountInfoQuery; -import com.hedera.hashgraph.sdk.ContractDeleteTransaction; -import com.hedera.hashgraph.sdk.ContractInfoQuery; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TransferTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountInfoQuery; +import com.hiero.sdk.ContractDeleteTransaction; +import com.hiero.sdk.ContractInfoQuery; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TransferTransaction; import java.util.ArrayList; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -193,7 +193,7 @@ void canManuallyAssociateContractWithNft() throws Exception { @DisplayName("Can execute token associate transaction even when token IDs are not set") void canExecuteTokenAssociateTransactionEvenWhenTokenIDsAreNotSet() throws Exception { try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - + var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; var accountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); @@ -212,7 +212,7 @@ void canExecuteTokenAssociateTransactionEvenWhenTokenIDsAreNotSet() throws Excep @DisplayName("Cannot Manually associate Account with a Token when Account ID is not set") void cannotAssociateAccountWithTokensWhenAccountIDIsNotSet() throws Exception { try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - + var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; var accountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenMintIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenMintIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java index 44bf44fb99..21a70f654c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenMintIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java @@ -17,18 +17,18 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenSupplyType; -import com.hedera.hashgraph.sdk.TokenType; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java index e9b8952bc3..f0c95625cc 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.NftId; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenNftInfoQuery; -import com.hedera.hashgraph.sdk.TokenType; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.NftId; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenNftInfoQuery; +import com.hiero.sdk.TokenType; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftTransferIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftTransferIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java index 0d552b8fa5..aa25efdf49 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenNftTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java @@ -17,21 +17,21 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenGrantKycTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TokenWipeTransaction; -import com.hedera.hashgraph.sdk.TransactionResponse; -import com.hedera.hashgraph.sdk.TransferTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenGrantKycTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TokenWipeTransaction; +import com.hiero.sdk.TransactionResponse; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenPauseIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java similarity index 85% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenPauseIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java index f637439353..eb9b3956a9 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenPauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java @@ -17,19 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenPauseTransaction; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenPauseTransaction; +import com.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRejectFlowIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRejectFlowIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java index 6571974341..737a054a0f 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRejectFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java @@ -17,19 +17,19 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenNftInfoQuery; -import com.hedera.hashgraph.sdk.TokenRejectFlow; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenNftInfoQuery; +import com.hiero.sdk.TokenRejectFlow; +import com.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRejectIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java similarity index 98% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRejectIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java index 01746132d4..b58602bd6c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRejectIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java @@ -17,28 +17,28 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction; -import com.hedera.hashgraph.sdk.AccountBalanceQuery; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenFreezeTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenNftInfoQuery; -import com.hedera.hashgraph.sdk.TokenPauseTransaction; -import com.hedera.hashgraph.sdk.TokenRejectTransaction; -import com.hedera.hashgraph.sdk.TokenSupplyType; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountAllowanceApproveTransaction; +import com.hiero.sdk.AccountBalanceQuery; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenFreezeTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenNftInfoQuery; +import com.hiero.sdk.TokenPauseTransaction; +import com.hiero.sdk.TokenRejectTransaction; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.List; @@ -995,7 +995,7 @@ void cannotRejectTokenWhenTokenOrNFTIdIsNotSet() throws Exception { .execute(testEnv.client) .getReceipt(testEnv.client); }).withMessageContaining("EMPTY_TOKEN_REFERENCE_LIST"); - + } } diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRevokeKycIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRevokeKycIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java index 31c57e6aa4..d4d635df04 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenRevokeKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenRevokeKycTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenRevokeKycTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenTransferIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java similarity index 90% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenTransferIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java index 13e52fa8c5..5ff64367f8 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java @@ -17,20 +17,20 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.CustomFixedFee; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenGrantKycTransaction; -import com.hedera.hashgraph.sdk.TransactionResponse; -import com.hedera.hashgraph.sdk.TransferTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenGrantKycTransaction; +import com.hiero.sdk.TransactionResponse; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnfreezeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnfreezeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java index 678c49687c..6f15575b66 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnfreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java @@ -17,17 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenUnfreezeTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenUnfreezeTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnpauseIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java similarity index 83% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnpauseIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java index 7c0d037c2e..51859de747 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUnpauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java @@ -17,21 +17,21 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenUnpauseTransaction; -import com.hedera.hashgraph.sdk.TokenWipeTransaction; -import com.hedera.hashgraph.sdk.TransferTransaction; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenUnpauseTransaction; +import com.hiero.sdk.TokenWipeTransaction; +import com.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java index 9e5799c3e8..5281cbe9b6 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java @@ -17,22 +17,22 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenInfoQuery; -import com.hedera.hashgraph.sdk.TokenKeyValidation; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TokenUpdateTransaction; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenInfoQuery; +import com.hiero.sdk.TokenKeyValidation; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TokenUpdateTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateNftsIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateNftsIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java index 5b256e1596..6b9700ff55 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenUpdateNftsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java @@ -17,23 +17,23 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.NftId; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenId; -import com.hedera.hashgraph.sdk.TokenInfoQuery; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenNftInfoQuery; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TokenUpdateNftsTransaction; +import com.hiero.sdk.Client; +import com.hiero.sdk.NftId; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenInfoQuery; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenNftInfoQuery; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TokenUpdateNftsTransaction; import java.util.List; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenWipeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenWipeIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java index 2eeb3d1c47..3b4a2f2f3c 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TokenWipeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java @@ -17,21 +17,21 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenAssociateTransaction; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenGrantKycTransaction; -import com.hedera.hashgraph.sdk.TokenMintTransaction; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TokenWipeTransaction; -import com.hedera.hashgraph.sdk.TransferTransaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenAssociateTransaction; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenGrantKycTransaction; +import com.hiero.sdk.TokenMintTransaction; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TokenWipeTransaction; +import com.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java similarity index 91% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicCreateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java index 375f7ee137..fcdd5f4353 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicDeleteTransaction; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicDeleteTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java index 6a33a35b1b..e3899ee1c4 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicDeleteTransaction; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicDeleteTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicInfoIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java index 014f40399b..7c6ee638d2 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicDeleteTransaction; -import com.hedera.hashgraph.sdk.TopicInfoQuery; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.Hbar; +import com.hiero.sdk.MaxQueryPaymentExceededException; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicDeleteTransaction; +import com.hiero.sdk.TopicInfoQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java similarity index 98% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java index a8369b4edd..0ec0ab9bb8 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.*; +import com.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.time.Duration; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageSubmitIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageSubmitIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java index e729532657..8fbffb1f48 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicMessageSubmitIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java @@ -17,15 +17,15 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; - -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicDeleteTransaction; -import com.hedera.hashgraph.sdk.TopicInfoQuery; -import com.hedera.hashgraph.sdk.TopicMessageSubmitTransaction; -import com.hedera.hashgraph.sdk.Transaction; +package com.hiero.sdk.test.integration; + +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.Status; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicDeleteTransaction; +import com.hiero.sdk.TopicInfoQuery; +import com.hiero.sdk.TopicMessageSubmitTransaction; +import com.hiero.sdk.Transaction; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java index ad5ae1ef6b..89fe3242ef 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TopicUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java @@ -17,12 +17,12 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicDeleteTransaction; -import com.hedera.hashgraph.sdk.TopicInfoQuery; -import com.hedera.hashgraph.sdk.TopicUpdateTransaction; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicDeleteTransaction; +import com.hiero.sdk.TopicInfoQuery; +import com.hiero.sdk.TopicUpdateTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionIntegrationTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java index ba175b5745..e948fb3c5d 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java @@ -17,39 +17,39 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; import com.google.protobuf.ByteString; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.FileAppendTransaction; -import com.hedera.hashgraph.sdk.FileContentsQuery; -import com.hedera.hashgraph.sdk.FileCreateTransaction; -import com.hedera.hashgraph.sdk.FileDeleteTransaction; -import com.hedera.hashgraph.sdk.FileInfoQuery; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.TopicCreateTransaction; -import com.hedera.hashgraph.sdk.TopicDeleteTransaction; -import com.hedera.hashgraph.sdk.TopicInfoQuery; -import com.hedera.hashgraph.sdk.TopicMessageSubmitTransaction; -import com.hedera.hashgraph.sdk.Transaction; -import com.hedera.hashgraph.sdk.TransactionId; -import com.hedera.hashgraph.sdk.TransferTransaction; -import com.hedera.hashgraph.sdk.proto.AccountAmount; -import com.hedera.hashgraph.sdk.proto.AccountID; -import com.hedera.hashgraph.sdk.proto.CryptoTransferTransactionBody; -import com.hedera.hashgraph.sdk.proto.Duration; -import com.hedera.hashgraph.sdk.proto.SignatureMap; -import com.hedera.hashgraph.sdk.proto.SignaturePair; -import com.hedera.hashgraph.sdk.proto.SignedTransaction; -import com.hedera.hashgraph.sdk.proto.Timestamp; -import com.hedera.hashgraph.sdk.proto.TransactionBody; -import com.hedera.hashgraph.sdk.proto.TransactionID; -import com.hedera.hashgraph.sdk.proto.TransactionList; -import com.hedera.hashgraph.sdk.proto.TransferList; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.FileAppendTransaction; +import com.hiero.sdk.FileContentsQuery; +import com.hiero.sdk.FileCreateTransaction; +import com.hiero.sdk.FileDeleteTransaction; +import com.hiero.sdk.FileInfoQuery; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.TopicCreateTransaction; +import com.hiero.sdk.TopicDeleteTransaction; +import com.hiero.sdk.TopicInfoQuery; +import com.hiero.sdk.TopicMessageSubmitTransaction; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; +import com.hiero.sdk.TransferTransaction; +import com.hiero.sdk.proto.AccountAmount; +import com.hiero.sdk.proto.AccountID; +import com.hiero.sdk.proto.CryptoTransferTransactionBody; +import com.hiero.sdk.proto.Duration; +import com.hiero.sdk.proto.SignatureMap; +import com.hiero.sdk.proto.SignaturePair; +import com.hiero.sdk.proto.SignedTransaction; +import com.hiero.sdk.proto.Timestamp; +import com.hiero.sdk.proto.TransactionBody; +import com.hiero.sdk.proto.TransactionID; +import com.hiero.sdk.proto.TransactionList; +import com.hiero.sdk.proto.TransferList; import java.util.Objects; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; @@ -876,7 +876,7 @@ void transactionFromToBytes2() { var byts = signedBuilder.build().toByteString(); byts = TransactionList.newBuilder() - .addTransactionList(com.hedera.hashgraph.sdk.proto.Transaction.newBuilder() + .addTransactionList(com.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(byts) .build()) .build().toByteString(); diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionResponseTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java similarity index 91% rename from sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionResponseTest.java rename to sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java index ab85d144d5..aaf3917c14 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/TransactionResponseTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.sdk.test.integration; +package com.hiero.sdk.test.integration; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.PrivateKey; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.PrivateKey; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java index 358c841ee3..8a7e5c56a4 100644 --- a/sdk/src/testIntegration/java/module-info.java +++ b/sdk/src/testIntegration/java/module-info.java @@ -18,7 +18,7 @@ * */ -open module com.hedera.hashgraph.sdk.test.integration { +open module com.hiero.sdk.test.integration { requires com.hedera.hashgraph.sdk; requires com.esaulpaugh.headlong; requires org.assertj.core; From b0e6f8e321d2ab0da8e643da5967c8b809575253 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 12:42:31 +0200 Subject: [PATCH 02/15] chore: fix modules Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 108 +++++++++--------- .github/workflows/release-artifacts.yml | 2 +- examples/src/main/java/module-info.java | 4 +- sdk-full/src/main/java/module-info.java | 10 +- sdk/src/main/java/module-info.java | 2 +- sdk/src/testIntegration/java/module-info.java | 2 +- settings.gradle.kts | 14 +-- .../hashgraph => hiero}/tck/TckServer.java | 2 +- .../tck/annotation/JSONRPC2Controller.java | 2 +- .../tck/annotation/JSONRPC2Method.java | 2 +- .../tck/annotation/JSONRPC2Service.java | 2 +- .../tck/config/BeanConfig.java | 2 +- .../tck/config/WebConfig.java | 4 +- .../tck/controller/JRPCController.java | 6 +- .../tck/controller/JRPCInterceptor.java | 2 +- .../InvalidJSONRPC2ParamsException.java | 2 +- .../InvalidJSONRPC2RequestException.java | 2 +- .../tck/methods/AbstractJSONRPC2Service.java | 16 +-- .../tck/methods/JSONRPC2Error.java | 4 +- .../tck/methods/JSONRPC2Param.java | 2 +- .../tck/methods/sdk/AccountService.java | 34 +++--- .../tck/methods/sdk/KeyService.java | 26 ++--- .../tck/methods/sdk/SdkService.java | 18 +-- .../tck/methods/sdk/TokenService.java | 44 +++---- .../sdk/param/AccountCreateParams.java | 4 +- .../sdk/param/AccountDeleteParams.java | 4 +- .../sdk/param/AccountUpdateParams.java | 4 +- .../sdk/param/CommonTransactionParams.java | 12 +- .../tck/methods/sdk/param/CustomFee.java | 4 +- .../methods/sdk/param/GenerateKeyParams.java | 6 +- .../tck/methods/sdk/param/SetupParams.java | 4 +- .../methods/sdk/param/TokenCreateParams.java | 4 +- .../methods/sdk/param/TokenDeleteParams.java | 4 +- .../methods/sdk/param/TokenUpdateParams.java | 4 +- .../methods/sdk/response/AccountResponse.java | 4 +- .../sdk/response/GenerateKeyResponse.java | 2 +- .../methods/sdk/response/SetupResponse.java | 2 +- .../methods/sdk/response/TokenResponse.java | 4 +- .../tck/util/JSONRPC2ServiceScanner.java | 4 +- .../tck/util/KeyUtils.java | 8 +- .../tck/controller/JRPCControllerTest.java | 2 +- .../tck/controller/JRPCInterceptorTest.java | 2 +- .../tck/methods/sdk/KeyServiceTest.java | 13 ++- .../tck/methods/sdk/SdkServiceTest.java | 6 +- .../sdk/param/AccountCreateParamsTest.java | 2 +- .../param/CommonTransactionParamsTest.java | 2 +- .../sdk/param/GenerateKeyParamsTest.java | 4 +- .../methods/sdk/param/SetupParamsTest.java | 2 +- .../sdk/response/SetupResponseTest.java | 2 +- 49 files changed, 211 insertions(+), 210 deletions(-) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/TckServer.java (96%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/annotation/JSONRPC2Controller.java (96%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/annotation/JSONRPC2Method.java (96%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/annotation/JSONRPC2Service.java (95%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/config/BeanConfig.java (95%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/config/WebConfig.java (91%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/controller/JRPCController.java (91%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/controller/JRPCInterceptor.java (98%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/exception/InvalidJSONRPC2ParamsException.java (96%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/exception/InvalidJSONRPC2RequestException.java (95%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/AbstractJSONRPC2Service.java (92%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/JSONRPC2Error.java (93%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/JSONRPC2Param.java (96%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/AccountService.java (87%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/KeyService.java (88%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/SdkService.java (83%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/TokenService.java (92%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/AccountCreateParams.java (97%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/AccountDeleteParams.java (92%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/AccountUpdateParams.java (96%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/CommonTransactionParams.java (92%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/CustomFee.java (97%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/GenerateKeyParams.java (93%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/SetupParams.java (94%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/TokenCreateParams.java (98%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/TokenDeleteParams.java (94%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/TokenUpdateParams.java (97%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/response/AccountResponse.java (89%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/response/GenerateKeyResponse.java (93%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/response/SetupResponse.java (94%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/response/TokenResponse.java (88%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/util/JSONRPC2ServiceScanner.java (93%) rename tck/src/main/java/com/{hedera/hashgraph => hiero}/tck/util/KeyUtils.java (92%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/controller/JRPCControllerTest.java (98%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/controller/JRPCInterceptorTest.java (98%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/KeyServiceTest.java (94%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/SdkServiceTest.java (92%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/AccountCreateParamsTest.java (99%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/CommonTransactionParamsTest.java (97%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/GenerateKeyParamsTest.java (97%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/param/SetupParamsTest.java (97%) rename tck/src/test/java/com/{hedera/hashgraph => hiero}/tck/methods/sdk/response/SetupResponseTest.java (97%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5a809d128..1d568be727 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,60 +110,60 @@ jobs: - name: Stop the local node run: npx @hashgraph/hedera-local stop - run-examples: - name: Run Examples - runs-on: client-sdk-linux-medium - needs: - - build - steps: - - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 - with: - egress-policy: audit - - - name: Checkout Code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Setup NodeJS - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 - with: - node-version: 18 - - - name: Setup Java - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 - with: - distribution: temurin - java-version: 17 - - - name: Setup Android SDK - uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1 - - - name: Install Local Node - run: npm install @hashgraph/hedera-local - - - name: Build SDK - run: ./gradlew assemble --scan - - - name: Build Android Example - run: ./gradlew -p example-android assemble --scan - - - name: Start the local node - run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.57.0 - - - name: Prepare .env for Examples - run: | - echo "OPERATOR_KEY=0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" > examples/.env - echo "OPERATOR_ID=0.0.1022" >> examples/.env - echo "HEDERA_NETWORK=localhost" >> examples/.env - - - name: Run Examples - run: ./gradlew :examples:runAllExamples --scan - - - name: Stop the local node - run: npx @hashgraph/hedera-local stop +# run-examples: +# name: Run Examples +# runs-on: client-sdk-linux-medium +# needs: +# - build +# steps: +# - name: Harden Runner +# uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 +# with: +# egress-policy: audit +# +# - name: Checkout Code +# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 +# +# - name: Setup NodeJS +# uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 +# with: +# node-version: 18 +# +# - name: Setup Java +# uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 +# with: +# distribution: temurin +# java-version: 17 +# +# - name: Setup Android SDK +# uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 +# +# - name: Setup Gradle +# uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1 +# +# - name: Install Local Node +# run: npm install @hashgraph/hedera-local +# +# - name: Build SDK +# run: ./gradlew assemble --scan +# +# - name: Build Android Example +# run: ./gradlew -p example-android assemble --scan +# +# - name: Start the local node +# run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.57.0 +# +# - name: Prepare .env for Examples +# run: | +# echo "OPERATOR_KEY=0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" > examples/.env +# echo "OPERATOR_ID=0.0.1022" >> examples/.env +# echo "HEDERA_NETWORK=localhost" >> examples/.env +# +# - name: Run Examples +# run: ./gradlew :examples:runAllExamples --scan +# +# - name: Stop the local node +# run: npx @hashgraph/hedera-local stop test-tck: name: TCK Tests diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index fb5d8aa71a..71944cfbd5 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -129,4 +129,4 @@ jobs: env: NEXUS_USERNAME: ${{ secrets.SONATYPE_USERNAME }} NEXUS_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - run: ./gradlew releaseMavenCentral -PpublishingPackageGroup=com.hedera.hashgraph -PpublishSigningEnabled=true --scan --no-configuration-cache + run: ./gradlew releaseMavenCentral -PpublishingPackageGroup=com.hiero -PpublishSigningEnabled=true --scan --no-configuration-cache diff --git a/examples/src/main/java/module-info.java b/examples/src/main/java/module-info.java index 7242d5b8cf..630793aa25 100644 --- a/examples/src/main/java/module-info.java +++ b/examples/src/main/java/module-info.java @@ -18,8 +18,8 @@ * */ -module com.hedera.hashgraph.examples { - requires com.hedera.hashgraph.sdk; // .full; +module com.hiero.examples { + requires com.hiero.sdk; // .full; requires com.google.gson; requires io.github.cdimascio.dotenv.java; requires org.bouncycastle.provider; diff --git a/sdk-full/src/main/java/module-info.java b/sdk-full/src/main/java/module-info.java index 19a4674b68..347a71d26d 100644 --- a/sdk-full/src/main/java/module-info.java +++ b/sdk-full/src/main/java/module-info.java @@ -18,7 +18,7 @@ * */ -module com.hedera.hashgraph.sdk.full { +module com.hiero.sdk.full { requires transitive com.google.protobuf; requires com.esaulpaugh.headlong; requires com.google.common; @@ -33,9 +33,9 @@ requires org.slf4j; requires static transitive java.annotation; - exports com.hedera.hashgraph.sdk; - exports com.hedera.hashgraph.sdk.logger; - exports com.hedera.hashgraph.sdk.proto; + exports com.hiero.sdk; + exports com.hiero.sdk.logger; + exports com.hiero.sdk.proto; - opens com.hedera.hashgraph.sdk; + opens com.hiero.sdk; } diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java index 28fc448daa..27dc991264 100644 --- a/sdk/src/main/java/module-info.java +++ b/sdk/src/main/java/module-info.java @@ -18,7 +18,7 @@ * */ -module com.hedera.hashgraph.sdk { +module com.hiero.sdk { requires transitive com.google.protobuf; requires com.esaulpaugh.headlong; requires com.google.common; diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java index 8a7e5c56a4..dc57bc8bcd 100644 --- a/sdk/src/testIntegration/java/module-info.java +++ b/sdk/src/testIntegration/java/module-info.java @@ -19,7 +19,7 @@ */ open module com.hiero.sdk.test.integration { - requires com.hedera.hashgraph.sdk; + requires com.hiero.sdk; requires com.esaulpaugh.headlong; requires org.assertj.core; requires org.bouncycastle.provider; diff --git a/settings.gradle.kts b/settings.gradle.kts index 5cf6caf797..263b9f4847 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 plugins { id("org.hiero.gradle.build") version "0.1.1" } -rootProject.name = "hedera-sdk-java" +rootProject.name = "hiero-sdk-java" javaModules { - module("sdk") { group = "com.hedera.hashgraph" } - module("sdk-full") { group = "com.hedera.hashgraph" } - module("tck") { group = "com.hedera.hashgraph.sdk.tck" } + module("sdk") { group = "com.hiero" } + module("sdk-full") { group = "com.hiero" } + module("tck") { group = "com.hiero.sdk.tck" } } -includeBuild("examples") - -includeBuild("example-android") +//includeBuild("examples") +// +//includeBuild("example-android") diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/TckServer.java b/tck/src/main/java/com/hiero/tck/TckServer.java similarity index 96% rename from tck/src/main/java/com/hedera/hashgraph/tck/TckServer.java rename to tck/src/main/java/com/hiero/tck/TckServer.java index cac9be0d8b..f9fd8927bb 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/TckServer.java +++ b/tck/src/main/java/com/hiero/tck/TckServer.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck; +package com.hiero.tck; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Controller.java b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java similarity index 96% rename from tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Controller.java rename to tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java index 8b8fb407a5..d19dc5e0f9 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Controller.java +++ b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.annotation; +package com.hiero.tck.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Method.java b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java similarity index 96% rename from tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Method.java rename to tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java index fdbee75da6..7bacc27a3a 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Method.java +++ b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.annotation; +package com.hiero.tck.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Service.java b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java similarity index 95% rename from tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Service.java rename to tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java index 19fe04535b..d934bf1438 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/annotation/JSONRPC2Service.java +++ b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.annotation; +package com.hiero.tck.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/config/BeanConfig.java b/tck/src/main/java/com/hiero/tck/config/BeanConfig.java similarity index 95% rename from tck/src/main/java/com/hedera/hashgraph/tck/config/BeanConfig.java rename to tck/src/main/java/com/hiero/tck/config/BeanConfig.java index 8033d3009f..72464d8b8c 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/config/BeanConfig.java +++ b/tck/src/main/java/com/hiero/tck/config/BeanConfig.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.config; +package com.hiero.tck.config; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import org.springframework.context.annotation.Bean; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/config/WebConfig.java b/tck/src/main/java/com/hiero/tck/config/WebConfig.java similarity index 91% rename from tck/src/main/java/com/hedera/hashgraph/tck/config/WebConfig.java rename to tck/src/main/java/com/hiero/tck/config/WebConfig.java index 1c5c9a082f..cd299709ed 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/config/WebConfig.java +++ b/tck/src/main/java/com/hiero/tck/config/WebConfig.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.config; +package com.hiero.tck.config; -import com.hedera.hashgraph.tck.controller.JRPCInterceptor; +import com.hiero.tck.controller.JRPCInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/controller/JRPCController.java b/tck/src/main/java/com/hiero/tck/controller/JRPCController.java similarity index 91% rename from tck/src/main/java/com/hedera/hashgraph/tck/controller/JRPCController.java rename to tck/src/main/java/com/hiero/tck/controller/JRPCController.java index 9ddaa6493d..6841ab83f4 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/controller/JRPCController.java +++ b/tck/src/main/java/com/hiero/tck/controller/JRPCController.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.controller; +package com.hiero.tck.controller; -import static com.hedera.hashgraph.tck.util.JSONRPC2ServiceScanner.registerServices; +import static com.hiero.tck.util.JSONRPC2ServiceScanner.registerServices; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Controller; +import com.hiero.tck.annotation.JSONRPC2Controller; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import jakarta.servlet.http.HttpServletRequest; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/controller/JRPCInterceptor.java b/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java similarity index 98% rename from tck/src/main/java/com/hedera/hashgraph/tck/controller/JRPCInterceptor.java rename to tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java index a137216fe8..b66bd59bd3 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/controller/JRPCInterceptor.java +++ b/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.controller; +package com.hiero.tck.controller; import com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/exception/InvalidJSONRPC2ParamsException.java b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java similarity index 96% rename from tck/src/main/java/com/hedera/hashgraph/tck/exception/InvalidJSONRPC2ParamsException.java rename to tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java index b29fa49b4a..8290c81d5a 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/exception/InvalidJSONRPC2ParamsException.java +++ b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.exception; +package com.hiero.tck.exception; /** * Thrown when the server cannot parse the given parameters. diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/exception/InvalidJSONRPC2RequestException.java b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java similarity index 95% rename from tck/src/main/java/com/hedera/hashgraph/tck/exception/InvalidJSONRPC2RequestException.java rename to tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java index 39354c22b5..7ba960c6aa 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/exception/InvalidJSONRPC2RequestException.java +++ b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.exception; +package com.hiero.tck.exception; /** * Thrown when the server cannot process the request diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/AbstractJSONRPC2Service.java b/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java similarity index 92% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/AbstractJSONRPC2Service.java rename to tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java index fcdf713dce..d79aabec5a 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/AbstractJSONRPC2Service.java +++ b/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods; +package com.hiero.tck.methods; -import static com.hedera.hashgraph.tck.methods.JSONRPC2Error.HEDERA_ERROR; +import static com.hiero.tck.methods.JSONRPC2Error.HEDERA_ERROR; -import com.hedera.hashgraph.sdk.PrecheckStatusException; -import com.hedera.hashgraph.sdk.ReceiptStatusException; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Method; -import com.hedera.hashgraph.tck.exception.InvalidJSONRPC2ParamsException; -import com.hedera.hashgraph.tck.exception.InvalidJSONRPC2RequestException; -import com.hedera.hashgraph.tck.methods.JSONRPC2Error.ErrorData; +import com.hiero.sdk.PrecheckStatusException; +import com.hiero.sdk.ReceiptStatusException; +import com.hiero.tck.annotation.JSONRPC2Method; +import com.hiero.tck.exception.InvalidJSONRPC2ParamsException; +import com.hiero.tck.exception.InvalidJSONRPC2RequestException; +import com.hiero.tck.methods.JSONRPC2Error.ErrorData; import com.thetransactioncompany.jsonrpc2.JSONRPC2Error; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/JSONRPC2Error.java b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java similarity index 93% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/JSONRPC2Error.java rename to tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java index c66648afd9..40698a186e 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/JSONRPC2Error.java +++ b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods; +package com.hiero.tck.methods; -import com.hedera.hashgraph.sdk.Status; +import com.hiero.sdk.Status; /** * Custom JSON-RPC error definitions diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/JSONRPC2Param.java b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java similarity index 96% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/JSONRPC2Param.java rename to tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java index c8954a8111..202194dcb3 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/JSONRPC2Param.java +++ b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods; +package com.hiero.tck.methods; import java.util.Map; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/AccountService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java similarity index 87% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/AccountService.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java index 576ac8117a..ec3cb884d1 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/AccountService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java @@ -17,25 +17,25 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk; +package com.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.AccountCreateTransaction; -import com.hedera.hashgraph.sdk.AccountDeleteTransaction; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.AccountUpdateTransaction; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.HbarUnit; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TransactionReceipt; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Method; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Service; -import com.hedera.hashgraph.tck.methods.AbstractJSONRPC2Service; -import com.hedera.hashgraph.tck.methods.sdk.param.AccountCreateParams; -import com.hedera.hashgraph.tck.methods.sdk.param.AccountDeleteParams; -import com.hedera.hashgraph.tck.methods.sdk.param.AccountUpdateParams; -import com.hedera.hashgraph.tck.methods.sdk.response.AccountResponse; -import com.hedera.hashgraph.tck.util.KeyUtils; +import com.hiero.sdk.AccountCreateTransaction; +import com.hiero.sdk.AccountDeleteTransaction; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.AccountUpdateTransaction; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.HbarUnit; +import com.hiero.sdk.Status; +import com.hiero.sdk.TransactionReceipt; +import com.hiero.tck.annotation.JSONRPC2Method; +import com.hiero.tck.annotation.JSONRPC2Service; +import com.hiero.tck.methods.AbstractJSONRPC2Service; +import com.hiero.tck.methods.sdk.param.AccountCreateParams; +import com.hiero.tck.methods.sdk.param.AccountDeleteParams; +import com.hiero.tck.methods.sdk.param.AccountUpdateParams; +import com.hiero.tck.methods.sdk.response.AccountResponse; +import com.hiero.tck.util.KeyUtils; import java.time.Duration; import java.time.Instant; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/KeyService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java similarity index 88% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/KeyService.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java index fae8f862df..e1725ee4f0 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/KeyService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java @@ -17,22 +17,22 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk; +package com.hiero.tck.methods.sdk; -import static com.hedera.hashgraph.tck.util.KeyUtils.KeyType.*; -import static com.hedera.hashgraph.tck.util.KeyUtils.getKeyFromString; +import static com.hiero.tck.util.KeyUtils.KeyType.*; +import static com.hiero.tck.util.KeyUtils.getKeyFromString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.Key; -import com.hedera.hashgraph.sdk.KeyList; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PublicKey; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Method; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Service; -import com.hedera.hashgraph.tck.exception.InvalidJSONRPC2RequestException; -import com.hedera.hashgraph.tck.methods.AbstractJSONRPC2Service; -import com.hedera.hashgraph.tck.methods.sdk.param.GenerateKeyParams; -import com.hedera.hashgraph.tck.methods.sdk.response.GenerateKeyResponse; +import com.hiero.sdk.Key; +import com.hiero.sdk.KeyList; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; +import com.hiero.tck.annotation.JSONRPC2Method; +import com.hiero.tck.annotation.JSONRPC2Service; +import com.hiero.tck.exception.InvalidJSONRPC2RequestException; +import com.hiero.tck.methods.AbstractJSONRPC2Service; +import com.hiero.tck.methods.sdk.param.GenerateKeyParams; +import com.hiero.tck.methods.sdk.response.GenerateKeyResponse; import org.bouncycastle.util.encoders.Hex; @JSONRPC2Service diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/SdkService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java similarity index 83% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/SdkService.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java index 70f1180212..3b98339871 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/SdkService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java @@ -17,16 +17,16 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk; +package com.hiero.tck.methods.sdk; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Method; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Service; -import com.hedera.hashgraph.tck.methods.AbstractJSONRPC2Service; -import com.hedera.hashgraph.tck.methods.sdk.param.SetupParams; -import com.hedera.hashgraph.tck.methods.sdk.response.SetupResponse; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.Client; +import com.hiero.sdk.PrivateKey; +import com.hiero.tck.annotation.JSONRPC2Method; +import com.hiero.tck.annotation.JSONRPC2Service; +import com.hiero.tck.methods.AbstractJSONRPC2Service; +import com.hiero.tck.methods.sdk.param.SetupParams; +import com.hiero.tck.methods.sdk.response.SetupResponse; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java similarity index 92% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java index 832678f27d..f0aefeef04 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java @@ -18,29 +18,29 @@ * */ -package com.hedera.hashgraph.tck.methods.sdk; +package com.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.AccountId; -import com.hedera.hashgraph.sdk.CustomFixedFee; -import com.hedera.hashgraph.sdk.CustomFractionalFee; -import com.hedera.hashgraph.sdk.CustomRoyaltyFee; -import com.hedera.hashgraph.sdk.Status; -import com.hedera.hashgraph.sdk.TokenCreateTransaction; -import com.hedera.hashgraph.sdk.TokenDeleteTransaction; -import com.hedera.hashgraph.sdk.TokenId; -import com.hedera.hashgraph.sdk.TokenSupplyType; -import com.hedera.hashgraph.sdk.TokenType; -import com.hedera.hashgraph.sdk.TokenUpdateTransaction; -import com.hedera.hashgraph.sdk.TransactionReceipt; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Method; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Service; -import com.hedera.hashgraph.tck.methods.AbstractJSONRPC2Service; -import com.hedera.hashgraph.tck.methods.sdk.param.TokenCreateParams; -import com.hedera.hashgraph.tck.methods.sdk.param.TokenDeleteParams; -import com.hedera.hashgraph.tck.methods.sdk.param.TokenUpdateParams; -import com.hedera.hashgraph.tck.methods.sdk.response.TokenResponse; -import com.hedera.hashgraph.tck.util.KeyUtils; +import com.hiero.sdk.AccountId; +import com.hiero.sdk.CustomFixedFee; +import com.hiero.sdk.CustomFractionalFee; +import com.hiero.sdk.CustomRoyaltyFee; +import com.hiero.sdk.Status; +import com.hiero.sdk.TokenCreateTransaction; +import com.hiero.sdk.TokenDeleteTransaction; +import com.hiero.sdk.TokenId; +import com.hiero.sdk.TokenSupplyType; +import com.hiero.sdk.TokenType; +import com.hiero.sdk.TokenUpdateTransaction; +import com.hiero.sdk.TransactionReceipt; +import com.hiero.tck.annotation.JSONRPC2Method; +import com.hiero.tck.annotation.JSONRPC2Service; +import com.hiero.tck.methods.AbstractJSONRPC2Service; +import com.hiero.tck.methods.sdk.param.TokenCreateParams; +import com.hiero.tck.methods.sdk.param.TokenDeleteParams; +import com.hiero.tck.methods.sdk.param.TokenUpdateParams; +import com.hiero.tck.methods.sdk.response.TokenResponse; +import com.hiero.tck.util.KeyUtils; import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -173,7 +173,7 @@ public TokenResponse createToken(final TokenCreateParams params) throws Exceptio params.getMaxSupply().ifPresent(maxSupply -> tokenCreateTransaction.setMaxSupply(Long.valueOf(maxSupply))); params.getCustomFees().ifPresent(customFees -> { - List customFeeList = new ArrayList<>(); + List customFeeList = new ArrayList<>(); for (var customFee : customFees) { // set fixed fees customFee.getFixedFee().ifPresent(fixedFee -> { diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountCreateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java similarity index 97% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountCreateParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java index 89b2e5883e..1a028a881b 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountCreateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountDeleteParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java similarity index 92% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountDeleteParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java index 1c318ccafc..c5ea95cfe4 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountDeleteParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java @@ -1,6 +1,6 @@ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountUpdateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java similarity index 96% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountUpdateParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java index e080c07448..5acd5c7872 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountUpdateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java @@ -1,6 +1,6 @@ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/CommonTransactionParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java similarity index 92% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/CommonTransactionParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java index 28d9aec662..7ff3eca6a4 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/CommonTransactionParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.sdk.Client; -import com.hedera.hashgraph.sdk.Hbar; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.Transaction; -import com.hedera.hashgraph.sdk.TransactionId; +import com.hiero.sdk.Client; +import com.hiero.sdk.Hbar; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.Transaction; +import com.hiero.sdk.TransactionId; import java.time.Duration; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/CustomFee.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java similarity index 97% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/CustomFee.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java index 990fba3cf2..5e408184c2 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/CustomFee.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java @@ -18,9 +18,9 @@ * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/GenerateKeyParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java similarity index 93% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/GenerateKeyParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java index 9072e99423..4de7be7de8 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/GenerateKeyParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java @@ -17,10 +17,10 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; -import com.hedera.hashgraph.tck.util.KeyUtils.KeyType; +import com.hiero.tck.methods.JSONRPC2Param; +import com.hiero.tck.util.KeyUtils.KeyType; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/SetupParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java similarity index 94% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/SetupParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java index 6687367ebb..ad146bba6f 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/SetupParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenCreateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java similarity index 98% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenCreateParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java index 49cbd450b7..35a5bcfb43 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenCreateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java @@ -18,9 +18,9 @@ * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenDeleteParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java similarity index 94% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenDeleteParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java index b65dd5d7e3..0075062e4e 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenDeleteParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java @@ -18,9 +18,9 @@ * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenUpdateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java similarity index 97% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenUpdateParams.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java index 01902fc8e5..56239acd3c 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenUpdateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java @@ -18,9 +18,9 @@ * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; -import com.hedera.hashgraph.tck.methods.JSONRPC2Param; +import com.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/AccountResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java similarity index 89% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/AccountResponse.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java index 63e803b905..3f2371cfb8 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/AccountResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.response; +package com.hiero.tck.methods.sdk.response; -import com.hedera.hashgraph.sdk.Status; +import com.hiero.sdk.Status; import lombok.Data; @Data diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/GenerateKeyResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java similarity index 93% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/GenerateKeyResponse.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java index ca45309bcf..ee48bd2b90 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/GenerateKeyResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.response; +package com.hiero.tck.methods.sdk.response; import java.util.ArrayList; import java.util.List; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/SetupResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java similarity index 94% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/SetupResponse.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java index 987753c578..8a7e241d75 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/SetupResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.response; +package com.hiero.tck.methods.sdk.response; import lombok.Data; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/TokenResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java similarity index 88% rename from tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/TokenResponse.java rename to tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java index 8c028f216b..11b6201186 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/response/TokenResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java @@ -18,9 +18,9 @@ * */ -package com.hedera.hashgraph.tck.methods.sdk.response; +package com.hiero.tck.methods.sdk.response; -import com.hedera.hashgraph.sdk.Status; +import com.hiero.sdk.Status; import lombok.Data; @Data diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/util/JSONRPC2ServiceScanner.java b/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java similarity index 93% rename from tck/src/main/java/com/hedera/hashgraph/tck/util/JSONRPC2ServiceScanner.java rename to tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java index 151a5785d8..e1aabd08fe 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/util/JSONRPC2ServiceScanner.java +++ b/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java @@ -17,9 +17,9 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.util; +package com.hiero.tck.util; -import com.hedera.hashgraph.tck.annotation.JSONRPC2Service; +import com.hiero.tck.annotation.JSONRPC2Service; import com.thetransactioncompany.jsonrpc2.server.*; import org.springframework.context.ApplicationContext; diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/util/KeyUtils.java b/tck/src/main/java/com/hiero/tck/util/KeyUtils.java similarity index 92% rename from tck/src/main/java/com/hedera/hashgraph/tck/util/KeyUtils.java rename to tck/src/main/java/com/hiero/tck/util/KeyUtils.java index 1de9b38ef0..9746901276 100644 --- a/tck/src/main/java/com/hedera/hashgraph/tck/util/KeyUtils.java +++ b/tck/src/main/java/com/hiero/tck/util/KeyUtils.java @@ -17,13 +17,13 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.util; +package com.hiero.tck.util; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hedera.hashgraph.sdk.Key; -import com.hedera.hashgraph.sdk.PrivateKey; -import com.hedera.hashgraph.sdk.PublicKey; +import com.hiero.sdk.Key; +import com.hiero.sdk.PrivateKey; +import com.hiero.sdk.PublicKey; public final class KeyUtils { diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/controller/JRPCControllerTest.java b/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java similarity index 98% rename from tck/src/test/java/com/hedera/hashgraph/tck/controller/JRPCControllerTest.java rename to tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java index 7660478d96..94982b5fe2 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/controller/JRPCControllerTest.java +++ b/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.controller; +package com.hiero.tck.controller; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/controller/JRPCInterceptorTest.java b/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java similarity index 98% rename from tck/src/test/java/com/hedera/hashgraph/tck/controller/JRPCInterceptorTest.java rename to tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java index acdb7b7282..6f64ce3929 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/controller/JRPCInterceptorTest.java +++ b/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.controller; +package com.hiero.tck.controller; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/KeyServiceTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java similarity index 94% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/KeyServiceTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java index eb9f3bdfd1..7c0edb51a3 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/KeyServiceTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java @@ -17,16 +17,17 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk; +package com.hiero.tck.methods.sdk; -import static com.hedera.hashgraph.tck.util.KeyUtils.KeyType.*; +import static com.hiero.tck.util.KeyUtils.KeyType.*; import static org.junit.jupiter.api.Assertions.*; -import com.hedera.hashgraph.tck.exception.InvalidJSONRPC2RequestException; -import com.hedera.hashgraph.tck.methods.sdk.param.GenerateKeyParams; -import com.hedera.hashgraph.tck.methods.sdk.response.GenerateKeyResponse; +import com.hiero.tck.exception.InvalidJSONRPC2RequestException; +import com.hiero.tck.methods.sdk.param.GenerateKeyParams; +import com.hiero.tck.methods.sdk.response.GenerateKeyResponse; import java.util.Collections; import java.util.Optional; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; @@ -41,7 +42,7 @@ void testGenerateKeyWithInvalidFromKey() { Executable executable = () -> keyService.generateKey(params); - assertThrows( + Assertions.assertThrows( InvalidJSONRPC2RequestException.class, executable, "invalid parameters: fromKey should only be provided for ed25519PublicKey, ecdsaSecp256k1PublicKey, or evmAddress types."); diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/SdkServiceTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java similarity index 92% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/SdkServiceTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java index 4f01fa0868..314fb4206f 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/SdkServiceTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java @@ -17,14 +17,14 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk; +package com.hiero.tck.methods.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hedera.hashgraph.tck.methods.sdk.param.SetupParams; -import com.hedera.hashgraph.tck.methods.sdk.response.SetupResponse; +import com.hiero.tck.methods.sdk.param.SetupParams; +import com.hiero.tck.methods.sdk.response.SetupResponse; import java.util.Optional; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountCreateParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java similarity index 99% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountCreateParamsTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java index 49c2ca2cd9..6d32b33bf9 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/AccountCreateParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/CommonTransactionParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java similarity index 97% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/CommonTransactionParamsTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java index af13bf44ef..04dfbf337f 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/CommonTransactionParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/GenerateKeyParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java similarity index 97% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/GenerateKeyParamsTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java index 0263fc022e..3b5e8f57a3 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/GenerateKeyParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java @@ -17,11 +17,11 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; -import com.hedera.hashgraph.tck.util.KeyUtils.KeyType; +import com.hiero.tck.util.KeyUtils.KeyType; import java.util.HashMap; import java.util.Map; import java.util.Optional; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/SetupParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java similarity index 97% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/SetupParamsTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java index eefd98b26c..c159d64bba 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/param/SetupParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.param; +package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/response/SetupResponseTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java similarity index 97% rename from tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/response/SetupResponseTest.java rename to tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java index 5acdf20e75..29f39611b8 100644 --- a/tck/src/test/java/com/hedera/hashgraph/tck/methods/sdk/response/SetupResponseTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java @@ -17,7 +17,7 @@ * limitations under the License. * */ -package com.hedera.hashgraph.tck.methods.sdk.response; +package com.hiero.tck.methods.sdk.response; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; From e12d80b17c1660c76844506f90f2a54fea61a5d2 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 13:15:59 +0200 Subject: [PATCH 03/15] refactor: spotless apply Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 2 +- .../sdk/AbstractTokenTransferTransaction.java | 99 +- .../AccountAllowanceAdjustTransaction.java | 138 +- .../AccountAllowanceApproveTransaction.java | 169 +- .../AccountAllowanceDeleteTransaction.java | 59 +- .../java/com/hiero/sdk/AccountBalance.java | 47 +- .../com/hiero/sdk/AccountBalanceQuery.java | 27 +- .../hiero/sdk/AccountCreateTransaction.java | 41 +- .../hiero/sdk/AccountDeleteTransaction.java | 31 +- .../main/java/com/hiero/sdk/AccountId.java | 126 +- .../main/java/com/hiero/sdk/AccountInfo.java | 200 +- .../java/com/hiero/sdk/AccountInfoFlow.java | 64 +- .../java/com/hiero/sdk/AccountInfoQuery.java | 23 +- .../com/hiero/sdk/AccountRecordsQuery.java | 26 +- .../com/hiero/sdk/AccountStakersQuery.java | 26 +- .../hiero/sdk/AccountUpdateTransaction.java | 44 +- .../java/com/hiero/sdk/AddressBookQuery.java | 101 +- .../java/com/hiero/sdk/AssessedCustomFee.java | 56 +- .../com/hiero/sdk/BadEntityIdException.java | 20 +- .../java/com/hiero/sdk/BadKeyException.java | 20 +- .../com/hiero/sdk/BadMnemonicException.java | 22 +- .../java/com/hiero/sdk/BadMnemonicReason.java | 20 +- .../main/java/com/hiero/sdk/BaseNetwork.java | 55 +- sdk/src/main/java/com/hiero/sdk/BaseNode.java | 35 +- .../java/com/hiero/sdk/BaseNodeAddress.java | 27 +- .../com/hiero/sdk/ChunkedTransaction.java | 135 +- sdk/src/main/java/com/hiero/sdk/Client.java | 176 +- .../java/com/hiero/sdk/ConsumerHelper.java | 20 +- .../com/hiero/sdk/ContractByteCodeQuery.java | 26 +- .../java/com/hiero/sdk/ContractCallQuery.java | 26 +- .../com/hiero/sdk/ContractCreateFlow.java | 126 +- .../hiero/sdk/ContractCreateTransaction.java | 34 +- .../hiero/sdk/ContractDeleteTransaction.java | 33 +- .../hiero/sdk/ContractExecuteTransaction.java | 31 +- .../hiero/sdk/ContractFunctionParameters.java | 273 +- .../com/hiero/sdk/ContractFunctionResult.java | 93 +- .../hiero/sdk/ContractFunctionSelector.java | 27 +- .../main/java/com/hiero/sdk/ContractId.java | 51 +- .../main/java/com/hiero/sdk/ContractInfo.java | 142 +- .../java/com/hiero/sdk/ContractInfoQuery.java | 23 +- .../java/com/hiero/sdk/ContractLogInfo.java | 44 +- .../java/com/hiero/sdk/ContractNonceInfo.java | 45 +- .../com/hiero/sdk/ContractStateChange.java | 23 +- .../hiero/sdk/ContractUpdateTransaction.java | 43 +- sdk/src/main/java/com/hiero/sdk/Crypto.java | 65 +- .../main/java/com/hiero/sdk/CustomFee.java | 39 +- .../java/com/hiero/sdk/CustomFeeBase.java | 22 +- .../java/com/hiero/sdk/CustomFixedFee.java | 46 +- .../com/hiero/sdk/CustomFractionalFee.java | 76 +- .../java/com/hiero/sdk/CustomRoyaltyFee.java | 52 +- sdk/src/main/java/com/hiero/sdk/Delayer.java | 29 +- .../com/hiero/sdk/DelegateContractId.java | 31 +- .../java/com/hiero/sdk/DurationConverter.java | 27 +- sdk/src/main/java/com/hiero/sdk/Endpoint.java | 39 +- .../java/com/hiero/sdk/EntityIdHelper.java | 130 +- .../main/java/com/hiero/sdk/EthereumFlow.java | 105 +- .../com/hiero/sdk/EthereumTransaction.java | 36 +- .../hiero/sdk/EthereumTransactionData.java | 20 +- .../sdk/EthereumTransactionDataEip1559.java | 113 +- .../sdk/EthereumTransactionDataLegacy.java | 85 +- .../main/java/com/hiero/sdk/EvmAddress.java | 32 +- .../main/java/com/hiero/sdk/ExchangeRate.java | 35 +- .../java/com/hiero/sdk/ExchangeRates.java | 35 +- .../main/java/com/hiero/sdk/Executable.java | 322 +- .../java/com/hiero/sdk/ExecutionState.java | 20 +- .../com/hiero/sdk/FeeAssessmentMethod.java | 20 +- .../java/com/hiero/sdk/FeeComponents.java | 96 +- sdk/src/main/java/com/hiero/sdk/FeeData.java | 48 +- .../main/java/com/hiero/sdk/FeeDataType.java | 21 +- .../main/java/com/hiero/sdk/FeeSchedule.java | 44 +- .../main/java/com/hiero/sdk/FeeSchedules.java | 41 +- .../com/hiero/sdk/FileAppendTransaction.java | 3 +- .../java/com/hiero/sdk/FileContentsQuery.java | 23 +- .../com/hiero/sdk/FileCreateTransaction.java | 30 +- .../com/hiero/sdk/FileDeleteTransaction.java | 29 +- sdk/src/main/java/com/hiero/sdk/FileId.java | 36 +- sdk/src/main/java/com/hiero/sdk/FileInfo.java | 86 +- .../java/com/hiero/sdk/FileInfoQuery.java | 23 +- .../com/hiero/sdk/FileUpdateTransaction.java | 37 +- .../java/com/hiero/sdk/FreezeTransaction.java | 39 +- .../main/java/com/hiero/sdk/FreezeType.java | 24 +- .../java/com/hiero/sdk/FutureConverter.java | 105 +- sdk/src/main/java/com/hiero/sdk/Hbar.java | 37 +- .../java/com/hiero/sdk/HbarAllowance.java | 51 +- sdk/src/main/java/com/hiero/sdk/HbarUnit.java | 20 +- .../sdk/HederaPreCheckStatusException.java | 20 +- .../sdk/HederaReceiptStatusException.java | 20 +- .../com/hiero/sdk/HederaTrustManager.java | 47 +- .../java/com/hiero/sdk/InstantConverter.java | 39 +- sdk/src/main/java/com/hiero/sdk/Key.java | 32 +- sdk/src/main/java/com/hiero/sdk/KeyList.java | 42 +- sdk/src/main/java/com/hiero/sdk/Keystore.java | 32 +- sdk/src/main/java/com/hiero/sdk/LedgerId.java | 34 +- sdk/src/main/java/com/hiero/sdk/LiveHash.java | 52 +- .../com/hiero/sdk/LiveHashAddTransaction.java | 32 +- .../hiero/sdk/LiveHashDeleteTransaction.java | 31 +- .../java/com/hiero/sdk/LiveHashQuery.java | 27 +- .../main/java/com/hiero/sdk/LockableList.java | 25 +- .../sdk/MaxAttemptsExceededException.java | 20 +- .../sdk/MaxQueryPaymentExceededException.java | 27 +- .../java/com/hiero/sdk/MirrorNetwork.java | 20 +- .../main/java/com/hiero/sdk/MirrorNode.java | 20 +- .../sdk/MirrorNodeContractCallQuery.java | 21 +- .../MirrorNodeContractEstimateGasQuery.java | 21 +- .../hiero/sdk/MirrorNodeContractQuery.java | 83 +- sdk/src/main/java/com/hiero/sdk/Mnemonic.java | 89 +- sdk/src/main/java/com/hiero/sdk/Network.java | 87 +- .../main/java/com/hiero/sdk/NetworkName.java | 23 +- .../com/hiero/sdk/NetworkVersionInfo.java | 31 +- .../hiero/sdk/NetworkVersionInfoQuery.java | 26 +- sdk/src/main/java/com/hiero/sdk/NftId.java | 32 +- sdk/src/main/java/com/hiero/sdk/Node.java | 28 +- .../main/java/com/hiero/sdk/NodeAddress.java | 67 +- .../java/com/hiero/sdk/NodeAddressBook.java | 28 +- .../com/hiero/sdk/NodeCreateTransaction.java | 26 +- .../com/hiero/sdk/NodeDeleteTransaction.java | 25 +- .../com/hiero/sdk/NodeUpdateTransaction.java | 26 +- sdk/src/main/java/com/hiero/sdk/Pem.java | 74 +- .../java/com/hiero/sdk/PendingAirdropId.java | 50 +- .../com/hiero/sdk/PendingAirdropLogic.java | 26 +- .../com/hiero/sdk/PendingAirdropRecord.java | 36 +- .../hiero/sdk/PrecheckStatusException.java | 25 +- .../main/java/com/hiero/sdk/PrivateKey.java | 37 +- .../java/com/hiero/sdk/PrivateKeyECDSA.java | 50 +- .../java/com/hiero/sdk/PrivateKeyED25519.java | 36 +- .../java/com/hiero/sdk/PrngTransaction.java | 27 +- .../main/java/com/hiero/sdk/ProxyStaker.java | 25 +- .../main/java/com/hiero/sdk/PublicKey.java | 34 +- .../java/com/hiero/sdk/PublicKeyECDSA.java | 54 +- .../java/com/hiero/sdk/PublicKeyED25519.java | 43 +- sdk/src/main/java/com/hiero/sdk/Query.java | 129 +- .../com/hiero/sdk/ReceiptStatusException.java | 20 +- .../main/java/com/hiero/sdk/RequestType.java | 20 +- .../hiero/sdk/ScheduleCreateTransaction.java | 30 +- .../hiero/sdk/ScheduleDeleteTransaction.java | 27 +- .../main/java/com/hiero/sdk/ScheduleId.java | 33 +- .../main/java/com/hiero/sdk/ScheduleInfo.java | 129 +- .../java/com/hiero/sdk/ScheduleInfoQuery.java | 23 +- .../hiero/sdk/ScheduleSignTransaction.java | 26 +- .../java/com/hiero/sdk/SemanticVersion.java | 34 +- .../main/java/com/hiero/sdk/StakingInfo.java | 64 +- sdk/src/main/java/com/hiero/sdk/Status.java | 46 +- .../java/com/hiero/sdk/StorageChange.java | 29 +- .../com/hiero/sdk/SubscriptionHandle.java | 23 +- .../hiero/sdk/SystemDeleteTransaction.java | 31 +- .../hiero/sdk/SystemUndeleteTransaction.java | 32 +- .../hiero/sdk/ThreadLocalSecureRandom.java | 36 +- .../hiero/sdk/TokenAirdropTransaction.java | 47 +- .../java/com/hiero/sdk/TokenAllowance.java | 66 +- .../hiero/sdk/TokenAssociateTransaction.java | 28 +- .../java/com/hiero/sdk/TokenAssociation.java | 41 +- .../com/hiero/sdk/TokenBurnTransaction.java | 31 +- .../sdk/TokenCancelAirdropTransaction.java | 25 +- .../sdk/TokenClaimAirdropTransaction.java | 24 +- .../com/hiero/sdk/TokenCreateTransaction.java | 43 +- .../com/hiero/sdk/TokenDeleteTransaction.java | 29 +- .../hiero/sdk/TokenDissociateTransaction.java | 28 +- .../TokenFeeScheduleUpdateTransaction.java | 33 +- .../com/hiero/sdk/TokenFreezeTransaction.java | 30 +- .../hiero/sdk/TokenGrantKycTransaction.java | 31 +- sdk/src/main/java/com/hiero/sdk/TokenId.java | 35 +- .../main/java/com/hiero/sdk/TokenInfo.java | 237 +- .../java/com/hiero/sdk/TokenInfoQuery.java | 23 +- .../com/hiero/sdk/TokenKeyValidation.java | 20 +- .../com/hiero/sdk/TokenMintTransaction.java | 31 +- .../java/com/hiero/sdk/TokenNftAllowance.java | 82 +- .../main/java/com/hiero/sdk/TokenNftInfo.java | 73 +- .../java/com/hiero/sdk/TokenNftInfoQuery.java | 36 +- .../java/com/hiero/sdk/TokenNftTransfer.java | 74 +- .../com/hiero/sdk/TokenPauseTransaction.java | 31 +- .../java/com/hiero/sdk/TokenRejectFlow.java | 65 +- .../com/hiero/sdk/TokenRejectTransaction.java | 36 +- .../java/com/hiero/sdk/TokenRelationship.java | 94 +- .../hiero/sdk/TokenRevokeKycTransaction.java | 30 +- .../java/com/hiero/sdk/TokenSupplyType.java | 20 +- .../java/com/hiero/sdk/TokenTransfer.java | 60 +- .../java/com/hiero/sdk/TokenTransferList.java | 38 +- .../main/java/com/hiero/sdk/TokenType.java | 20 +- .../hiero/sdk/TokenUnfreezeTransaction.java | 31 +- .../hiero/sdk/TokenUnpauseTransaction.java | 31 +- .../hiero/sdk/TokenUpdateNftsTransaction.java | 27 +- .../com/hiero/sdk/TokenUpdateTransaction.java | 30 +- .../com/hiero/sdk/TokenWipeTransaction.java | 32 +- .../com/hiero/sdk/TopicCreateTransaction.java | 26 +- .../com/hiero/sdk/TopicDeleteTransaction.java | 29 +- sdk/src/main/java/com/hiero/sdk/TopicId.java | 33 +- .../main/java/com/hiero/sdk/TopicInfo.java | 117 +- .../java/com/hiero/sdk/TopicInfoQuery.java | 26 +- .../main/java/com/hiero/sdk/TopicMessage.java | 78 +- .../java/com/hiero/sdk/TopicMessageChunk.java | 21 +- .../java/com/hiero/sdk/TopicMessageQuery.java | 75 +- .../sdk/TopicMessageSubmitTransaction.java | 62 +- .../com/hiero/sdk/TopicUpdateTransaction.java | 33 +- .../main/java/com/hiero/sdk/Transaction.java | 397 +-- .../com/hiero/sdk/TransactionFeeSchedule.java | 47 +- .../java/com/hiero/sdk/TransactionId.java | 100 +- .../com/hiero/sdk/TransactionReceipt.java | 204 +- .../hiero/sdk/TransactionReceiptQuery.java | 42 +- .../java/com/hiero/sdk/TransactionRecord.java | 259 +- .../com/hiero/sdk/TransactionRecordQuery.java | 44 +- .../com/hiero/sdk/TransactionResponse.java | 86 +- sdk/src/main/java/com/hiero/sdk/Transfer.java | 35 +- .../com/hiero/sdk/TransferTransaction.java | 75 +- .../java/com/hiero/sdk/logger/LogLevel.java | 20 +- .../java/com/hiero/sdk/logger/Logger.java | 20 +- .../java/com/hiero/sdk/utils/Bip32Utils.java | 20 +- .../java/com/hiero/logger/LoggerTest.java | 11 +- ...ccountAllowanceApproveTransactionTest.java | 119 +- ...AccountAllowanceDeleteTransactionTest.java | 65 +- .../hiero/sdk/AccountBalanceQueryTest.java | 37 +- .../sdk/AccountCreateTransactionTest.java | 99 +- .../sdk/AccountDeleteTransactionTest.java | 63 +- .../java/com/hiero/sdk/AccountIdTest.java | 101 +- .../com/hiero/sdk/AccountInfoQueryTest.java | 32 +- .../java/com/hiero/sdk/AccountInfoTest.java | 83 +- .../hiero/sdk/AccountRecordsQueryTest.java | 32 +- .../hiero/sdk/AccountStakersQueryTest.java | 32 +- .../sdk/AccountUpdateTransactionTest.java | 99 +- .../hiero/sdk/AddressBookQueryMockTest.java | 142 +- .../java/com/hiero/sdk/AllowancesTest.java | 79 +- .../com/hiero/sdk/AssessedCustomFeeTest.java | 45 +- .../com/hiero/sdk/BaseNodeAddressTest.java | 31 +- .../java/com/hiero/sdk/ClientCloseTest.java | 25 +- .../test/java/com/hiero/sdk/ClientTest.java | 242 +- .../com/hiero/sdk/ConsumerHelperTest.java | 14 +- .../hiero/sdk/ContractByteCodeQueryTest.java | 29 +- .../com/hiero/sdk/ContractCallQueryTest.java | 70 +- .../sdk/ContractCreateTransactionTest.java | 109 +- .../sdk/ContractDeleteTransactionTest.java | 63 +- .../sdk/ContractExecuteTransactionTest.java | 64 +- .../sdk/ContractFunctionParametersTest.java | 741 ++-- .../hiero/sdk/ContractFunctionResultTest.java | 93 +- .../sdk/ContractFunctionSelectorTest.java | 86 +- .../java/com/hiero/sdk/ContractIdTest.java | 54 +- .../com/hiero/sdk/ContractInfoQueryTest.java | 29 +- .../java/com/hiero/sdk/ContractInfoTest.java | 45 +- .../com/hiero/sdk/ContractLogInfoTest.java | 28 +- .../com/hiero/sdk/ContractNonceInfoTest.java | 18 +- .../sdk/ContractUpdateTransactionTest.java | 109 +- .../sdk/CryptoTransferTransactionTest.java | 183 +- .../java/com/hiero/sdk/CustomFeeListTest.java | 68 +- .../com/hiero/sdk/CustomFixedFeeTest.java | 45 +- .../hiero/sdk/CustomFractionalFeeTest.java | 26 +- .../com/hiero/sdk/CustomRoyaltyFeeTest.java | 41 +- .../com/hiero/sdk/DelegateContractIdTest.java | 39 +- .../hiero/sdk/DuplicateTransactionTest.java | 10 +- .../com/hiero/sdk/ECDSAPrivateKeyTest.java | 95 +- .../com/hiero/sdk/ECDSAPublicKeyTest.java | 139 +- .../com/hiero/sdk/Ed25519PrivateKeyTest.java | 192 +- .../com/hiero/sdk/Ed25519PublicKeyTest.java | 115 +- .../com/hiero/sdk/EthereumFlowMockTest.java | 109 +- .../EthereumTransactionDataLegacyTest.java | 26 +- .../hiero/sdk/EthereumTransactionTest.java | 40 +- .../java/com/hiero/sdk/ExchangeRatesTest.java | 31 +- .../java/com/hiero/sdk/ExecutableTest.java | 244 +- .../hiero/sdk/FeeAssessmentMethodTest.java | 12 +- .../java/com/hiero/sdk/FeeSchedulesTest.java | 79 +- .../hiero/sdk/FileAppendTransactionTest.java | 209 +- .../com/hiero/sdk/FileContentsQueryTest.java | 29 +- .../hiero/sdk/FileCreateTransactionTest.java | 63 +- .../hiero/sdk/FileDeleteTransactionTest.java | 58 +- .../test/java/com/hiero/sdk/FileIdTest.java | 29 +- .../java/com/hiero/sdk/FileInfoQueryTest.java | 29 +- .../test/java/com/hiero/sdk/FileInfoTest.java | 55 +- .../hiero/sdk/FileUpdateTransactionTest.java | 68 +- .../com/hiero/sdk/FreezeTransactionTest.java | 70 +- sdk/src/test/java/com/hiero/sdk/Function.java | 1 + sdk/src/test/java/com/hiero/sdk/HbarTest.java | 49 +- .../com/hiero/sdk/HederaTrustManagerTest.java | 104 +- .../test/java/com/hiero/sdk/KeyListTest.java | 51 +- sdk/src/test/java/com/hiero/sdk/KeyTest.java | 107 +- .../test/java/com/hiero/sdk/KeystoreTest.java | 32 +- .../java/com/hiero/sdk/ListInputTest.java | 44 +- .../hiero/sdk/LiveHashAddTransactionTest.java | 39 +- .../sdk/LiveHashDeleteTransactionTest.java | 35 +- .../java/com/hiero/sdk/LiveHashQueryTest.java | 12 +- .../MaxQueryPaymentExceededExceptionTest.java | 39 +- .../sdk/MessageSubmitTransactionTest.java | 62 +- .../sdk/MirrorNodeContractQueryTest.java | 91 +- .../test/java/com/hiero/sdk/MnemonicTest.java | 536 ++- sdk/src/test/java/com/hiero/sdk/Mocker.java | 109 +- .../test/java/com/hiero/sdk/MockingTest.java | 483 ++- .../sdk/NetworkVersionInfoQueryTest.java | 26 +- .../com/hiero/sdk/NetworkVersionInfoTest.java | 17 +- .../test/java/com/hiero/sdk/NftIdTest.java | 46 +- .../hiero/sdk/NodeCreateTransactionTest.java | 112 +- .../hiero/sdk/NodeDeleteTransactionTest.java | 48 +- .../hiero/sdk/NodeUpdateTransactionTest.java | 121 +- .../com/hiero/sdk/PendingAirdropIdTest.java | 41 +- .../java/com/hiero/sdk/PrivateKeyTest.java | 59 +- .../com/hiero/sdk/PrngTransactionTest.java | 62 +- .../java/com/hiero/sdk/ProxyStakerTest.java | 13 +- .../hiero/sdk/ReceiptStatusExceptionTest.java | 26 +- .../sdk/RegenerateTransactionIdsTest.java | 50 +- .../java/com/hiero/sdk/RequestTypeTest.java | 15 +- .../sdk/ScheduleCreateTransactionTest.java | 68 +- .../sdk/ScheduleDeleteTransactionTest.java | 58 +- .../com/hiero/sdk/ScheduleInfoQueryTest.java | 32 +- .../java/com/hiero/sdk/ScheduleInfoTest.java | 98 +- .../sdk/ScheduleSignTransactionTest.java | 54 +- sdk/src/test/java/com/hiero/sdk/Snapshot.java | 32 +- .../java/com/hiero/sdk/StakingInfoTest.java | 39 +- .../test/java/com/hiero/sdk/StatusTest.java | 33 +- .../sdk/SystemDeleteTransactionTest.java | 100 +- .../sdk/SystemUndeleteTransactionTest.java | 76 +- .../test/java/com/hiero/sdk/TestResponse.java | 50 +- .../test/java/com/hiero/sdk/TestServer.java | 30 +- .../test/java/com/hiero/sdk/TestService.java | 41 +- .../sdk/TokenAirdropTransactionTest.java | 98 +- .../com/hiero/sdk/TokenAllowanceTest.java | 21 +- .../sdk/TokenAssociateTransactionTest.java | 77 +- .../com/hiero/sdk/TokenAssociationTest.java | 30 +- .../hiero/sdk/TokenBurnTransactionTest.java | 78 +- .../TokenCancelAirdropTransactionTest.java | 80 +- .../sdk/TokenClaimAirdropTransactionTest.java | 79 +- .../hiero/sdk/TokenCreateTransactionTest.java | 237 +- .../hiero/sdk/TokenDeleteTransactionTest.java | 62 +- .../sdk/TokenDissociateTransactionTest.java | 71 +- ...TokenFeeScheduleUpdateTransactionTest.java | 75 +- .../hiero/sdk/TokenFreezeTransactionTest.java | 60 +- .../sdk/TokenGrantKycTransactionTest.java | 62 +- .../com/hiero/sdk/TokenInfoQueryTest.java | 36 +- .../java/com/hiero/sdk/TokenInfoTest.java | 216 +- .../hiero/sdk/TokenMintTransactionTest.java | 84 +- .../com/hiero/sdk/TokenNftInfoQueryTest.java | 30 +- .../java/com/hiero/sdk/TokenNftInfoTest.java | 29 +- .../hiero/sdk/TokenPauseTransactionTest.java | 59 +- .../hiero/sdk/TokenRejectTransactionTest.java | 71 +- .../com/hiero/sdk/TokenRelationshipTest.java | 22 +- .../sdk/TokenRevokeKycTransactionTest.java | 62 +- .../com/hiero/sdk/TokenSupplyTypeTest.java | 21 +- .../java/com/hiero/sdk/TokenTypeTest.java | 32 +- .../sdk/TokenUnfreezeTransactionTest.java | 61 +- .../sdk/TokenUnpauseTransactionTest.java | 59 +- .../sdk/TokenUpdateNftsTransactionTest.java | 61 +- .../hiero/sdk/TokenUpdateTransactionTest.java | 144 +- .../hiero/sdk/TokenWipeTransactionTest.java | 98 +- .../hiero/sdk/TopicCreateTransactionTest.java | 68 +- .../hiero/sdk/TopicDeleteTransactionTest.java | 60 +- .../test/java/com/hiero/sdk/TopicIdTest.java | 29 +- .../com/hiero/sdk/TopicInfoQueryTest.java | 29 +- .../java/com/hiero/sdk/TopicInfoTest.java | 66 +- .../com/hiero/sdk/TopicMessageChunkTest.java | 30 +- .../com/hiero/sdk/TopicMessageQueryTest.java | 236 +- .../TopicMessageSubmitTransactionTest.java | 75 +- .../java/com/hiero/sdk/TopicMessageTest.java | 72 +- .../hiero/sdk/TopicUpdateTransactionTest.java | 122 +- .../java/com/hiero/sdk/TransactionIdTest.java | 52 +- .../sdk/TransactionReceiptQueryTest.java | 36 +- .../com/hiero/sdk/TransactionReceiptTest.java | 60 +- .../hiero/sdk/TransactionRecordQueryTest.java | 38 +- .../com/hiero/sdk/TransactionRecordTest.java | 156 +- .../java/com/hiero/sdk/TransactionTest.java | 97 +- .../AccountAllowanceIntegrationTest.java | 84 +- .../AccountBalanceIntegrationTest.java | 139 +- .../AccountCreateIntegrationTest.java | 276 +- .../AccountDeleteIntegrationTest.java | 84 +- .../AccountIdPopulationIntegrationTest.java | 83 +- .../AccountInfoIntegrationTest.java | 96 +- .../AccountRecordsIntegrationTest.java | 61 +- .../AccountStakersIntegrationTest.java | 39 +- .../AccountUpdateIntegrationTest.java | 71 +- .../integration/ClientIntegrationTest.java | 103 +- .../hiero/sdk/test/integration/Contents.java | 114 +- .../ContractBytecodeIntegrationTest.java | 401 ++- .../ContractCallIntegrationTest.java | 381 +-- .../ContractCreateFlowIntegrationTest.java | 172 +- .../ContractCreateIntegrationTest.java | 190 +- .../ContractDeleteIntegrationTest.java | 125 +- .../ContractExecuteIntegrationTest.java | 200 +- ...ractFunctionParametersIntegrationTest.java | 2067 ++++++++---- .../ContractIdPopulationIntegrationTest.java | 78 +- .../ContractInfoIntegrationTest.java | 226 +- .../ContractNonceInfoIntegrationTest.java | 67 +- .../ContractUpdateIntegrationTest.java | 143 +- .../sdk/test/integration/EntityHelper.java | 122 +- .../EthereumTransactionIntegrationTest.java | 113 +- .../test/integration/FeeSchedulesTest.java | 36 +- .../FileAppendIntegrationTest.java | 132 +- .../FileContentsIntegrationTest.java | 143 +- .../FileCreateIntegrationTest.java | 74 +- .../FileDeleteIntegrationTest.java | 73 +- .../integration/FileInfoIntegrationTest.java | 123 +- .../FileUpdateIntegrationTest.java | 122 +- .../test/integration/IntegrationTestEnv.java | 74 +- .../LiveHashAddIntegrationTest.java | 61 +- .../LiveHashDeleteIntegrationTest.java | 55 +- .../test/integration/LoadIntegrationTest.java | 32 +- ...irrorNodeContractQueryIntegrationTest.java | 295 +- .../NetworkVersionInfoIntegrationTest.java | 24 +- .../NftAllowancesIntegrationTest.java | 466 ++- .../integration/NftMetadataGenerator.java | 27 +- .../NodeCreateTransactionIntegrationTest.java | 49 +- .../ReceiptQueryIntegrationTest.java | 127 +- .../ScheduleCreateIntegrationTest.java | 682 ++-- .../integration/SystemIntegrationTest.java | 92 +- .../TokenAirdropCancelIntegrationTest.java | 302 +- .../TokenAirdropClaimIntegrationTest.java | 395 ++- ...okenAirdropTransactionIntegrationTest.java | 386 +-- ...enAutomaticAssociationIntegrationTest.java | 593 ++-- .../integration/TokenBurnIntegrationTest.java | 279 +- .../TokenCreateIntegrationTest.java | 435 ++- .../TokenDeleteIntegrationTest.java | 119 +- .../TokenDissociateIntegrationTest.java | 182 +- ...TokenFeeScheduleUpdateIntegrationTest.java | 182 +- .../TokenFreezeIntegrationTest.java | 177 +- .../TokenGrantKycIntegrationTest.java | 177 +- .../integration/TokenInfoIntegrationTest.java | 200 +- ...TokenManualAssociationIntegrationTest.java | 210 +- .../integration/TokenMintIntegrationTest.java | 196 +- .../TokenNftInfoIntegrationTest.java | 246 +- .../TokenNftTransferIntegrationTest.java | 161 +- .../TokenPauseIntegrationTest.java | 81 +- .../TokenRejectFlowIntegrationTest.java | 264 +- .../TokenRejectIntegrationTest.java | 1153 ++++--- .../TokenRevokeKycIntegrationTest.java | 177 +- .../TokenTransferIntegrationTest.java | 194 +- .../TokenUnfreezeIntegrationTest.java | 177 +- .../TokenUnpauseIntegrationTest.java | 107 +- .../TokenUpdateIntegrationTest.java | 2988 +++++++++-------- .../TokenUpdateNftsIntegrationTest.java | 281 +- .../integration/TokenWipeIntegrationTest.java | 362 +- .../TopicCreateIntegrationTest.java | 44 +- .../TopicDeleteIntegrationTest.java | 58 +- .../integration/TopicInfoIntegrationTest.java | 119 +- .../TopicMessageIntegrationTest.java | 107 +- .../TopicMessageSubmitIntegrationTest.java | 94 +- .../TopicUpdateIntegrationTest.java | 56 +- .../TransactionIntegrationTest.java | 279 +- .../integration/TransactionResponseTest.java | 30 +- sdk/src/testIntegration/java/module-info.java | 2 +- settings.gradle.kts | 4 +- tck/build.gradle.kts | 7 +- .../main/java/com/hiero/tck/TckServer.java | 20 +- .../tck/annotation/JSONRPC2Controller.java | 20 +- .../hiero/tck/annotation/JSONRPC2Method.java | 20 +- .../hiero/tck/annotation/JSONRPC2Service.java | 20 +- .../java/com/hiero/tck/config/BeanConfig.java | 20 +- .../java/com/hiero/tck/config/WebConfig.java | 20 +- .../hiero/tck/controller/JRPCController.java | 20 +- .../hiero/tck/controller/JRPCInterceptor.java | 20 +- .../InvalidJSONRPC2ParamsException.java | 20 +- .../InvalidJSONRPC2RequestException.java | 20 +- .../tck/methods/AbstractJSONRPC2Service.java | 20 +- .../com/hiero/tck/methods/JSONRPC2Error.java | 20 +- .../com/hiero/tck/methods/JSONRPC2Param.java | 20 +- .../hiero/tck/methods/sdk/AccountService.java | 20 +- .../com/hiero/tck/methods/sdk/KeyService.java | 20 +- .../com/hiero/tck/methods/sdk/SdkService.java | 20 +- .../hiero/tck/methods/sdk/TokenService.java | 21 +- .../sdk/param/AccountCreateParams.java | 20 +- .../sdk/param/AccountDeleteParams.java | 1 + .../sdk/param/AccountUpdateParams.java | 1 + .../sdk/param/CommonTransactionParams.java | 20 +- .../tck/methods/sdk/param/CustomFee.java | 21 +- .../methods/sdk/param/GenerateKeyParams.java | 20 +- .../tck/methods/sdk/param/SetupParams.java | 20 +- .../methods/sdk/param/TokenCreateParams.java | 21 +- .../methods/sdk/param/TokenDeleteParams.java | 21 +- .../methods/sdk/param/TokenUpdateParams.java | 21 +- .../methods/sdk/response/AccountResponse.java | 20 +- .../sdk/response/GenerateKeyResponse.java | 20 +- .../methods/sdk/response/SetupResponse.java | 20 +- .../methods/sdk/response/TokenResponse.java | 21 +- .../tck/util/JSONRPC2ServiceScanner.java | 20 +- .../java/com/hiero/tck/util/KeyUtils.java | 20 +- .../tck/controller/JRPCControllerTest.java | 20 +- .../tck/controller/JRPCInterceptorTest.java | 20 +- .../hiero/tck/methods/sdk/KeyServiceTest.java | 20 +- .../hiero/tck/methods/sdk/SdkServiceTest.java | 20 +- .../sdk/param/AccountCreateParamsTest.java | 20 +- .../param/CommonTransactionParamsTest.java | 20 +- .../sdk/param/GenerateKeyParamsTest.java | 20 +- .../methods/sdk/param/SetupParamsTest.java | 20 +- .../sdk/response/SetupResponseTest.java | 20 +- 475 files changed, 17075 insertions(+), 25018 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d568be727..2a533307b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: run: ./gradlew assemble --scan - name: Code Quality Checks - run: ./gradlew qualityCheck :examples:qualityCheck --continue --scan + run: ./gradlew qualityCheck --continue --scan - name: Start Local Node run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.57.0 diff --git a/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java b/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java index 632ff68305..a94b750c8a 100644 --- a/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -41,8 +23,8 @@ protected AbstractTokenTransferTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AbstractTokenTransferTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); } @@ -55,7 +37,6 @@ protected AbstractTokenTransferTransaction() {} super(txBody); } - /** * Extract the list of token id decimals. * @@ -81,7 +62,8 @@ public Map> getTokenTransfers() { for (var transfer : tokenTransfers) { var current = transfers.get(transfer.tokenId) != null - ? transfers.get(transfer.tokenId) : new HashMap(); + ? transfers.get(transfer.tokenId) + : new HashMap(); current.put(transfer.accountId, transfer.amount); transfers.put(transfer.tokenId, current); } @@ -89,13 +71,13 @@ public Map> getTokenTransfers() { return transfers; } - private T doAddTokenTransfer(TokenId tokenId, AccountId accountId, long value, - boolean isApproved) { + private T doAddTokenTransfer(TokenId tokenId, AccountId accountId, long value, boolean isApproved) { requireNotFrozen(); for (var transfer : tokenTransfers) { - if (transfer.tokenId.equals(tokenId) && transfer.accountId.equals(accountId) - && transfer.isApproved == isApproved) { + if (transfer.tokenId.equals(tokenId) + && transfer.accountId.equals(accountId) + && transfer.isApproved == isApproved) { transfer.amount = transfer.amount + value; // noinspection unchecked return (T) this; @@ -132,12 +114,7 @@ public T addApprovedTokenTransfer(TokenId tokenId, AccountId accountId, long val } private T doAddTokenTransferWithDecimals( - TokenId tokenId, - AccountId accountId, - long value, - int decimals, - boolean isApproved - ) { + TokenId tokenId, AccountId accountId, long value, int decimals, boolean isApproved) { requireNotFrozen(); var found = false; @@ -146,7 +123,7 @@ private T doAddTokenTransferWithDecimals( if (transfer.tokenId.equals(tokenId)) { if (transfer.expectedDecimals != null && transfer.expectedDecimals != decimals) { throw new IllegalArgumentException( - "expected decimals for a token in a token transfer cannot be changed after being set"); + "expected decimals for a token in a token transfer cannot be changed after being set"); } transfer.expectedDecimals = decimals; @@ -155,7 +132,6 @@ private T doAddTokenTransferWithDecimals( transfer.amount = transfer.amount + value; found = true; } - } } @@ -178,12 +154,7 @@ private T doAddTokenTransferWithDecimals( * @param decimals the decimals * @return the updated transaction */ - public T addTokenTransferWithDecimals( - TokenId tokenId, - AccountId accountId, - long value, - int decimals - ) { + public T addTokenTransferWithDecimals(TokenId tokenId, AccountId accountId, long value, int decimals) { return doAddTokenTransferWithDecimals(tokenId, accountId, value, decimals, false); } @@ -196,12 +167,7 @@ public T addTokenTransferWithDecimals( * @param decimals the decimals * @return the updated transaction */ - public T addApprovedTokenTransferWithDecimals( - TokenId tokenId, - AccountId accountId, - long value, - int decimals - ) { + public T addApprovedTokenTransferWithDecimals(TokenId tokenId, AccountId accountId, long value, int decimals) { return doAddTokenTransferWithDecimals(tokenId, accountId, value, decimals, true); } @@ -238,7 +204,8 @@ public Map> getTokenNftTransfers() { for (var transfer : nftTransfers) { var current = transfers.get(transfer.tokenId) != null - ? transfers.get(transfer.tokenId) : new ArrayList(); + ? transfers.get(transfer.tokenId) + : new ArrayList(); current.add(transfer); transfers.put(transfer.tokenId, current); } @@ -246,8 +213,7 @@ public Map> getTokenNftTransfers() { return transfers; } - private T doAddNftTransfer(NftId nftId, AccountId sender, AccountId receiver, - boolean isApproved) { + private T doAddNftTransfer(NftId nftId, AccountId sender, AccountId receiver, boolean isApproved) { requireNotFrozen(); nftTransfers.add(new TokenNftTransfer(nftId.tokenId, sender, receiver, nftId.serial, isApproved)); return (T) this; @@ -302,10 +268,13 @@ public T setNftTransferApproval(NftId nftId, boolean isApproved) { protected ArrayList sortTransfersAndBuild() { var transferLists = new ArrayList(); - this.tokenTransfers.sort(Comparator.comparing((TokenTransfer a) -> a.tokenId).thenComparing(a -> a.accountId) - .thenComparing(a -> a.isApproved)); - this.nftTransfers.sort(Comparator.comparing((TokenNftTransfer a) -> a.tokenId).thenComparing(a -> a.sender) - .thenComparing(a -> a.receiver).thenComparing(a -> a.serial)); + this.tokenTransfers.sort(Comparator.comparing((TokenTransfer a) -> a.tokenId) + .thenComparing(a -> a.accountId) + .thenComparing(a -> a.isApproved)); + this.nftTransfers.sort(Comparator.comparing((TokenNftTransfer a) -> a.tokenId) + .thenComparing(a -> a.sender) + .thenComparing(a -> a.receiver) + .thenComparing(a -> a.serial)); var i = 0; var j = 0; @@ -331,15 +300,17 @@ protected ArrayList sortTransfersAndBuild() { var result = iTokenId.compareTo(jTokenId); if (result == 0) { - transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId, - this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), - this.nftTransfers.get(j++))); + transferLists.add(new com.hiero.sdk.TokenTransferList( + iTokenId, + this.tokenTransfers.get(i).expectedDecimals, + this.tokenTransfers.get(i++), + this.nftTransfers.get(j++))); } else if (result < 0) { - transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId, - this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); + transferLists.add(new com.hiero.sdk.TokenTransferList( + iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); } else { - transferLists.add(new com.hiero.sdk.TokenTransferList(jTokenId, null, null, - this.nftTransfers.get(j++))); + transferLists.add( + new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); } } else if (i < this.tokenTransfers.size()) { var iTokenId = this.tokenTransfers.get(i).tokenId; @@ -351,8 +322,8 @@ protected ArrayList sortTransfersAndBuild() { continue; } - transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId, - this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); + transferLists.add(new com.hiero.sdk.TokenTransferList( + iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); } else { var jTokenId = this.nftTransfers.get(j).tokenId; var last = !transferLists.isEmpty() ? transferLists.get(transferLists.size() - 1) : null; @@ -364,7 +335,7 @@ protected ArrayList sortTransfersAndBuild() { } transferLists.add( - new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); + new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); } } return transferLists; diff --git a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java index 9453537251..7300b24611 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java @@ -1,33 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoServiceGrpc; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -35,15 +13,16 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Nonnegative; +import javax.annotation.Nullable; /** * @deprecated with no replacement */ - @Deprecated public class AccountAllowanceAdjustTransaction extends Transaction { private final List hbarAllowances = new ArrayList<>(); - private final List tokenAllowances = new ArrayList<>(); + private final List tokenAllowances = new ArrayList<>(); private final List nftAllowances = new ArrayList<>(); // key is "{ownerId}:{spenderId}". OwnerId may be "FEE_PAYER" private final Map> nftMap = new HashMap<>(); @@ -51,12 +30,11 @@ public class AccountAllowanceAdjustTransaction extends Transaction> txs - ) throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -71,10 +49,7 @@ private void initFromTransactionBody() { } private AccountAllowanceAdjustTransaction adjustHbarAllowance( - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - Hbar amount - ) { + @Nullable AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) { requireNotFrozen(); hbarAllowances.add(new HbarAllowance(ownerAccountId, Objects.requireNonNull(spenderAccountId), amount)); return this; @@ -102,10 +77,7 @@ public AccountAllowanceAdjustTransaction addHbarAllowance(AccountId spenderAccou * @return {@code this} */ public AccountAllowanceAdjustTransaction grantHbarAllowance( - AccountId ownerAccountId, - AccountId spenderAccountId, - Hbar amount - ) { + AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) { Objects.requireNonNull(amount); if (amount.compareTo(Hbar.ZERO) < 0) { throw new IllegalArgumentException("amount passed to grantHbarAllowance must be positive"); @@ -122,10 +94,7 @@ public AccountAllowanceAdjustTransaction grantHbarAllowance( * @return {@code this} */ public AccountAllowanceAdjustTransaction revokeHbarAllowance( - AccountId ownerAccountId, - AccountId spenderAccountId, - Hbar amount - ) { + AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) { Objects.requireNonNull(amount); if (amount.compareTo(Hbar.ZERO) < 0) { throw new IllegalArgumentException("amount passed to revokeHbarAllowance must be positive"); @@ -143,18 +112,10 @@ public List getHbarAllowances() { } private AccountAllowanceAdjustTransaction adjustTokenAllowance( - TokenId tokenId, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - long amount - ) { + TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId, long amount) { requireNotFrozen(); tokenAllowances.add(new TokenAllowance( - Objects.requireNonNull(tokenId), - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - amount - )); + Objects.requireNonNull(tokenId), ownerAccountId, Objects.requireNonNull(spenderAccountId), amount)); return this; } @@ -168,7 +129,8 @@ private AccountAllowanceAdjustTransaction adjustTokenAllowance( * @return an account allowance adjust transaction */ @Deprecated - public AccountAllowanceAdjustTransaction addTokenAllowance(TokenId tokenId, AccountId spenderAccountId, long amount) { + public AccountAllowanceAdjustTransaction addTokenAllowance( + TokenId tokenId, AccountId spenderAccountId, long amount) { return adjustTokenAllowance(tokenId, null, spenderAccountId, amount); } @@ -182,11 +144,7 @@ public AccountAllowanceAdjustTransaction addTokenAllowance(TokenId tokenId, Acco * @return {@code this} */ public AccountAllowanceAdjustTransaction grantTokenAllowance( - TokenId tokenId, - AccountId ownerAccountId, - AccountId spenderAccountId, - @Nonnegative long amount - ) { + TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId, @Nonnegative long amount) { return adjustTokenAllowance(tokenId, Objects.requireNonNull(ownerAccountId), spenderAccountId, amount); } @@ -200,11 +158,7 @@ public AccountAllowanceAdjustTransaction grantTokenAllowance( * @return {@code this} */ public AccountAllowanceAdjustTransaction revokeTokenAllowance( - TokenId tokenId, - AccountId ownerAccountId, - AccountId spenderAccountId, - @Nonnegative long amount - ) { + TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId, @Nonnegative long amount) { return adjustTokenAllowance(tokenId, Objects.requireNonNull(ownerAccountId), spenderAccountId, -amount); } @@ -238,43 +192,35 @@ private List getNftSerials(@Nullable AccountId ownerAccountId, AccountId s } private List newNftSerials( - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - TokenId tokenId, - Map innerMap - ) { + @Nullable AccountId ownerAccountId, + AccountId spenderAccountId, + TokenId tokenId, + Map innerMap) { innerMap.put(tokenId, nftAllowances.size()); - TokenNftAllowance newAllowance = new TokenNftAllowance(tokenId, ownerAccountId, spenderAccountId, null, new ArrayList<>(), null); + TokenNftAllowance newAllowance = + new TokenNftAllowance(tokenId, ownerAccountId, spenderAccountId, null, new ArrayList<>(), null); nftAllowances.add(newAllowance); return newAllowance.serialNumbers; } private AccountAllowanceAdjustTransaction adjustNftAllowance( - TokenId tokenId, - long serial, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId - ) { + TokenId tokenId, long serial, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) { requireNotFrozen(); - getNftSerials(ownerAccountId, Objects.requireNonNull(spenderAccountId), tokenId).add(serial); + getNftSerials(ownerAccountId, Objects.requireNonNull(spenderAccountId), tokenId) + .add(serial); return this; } private AccountAllowanceAdjustTransaction adjustNftAllowanceAllSerials( - TokenId tokenId, - boolean allSerials, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId - ) { + TokenId tokenId, boolean allSerials, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) { requireNotFrozen(); nftAllowances.add(new TokenNftAllowance( - Objects.requireNonNull(tokenId), - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - null, - Collections.emptyList(), - allSerials - )); + Objects.requireNonNull(tokenId), + ownerAccountId, + Objects.requireNonNull(spenderAccountId), + null, + Collections.emptyList(), + allSerials)); return this; } @@ -313,10 +259,7 @@ public AccountAllowanceAdjustTransaction addAllTokenNftAllowance(TokenId tokenId * @return {@code this} */ public AccountAllowanceAdjustTransaction grantTokenNftAllowance( - NftId nftId, - AccountId ownerAccountId, - AccountId spenderAccountId - ) { + NftId nftId, AccountId ownerAccountId, AccountId spenderAccountId) { Objects.requireNonNull(nftId); Objects.requireNonNull(ownerAccountId); return adjustNftAllowance(nftId.tokenId, nftId.serial, ownerAccountId, spenderAccountId); @@ -331,10 +274,7 @@ public AccountAllowanceAdjustTransaction grantTokenNftAllowance( * @return an account allowance adjust transaction */ public AccountAllowanceAdjustTransaction grantTokenNftAllowanceAllSerials( - TokenId tokenId, - AccountId ownerAccountId, - AccountId spenderAccountId - ) { + TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId) { Objects.requireNonNull(ownerAccountId); return adjustNftAllowanceAllSerials(tokenId, true, ownerAccountId, spenderAccountId); } @@ -348,10 +288,7 @@ public AccountAllowanceAdjustTransaction grantTokenNftAllowanceAllSerials( */ @Deprecated public AccountAllowanceAdjustTransaction revokeTokenNftAllowance( - NftId nftId, - AccountId ownerAccountId, - AccountId spenderAccountId - ) { + NftId nftId, AccountId ownerAccountId, AccountId spenderAccountId) { Objects.requireNonNull(nftId); Objects.requireNonNull(ownerAccountId); return adjustNftAllowance(nftId.tokenId, -nftId.serial, ownerAccountId, spenderAccountId); @@ -366,10 +303,7 @@ public AccountAllowanceAdjustTransaction revokeTokenNftAllowance( * @return an account allowance adjust transaction */ public AccountAllowanceAdjustTransaction revokeTokenNftAllowanceAllSerials( - TokenId tokenId, - AccountId ownerAccountId, - AccountId spenderAccountId - ) { + TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId) { Objects.requireNonNull(ownerAccountId); return adjustNftAllowanceAllSerials(tokenId, false, ownerAccountId, spenderAccountId); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java index 6238fb3233..c77117f1d9 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,8 +8,6 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -35,13 +15,14 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Nullable; /** * This transaction type is for approving account allowance. */ public class AccountAllowanceApproveTransaction extends Transaction { private final List hbarAllowances = new ArrayList<>(); - private final List tokenAllowances = new ArrayList<>(); + private final List tokenAllowances = new ArrayList<>(); private final List nftAllowances = new ArrayList<>(); // key is "{ownerId}:{spenderId}". OwnerId may be "FEE_PAYER" // > @@ -50,8 +31,7 @@ public class AccountAllowanceApproveTransaction extends Transaction> txs - ) throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -84,15 +64,18 @@ private void initFromTransactionBody() { tokenAllowances.add(TokenAllowance.fromProtobuf(allowanceProto)); } for (var allowanceProto : body.getNftAllowancesList()) { - if (allowanceProto.hasApprovedForAll() && allowanceProto.getApprovedForAll().getValue()) { + if (allowanceProto.hasApprovedForAll() + && allowanceProto.getApprovedForAll().getValue()) { nftAllowances.add(TokenNftAllowance.fromProtobuf(allowanceProto)); } else { getNftSerials( - allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, - AccountId.fromProtobuf(allowanceProto.getSpender()), - allowanceProto.hasDelegatingSpender() ? AccountId.fromProtobuf(allowanceProto.getDelegatingSpender()) : null, - TokenId.fromProtobuf(allowanceProto.getTokenId()) - ).addAll(allowanceProto.getSerialNumbersList()); + allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, + AccountId.fromProtobuf(allowanceProto.getSpender()), + allowanceProto.hasDelegatingSpender() + ? AccountId.fromProtobuf(allowanceProto.getDelegatingSpender()) + : null, + TokenId.fromProtobuf(allowanceProto.getTokenId())) + .addAll(allowanceProto.getSerialNumbersList()); } } } @@ -118,10 +101,7 @@ public AccountAllowanceApproveTransaction addHbarAllowance(AccountId spenderAcco * @return {@code this} */ public AccountAllowanceApproveTransaction approveHbarAllowance( - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - Hbar amount - ) { + @Nullable AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) { requireNotFrozen(); Objects.requireNonNull(amount); if (amount.compareTo(Hbar.ZERO) < 0) { @@ -160,10 +140,7 @@ public List getHbarApprovals() { */ @Deprecated public AccountAllowanceApproveTransaction addTokenAllowance( - TokenId tokenId, - AccountId spenderAccountId, - long amount - ) { + TokenId tokenId, AccountId spenderAccountId, long amount) { return approveTokenAllowance(tokenId, null, spenderAccountId, amount); } @@ -177,21 +154,13 @@ public AccountAllowanceApproveTransaction addTokenAllowance( * @return {@code this} */ public AccountAllowanceApproveTransaction approveTokenAllowance( - TokenId tokenId, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - long amount - ) { + TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId, long amount) { requireNotFrozen(); if (amount < 0) { throw new IllegalArgumentException("amount given to approveTokenAllowance must be positive"); } tokenAllowances.add(new TokenAllowance( - Objects.requireNonNull(tokenId), - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - amount - )); + Objects.requireNonNull(tokenId), ownerAccountId, Objects.requireNonNull(spenderAccountId), amount)); return this; } @@ -234,7 +203,11 @@ private static String ownerToString(@Nullable AccountId ownerAccountId) { * @param tokenId the token's id * @return list of NFT serial numbers */ - private List getNftSerials(@Nullable AccountId ownerAccountId, AccountId spenderAccountId, @Nullable AccountId delegatingSpender, TokenId tokenId) { + private List getNftSerials( + @Nullable AccountId ownerAccountId, + AccountId spenderAccountId, + @Nullable AccountId delegatingSpender, + TokenId tokenId) { var key = ownerToString(ownerAccountId) + ":" + spenderAccountId; if (nftMap.containsKey(key)) { var innerMap = nftMap.get(key); @@ -261,21 +234,14 @@ private List getNftSerials(@Nullable AccountId ownerAccountId, AccountId s * @return list of NFT serial numbers */ private List newNftSerials( - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - @Nullable AccountId delegatingSpender, - TokenId tokenId, - Map innerMap - ) { + @Nullable AccountId ownerAccountId, + AccountId spenderAccountId, + @Nullable AccountId delegatingSpender, + TokenId tokenId, + Map innerMap) { innerMap.put(tokenId, nftAllowances.size()); TokenNftAllowance newAllowance = new TokenNftAllowance( - tokenId, - ownerAccountId, - spenderAccountId, - delegatingSpender, - new ArrayList<>(), - null - ); + tokenId, ownerAccountId, spenderAccountId, delegatingSpender, new ArrayList<>(), null); nftAllowances.add(newAllowance); return newAllowance.serialNumbers; } @@ -304,14 +270,7 @@ public AccountAllowanceApproveTransaction addTokenNftAllowance(NftId nftId, Acco @Deprecated public AccountAllowanceApproveTransaction addAllTokenNftAllowance(TokenId tokenId, AccountId spenderAccountId) { requireNotFrozen(); - nftAllowances.add(new TokenNftAllowance( - tokenId, - null, - spenderAccountId, - null, - Collections.emptyList(), - true - )); + nftAllowances.add(new TokenNftAllowance(tokenId, null, spenderAccountId, null, Collections.emptyList(), true)); return this; } @@ -325,19 +284,14 @@ public AccountAllowanceApproveTransaction addAllTokenNftAllowance(TokenId tokenI * @return {@code this} */ public AccountAllowanceApproveTransaction approveTokenNftAllowance( - NftId nftId, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId, - @Nullable AccountId delegatingSpender - ) { + NftId nftId, + @Nullable AccountId ownerAccountId, + AccountId spenderAccountId, + @Nullable AccountId delegatingSpender) { requireNotFrozen(); Objects.requireNonNull(nftId); - getNftSerials( - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - delegatingSpender, - nftId.tokenId - ).add(nftId.serial); + getNftSerials(ownerAccountId, Objects.requireNonNull(spenderAccountId), delegatingSpender, nftId.tokenId) + .add(nftId.serial); return this; } @@ -350,18 +304,11 @@ public AccountAllowanceApproveTransaction approveTokenNftAllowance( * @return {@code this} */ public AccountAllowanceApproveTransaction approveTokenNftAllowance( - NftId nftId, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId - ) { + NftId nftId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) { requireNotFrozen(); Objects.requireNonNull(nftId); - getNftSerials( - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - null, - nftId.tokenId - ).add(nftId.serial); + getNftSerials(ownerAccountId, Objects.requireNonNull(spenderAccountId), null, nftId.tokenId) + .add(nftId.serial); return this; } @@ -374,19 +321,15 @@ public AccountAllowanceApproveTransaction approveTokenNftAllowance( * @return {@code this} */ public AccountAllowanceApproveTransaction approveTokenNftAllowanceAllSerials( - TokenId tokenId, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId - ) { + TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) { requireNotFrozen(); nftAllowances.add(new TokenNftAllowance( - Objects.requireNonNull(tokenId), - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - null, - Collections.emptyList(), - true - )); + Objects.requireNonNull(tokenId), + ownerAccountId, + Objects.requireNonNull(spenderAccountId), + null, + Collections.emptyList(), + true)); return this; } @@ -399,19 +342,15 @@ public AccountAllowanceApproveTransaction approveTokenNftAllowanceAllSerials( * @return {@code this} */ public AccountAllowanceApproveTransaction deleteTokenNftAllowanceAllSerials( - TokenId tokenId, - @Nullable AccountId ownerAccountId, - AccountId spenderAccountId - ) { + TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) { requireNotFrozen(); nftAllowances.add(new TokenNftAllowance( - Objects.requireNonNull(tokenId), - ownerAccountId, - Objects.requireNonNull(spenderAccountId), - null, - Collections.emptyList(), - false - )); + Objects.requireNonNull(tokenId), + ownerAccountId, + Objects.requireNonNull(spenderAccountId), + null, + Collections.emptyList(), + false)); return this; } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java index 00d3b579c9..99132b7371 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -27,14 +9,13 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Nullable; /** * This transaction type is for deleting an account allowance. @@ -49,8 +30,7 @@ public class AccountAllowanceDeleteTransaction extends com.hiero.sdk.Transaction /** * Constructor. */ - public AccountAllowanceDeleteTransaction() { - } + public AccountAllowanceDeleteTransaction() {} /** * Constructor. @@ -59,8 +39,8 @@ public AccountAllowanceDeleteTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AccountAllowanceDeleteTransaction( - LinkedHashMap> txs - ) throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -79,9 +59,9 @@ private void initFromTransactionBody() { var body = sourceTransactionBody.getCryptoDeleteAllowance(); for (var allowanceProto : body.getNftAllowancesList()) { getNftSerials( - AccountId.fromProtobuf(allowanceProto.getOwner()), - TokenId.fromProtobuf(allowanceProto.getTokenId()) - ).addAll(allowanceProto.getSerialNumbersList()); + AccountId.fromProtobuf(allowanceProto.getOwner()), + TokenId.fromProtobuf(allowanceProto.getTokenId())) + .addAll(allowanceProto.getSerialNumbersList()); } } @@ -118,12 +98,8 @@ public List getHbarAllowanceDeletions() { @Deprecated public AccountAllowanceDeleteTransaction deleteAllTokenAllowances(TokenId tokenId, AccountId ownerAccountId) { requireNotFrozen(); - tokenAllowances.add(new TokenAllowance( - Objects.requireNonNull(tokenId), - Objects.requireNonNull(ownerAccountId), - null, - 0 - )); + tokenAllowances.add( + new TokenAllowance(Objects.requireNonNull(tokenId), Objects.requireNonNull(ownerAccountId), null, 0)); return this; } @@ -196,19 +172,10 @@ private List getNftSerials(@Nullable AccountId ownerAccountId, TokenId tok * @return list of nft serial numbers */ private List newNftSerials( - @Nullable AccountId ownerAccountId, - TokenId tokenId, - Map innerMap - ) { + @Nullable AccountId ownerAccountId, TokenId tokenId, Map innerMap) { innerMap.put(tokenId, nftAllowances.size()); - TokenNftAllowance newAllowance = new TokenNftAllowance( - tokenId, - ownerAccountId, - null, - null, - new ArrayList<>(), - null - ); + TokenNftAllowance newAllowance = + new TokenNftAllowance(tokenId, ownerAccountId, null, null, new ArrayList<>(), null); nftAllowances.add(newAllowance); return newAllowance.serialNumbers; } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountBalance.java b/sdk/src/main/java/com/hiero/sdk/AccountBalance.java index af8d7befc6..f66d411270 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountBalance.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountBalance.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -24,11 +6,10 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse; import com.hiero.sdk.proto.TokenBalance; - -import javax.annotation.Nonnegative; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import javax.annotation.Nonnegative; /** * This class represents the account balance object @@ -69,8 +50,12 @@ static AccountBalance fromProtobuf(CryptoGetAccountBalanceResponse protobuf) { Map map = new HashMap<>(); Map decimalMap = new HashMap<>(); for (int i = 0; i < protobuf.getTokenBalancesCount(); i++) { - map.put(TokenId.fromProtobuf(balanceList.get(i).getTokenId()), balanceList.get(i).getBalance()); - decimalMap.put(TokenId.fromProtobuf(balanceList.get(i).getTokenId()), balanceList.get(i).getDecimals()); + map.put( + TokenId.fromProtobuf(balanceList.get(i).getTokenId()), + balanceList.get(i).getBalance()); + decimalMap.put( + TokenId.fromProtobuf(balanceList.get(i).getTokenId()), + balanceList.get(i).getDecimals()); } return new AccountBalance(Hbar.fromTinybars(protobuf.getBalance()), map, decimalMap); @@ -93,15 +78,13 @@ public static AccountBalance fromBytes(byte[] data) throws InvalidProtocolBuffer * @return the protobuf object */ CryptoGetAccountBalanceResponse toProtobuf() { - var protobuf = CryptoGetAccountBalanceResponse.newBuilder() - .setBalance(hbars.toTinybars()); + var protobuf = CryptoGetAccountBalanceResponse.newBuilder().setBalance(hbars.toTinybars()); for (var entry : tokens.entrySet()) { protobuf.addTokenBalances(TokenBalance.newBuilder() - .setTokenId(entry.getKey().toProtobuf()) - .setBalance(entry.getValue()) - .setDecimals(Objects.requireNonNull(tokenDecimals.get(entry.getKey()))) - ); + .setTokenId(entry.getKey().toProtobuf()) + .setBalance(entry.getValue()) + .setDecimals(Objects.requireNonNull(tokenDecimals.get(entry.getKey())))); } return protobuf.build(); @@ -119,8 +102,8 @@ public ByteString toBytes() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("hbars", hbars) - .add("tokens", tokens) - .toString(); + .add("hbars", hbars) + .add("tokens", tokens) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java index 4fa1f4faae..e35e1245a5 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.CryptoGetAccountBalanceQuery; @@ -25,9 +7,8 @@ import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * Get the balance of a Hedera™ crypto-currency account. This returns only the balance, so it is a @@ -38,14 +19,14 @@ public final class AccountBalanceQuery extends Query { @Nullable private AccountId accountId = null; + @Nullable private ContractId contractId = null; /** * Constructor. */ - public AccountBalanceQuery() { - } + public AccountBalanceQuery() {} /** * Return the account's id. diff --git a/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java index a2c07130f8..f745452d3d 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -28,10 +10,9 @@ import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Create a new Hedera™ account. @@ -39,8 +20,10 @@ public final class AccountCreateTransaction extends Transaction { @Nullable private AccountId proxyAccountId = null; + @Nullable private Key key = null; + private String accountMemo = ""; private Hbar initialBalance = new Hbar(0); private boolean receiverSigRequired = false; @@ -71,7 +54,9 @@ public AccountCreateTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - AccountCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + AccountCreateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -392,12 +377,12 @@ public AccountCreateTransaction setAlias(String aliasEvmAddress) { */ CryptoCreateTransactionBody.Builder build() { var builder = CryptoCreateTransactionBody.newBuilder() - .setInitialBalance(initialBalance.toTinybars()) - .setReceiverSigRequired(receiverSigRequired) - .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) - .setMemo(accountMemo) - .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) - .setDeclineReward(declineStakingReward); + .setInitialBalance(initialBalance.toTinybars()) + .setReceiverSigRequired(receiverSigRequired) + .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) + .setMemo(accountMemo) + .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) + .setDeclineReward(declineStakingReward); if (proxyAccountId != null) { builder.setProxyAccountID(proxyAccountId.toProtobuf()); diff --git a/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java index 5c4d69ca20..bea922e1a0 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Marks an account as deleted, moving all its current hbars to another account. @@ -41,14 +22,14 @@ public final class AccountDeleteTransaction extends Transaction { @Nullable private AccountId accountId = null; + @Nullable private AccountId transferAccountId = null; /** * Constructor. */ - public AccountDeleteTransaction() { - } + public AccountDeleteTransaction() {} /** * Constructor. @@ -56,7 +37,9 @@ public AccountDeleteTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - AccountDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + AccountDeleteTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountId.java b/sdk/src/main/java/com/hiero/sdk/AccountId.java index 2b2dbb7df4..0659bfec7f 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountId.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountId.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -35,7 +17,8 @@ * The ID for a cryptocurrency account on Hedera. */ public final class AccountId implements Comparable { - private static final Pattern ALIAS_ID_REGEX = Pattern.compile("(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.((?:[0-9a-fA-F][0-9a-fA-F])+)$"); + private static final Pattern ALIAS_ID_REGEX = + Pattern.compile("(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.((?:[0-9a-fA-F][0-9a-fA-F])+)$"); /** * The shard number @@ -117,13 +100,12 @@ public AccountId(@Nonnegative long shard, @Nonnegative long realm, @Nonnegative */ @SuppressWarnings("InconsistentOverloads") AccountId( - @Nonnegative long shard, - @Nonnegative long realm, - @Nonnegative long num, - @Nullable String checksum, - @Nullable PublicKey aliasKey, - @Nullable EvmAddress evmAddress - ) { + @Nonnegative long shard, + @Nonnegative long realm, + @Nonnegative long num, + @Nullable String checksum, + @Nullable PublicKey aliasKey, + @Nullable EvmAddress evmAddress) { this.shard = shard; this.realm = realm; this.num = num; @@ -140,8 +122,7 @@ public AccountId(@Nonnegative long shard, @Nonnegative long realm, @Nonnegative * @throws IllegalArgumentException when the account id and checksum are invalid */ public static AccountId fromString(String id) { - if ((id.startsWith("0x") && id.length() == 42) || id.length() == 40) - return fromEvmAddress(id); + if ((id.startsWith("0x") && id.length() == 42) || id.length() == 40) return fromEvmAddress(id); try { return EntityIdHelper.fromString(id, AccountId::new); @@ -149,19 +130,18 @@ public static AccountId fromString(String id) { var match = ALIAS_ID_REGEX.matcher(id); if (!match.find()) { throw new IllegalArgumentException( - "Invalid Account ID \"" + id + "\": format should look like 0.0.123 or 0.0.123-vfmkw or 0.0.1337BEEF (where 1337BEEF is a hex-encoded, DER-format public key)" - ); + "Invalid Account ID \"" + id + + "\": format should look like 0.0.123 or 0.0.123-vfmkw or 0.0.1337BEEF (where 1337BEEF is a hex-encoded, DER-format public key)"); } else { byte[] aliasBytes = Hex.decode(match.group(3)); boolean isEvmAddress = aliasBytes.length == 20; return new AccountId( - Long.parseLong(match.group(1)), - Long.parseLong(match.group(2)), - 0, - null, - isEvmAddress ? null : PublicKey.fromBytesDER(aliasBytes), - isEvmAddress ? EvmAddress.fromBytes(aliasBytes) : null - ); + Long.parseLong(match.group(1)), + Long.parseLong(match.group(2)), + 0, + null, + isEvmAddress ? null : PublicKey.fromBytesDER(aliasBytes), + isEvmAddress ? EvmAddress.fromBytes(aliasBytes) : null); } } } @@ -207,14 +187,7 @@ public static AccountId fromEvmAddress(EvmAddress evmAddress) { * @return the account id object */ public static AccountId fromEvmAddress(EvmAddress evmAddress, @Nonnegative long shard, @Nonnegative long realm) { - return new AccountId( - shard, - realm, - 0, - null, - null, - evmAddress - ); + return new AccountId(shard, realm, 0, null, null, evmAddress); } /** @@ -245,18 +218,17 @@ static AccountId fromProtobuf(AccountID accountId) { if (accountId.getAlias().size() == 20) { evmAddress = EvmAddress.fromAliasBytes(accountId.getAlias()); } else { - aliasKey = PublicKey.fromAliasBytes(accountId.getAlias()); + aliasKey = PublicKey.fromAliasBytes(accountId.getAlias()); } } Objects.requireNonNull(accountId); return new AccountId( - accountId.getShardNum(), - accountId.getRealmNum(), - accountId.getAccountNum(), - null, - aliasKey, - evmAddress - ); + accountId.getShardNum(), + accountId.getRealmNum(), + accountId.getAccountNum(), + null, + aliasKey, + evmAddress); } /** @@ -285,14 +257,12 @@ public String toSolidityAddress() { * @return the account id builder */ AccountID toProtobuf() { - var accountIdBuilder = AccountID.newBuilder() - .setShardNum(shard) - .setRealmNum(realm); + var accountIdBuilder = AccountID.newBuilder().setShardNum(shard).setRealmNum(realm); if (aliasKey != null) { accountIdBuilder.setAlias(aliasKey.toProtobufKey().toByteString()); } else if (evmAddress != null) { accountIdBuilder.setAlias(ByteString.copyFrom(evmAddress.toBytes())); - }else { + } else { accountIdBuilder.setAccountNum(num); } return accountIdBuilder.build(); @@ -324,14 +294,13 @@ public AccountId populateAccountNum(Client client) throws InterruptedException, @Deprecated public CompletableFuture populateAccountNumAsync(Client client) { return EntityIdHelper.getAccountNumFromMirrorNodeAsync(client, evmAddress.toString()) - .thenApply(accountNumFromMirrorNode -> - new AccountId( - this.shard, - this.realm, - accountNumFromMirrorNode, - this.checksum, - this.aliasKey, - this.evmAddress)); + .thenApply(accountNumFromMirrorNode -> new AccountId( + this.shard, + this.realm, + accountNumFromMirrorNode, + this.checksum, + this.aliasKey, + this.evmAddress)); } /** @@ -356,14 +325,8 @@ public AccountId populateAccountEvmAddress(Client client) throws ExecutionExcept @Deprecated public CompletableFuture populateAccountEvmAddressAsync(Client client) { return EntityIdHelper.getEvmAddressFromMirrorNodeAsync(client, num) - .thenApply(evmAddressFromMirrorNode -> - new AccountId( - this.shard, - this.realm, - this.num, - this.checksum, - this.aliasKey, - evmAddressFromMirrorNode)); + .thenApply(evmAddressFromMirrorNode -> new AccountId( + this.shard, this.realm, this.num, this.checksum, this.aliasKey, evmAddressFromMirrorNode)); } /** @@ -426,7 +389,8 @@ public String toString() { */ public String toStringWithChecksum(Client client) { if (aliasKey != null || evmAddress != null) { - throw new IllegalStateException("toStringWithChecksum cannot be applied to AccountId with aliasKey or evmAddress"); + throw new IllegalStateException( + "toStringWithChecksum cannot be applied to AccountId with aliasKey or evmAddress"); } else { return EntityIdHelper.toStringWithChecksum(shard, realm, num, client, checksum); } @@ -442,9 +406,7 @@ public int hashCode() { aliasBytes = evmAddress.toBytes(); } - return Objects.hash( - shard, realm, num, Arrays.hashCode(aliasBytes) - ); + return Objects.hash(shard, realm, num, Arrays.hashCode(aliasBytes)); } @Override @@ -464,9 +426,11 @@ public boolean equals(Object o) { if ((evmAddress == null) != (otherId.evmAddress == null)) { return false; } - return shard == otherId.shard && realm == otherId.realm && num == otherId.num && - (aliasKey == null || aliasKey.equals(otherId.aliasKey)) && - (evmAddress == null || evmAddress.equals(otherId.evmAddress)); + return shard == otherId.shard + && realm == otherId.realm + && num == otherId.num + && (aliasKey == null || aliasKey.equals(otherId.aliasKey)) + && (evmAddress == null || evmAddress.equals(otherId.evmAddress)); } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/AccountInfo.java b/sdk/src/main/java/com/hiero/sdk/AccountInfo.java index 9a083ad4d6..28a9fc0b2c 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountInfo.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static java.util.stream.Collectors.toList; @@ -196,28 +178,27 @@ public final class AccountInfo { * @param ledgerId the ledger id */ private AccountInfo( - AccountId accountId, - String contractAccountId, - boolean isDeleted, - @Nullable AccountId proxyAccountId, - long proxyReceived, - Key key, - long balance, - long sendRecordThreshold, - long receiveRecordThreshold, - boolean receiverSignatureRequired, - Instant expirationTime, - Duration autoRenewPeriod, - List liveHashes, - Map tokenRelationships, - String accountMemo, - long ownedNfts, - int maxAutomaticTokenAssociations, - @Nullable PublicKey aliasKey, - LedgerId ledgerId, - long ethereumNonce, - @Nullable StakingInfo stakingInfo - ) { + AccountId accountId, + String contractAccountId, + boolean isDeleted, + @Nullable AccountId proxyAccountId, + long proxyReceived, + Key key, + long balance, + long sendRecordThreshold, + long receiveRecordThreshold, + boolean receiverSignatureRequired, + Instant expirationTime, + Duration autoRenewPeriod, + List liveHashes, + Map tokenRelationships, + String accountMemo, + long ownedNfts, + int maxAutomaticTokenAssociations, + @Nullable PublicKey aliasKey, + LedgerId ledgerId, + long ethereumNonce, + @Nullable StakingInfo stakingInfo) { this.accountId = accountId; this.contractAccountId = contractAccountId; this.isDeleted = isDeleted; @@ -254,12 +235,12 @@ static AccountInfo fromProtobuf(CryptoGetInfoResponse.AccountInfo accountInfo) { var accountId = AccountId.fromProtobuf(accountInfo.getAccountID()); var proxyAccountId = accountInfo.getProxyAccountID().getAccountNum() > 0 - ? AccountId.fromProtobuf(accountInfo.getProxyAccountID()) - : null; + ? AccountId.fromProtobuf(accountInfo.getProxyAccountID()) + : null; var liveHashes = Arrays.stream(accountInfo.getLiveHashesList().toArray()) - .map((liveHash) -> LiveHash.fromProtobuf((com.hiero.sdk.proto.LiveHash) liveHash)) - .collect(toList()); + .map((liveHash) -> LiveHash.fromProtobuf((com.hiero.sdk.proto.LiveHash) liveHash)) + .collect(toList()); Map relationships = new HashMap<>(); @@ -268,32 +249,30 @@ static AccountInfo fromProtobuf(CryptoGetInfoResponse.AccountInfo accountInfo) { relationships.put(tokenId, TokenRelationship.fromProtobuf(relationship)); } - @Nullable - var aliasKey = PublicKey.fromAliasBytes(accountInfo.getAlias()); + @Nullable var aliasKey = PublicKey.fromAliasBytes(accountInfo.getAlias()); return new AccountInfo( - accountId, - accountInfo.getContractAccountID(), - accountInfo.getDeleted(), - proxyAccountId, - accountInfo.getProxyReceived(), - Key.fromProtobufKey(accountInfo.getKey()), - accountInfo.getBalance(), - accountInfo.getGenerateSendRecordThreshold(), - accountInfo.getGenerateReceiveRecordThreshold(), - accountInfo.getReceiverSigRequired(), - InstantConverter.fromProtobuf(accountInfo.getExpirationTime()), - DurationConverter.fromProtobuf(accountInfo.getAutoRenewPeriod()), - liveHashes, - relationships, - accountInfo.getMemo(), - accountInfo.getOwnedNfts(), - accountInfo.getMaxAutomaticTokenAssociations(), - aliasKey, - LedgerId.fromByteString(accountInfo.getLedgerId()), - accountInfo.getEthereumNonce(), - accountInfo.hasStakingInfo() ? StakingInfo.fromProtobuf(accountInfo.getStakingInfo()) : null - ); + accountId, + accountInfo.getContractAccountID(), + accountInfo.getDeleted(), + proxyAccountId, + accountInfo.getProxyReceived(), + Key.fromProtobufKey(accountInfo.getKey()), + accountInfo.getBalance(), + accountInfo.getGenerateSendRecordThreshold(), + accountInfo.getGenerateReceiveRecordThreshold(), + accountInfo.getReceiverSigRequired(), + InstantConverter.fromProtobuf(accountInfo.getExpirationTime()), + DurationConverter.fromProtobuf(accountInfo.getAutoRenewPeriod()), + liveHashes, + relationships, + accountInfo.getMemo(), + accountInfo.getOwnedNfts(), + accountInfo.getMaxAutomaticTokenAssociations(), + aliasKey, + LedgerId.fromByteString(accountInfo.getLedgerId()), + accountInfo.getEthereumNonce(), + accountInfo.hasStakingInfo() ? StakingInfo.fromProtobuf(accountInfo.getStakingInfo()) : null); } /** @@ -304,7 +283,8 @@ static AccountInfo fromProtobuf(CryptoGetInfoResponse.AccountInfo accountInfo) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static AccountInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(CryptoGetInfoResponse.AccountInfo.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + CryptoGetInfoResponse.AccountInfo.parseFrom(bytes).toBuilder().build()); } /** @@ -314,26 +294,26 @@ public static AccountInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferEx */ CryptoGetInfoResponse.AccountInfo toProtobuf() { var hashes = Arrays.stream(liveHashes.toArray()) - .map((liveHash) -> ((LiveHash) liveHash).toProtobuf()) - .collect(toList()); + .map((liveHash) -> ((LiveHash) liveHash).toProtobuf()) + .collect(toList()); var accountInfoBuilder = CryptoGetInfoResponse.AccountInfo.newBuilder() - .setAccountID(accountId.toProtobuf()) - .setDeleted(isDeleted) - .setProxyReceived(proxyReceived.toTinybars()) - .setKey(key.toProtobufKey()) - .setBalance(balance.toTinybars()) - .setGenerateSendRecordThreshold(sendRecordThreshold.toTinybars()) - .setGenerateReceiveRecordThreshold(receiveRecordThreshold.toTinybars()) - .setReceiverSigRequired(isReceiverSignatureRequired) - .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) - .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) - .addAllLiveHashes(hashes) - .setMemo(accountMemo) - .setOwnedNfts(ownedNfts) - .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) - .setLedgerId(ledgerId.toByteString()) - .setEthereumNonce(ethereumNonce); + .setAccountID(accountId.toProtobuf()) + .setDeleted(isDeleted) + .setProxyReceived(proxyReceived.toTinybars()) + .setKey(key.toProtobufKey()) + .setBalance(balance.toTinybars()) + .setGenerateSendRecordThreshold(sendRecordThreshold.toTinybars()) + .setGenerateReceiveRecordThreshold(receiveRecordThreshold.toTinybars()) + .setReceiverSigRequired(isReceiverSignatureRequired) + .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) + .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) + .addAllLiveHashes(hashes) + .setMemo(accountMemo) + .setOwnedNfts(ownedNfts) + .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) + .setLedgerId(ledgerId.toByteString()) + .setEthereumNonce(ethereumNonce); if (contractAccountId != null) { accountInfoBuilder.setContractAccountID(contractAccountId); @@ -357,28 +337,28 @@ CryptoGetInfoResponse.AccountInfo toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("accountId", accountId) - .add("contractAccountId", contractAccountId) - .add("deleted", isDeleted) - .add("proxyAccountId", proxyAccountId) - .add("proxyReceived", proxyReceived) - .add("key", key) - .add("balance", balance) - .add("sendRecordThreshold", sendRecordThreshold) - .add("receiveRecordThreshold", receiveRecordThreshold) - .add("receiverSignatureRequired", isReceiverSignatureRequired) - .add("expirationTime", expirationTime) - .add("autoRenewPeriod", autoRenewPeriod) - .add("liveHashes", liveHashes) - .add("tokenRelationships", tokenRelationships) - .add("accountMemo", accountMemo) - .add("ownedNfts", ownedNfts) - .add("maxAutomaticTokenAssociations", maxAutomaticTokenAssociations) - .add("aliasKey", aliasKey) - .add("ledgerId", ledgerId) - .add("ethereumNonce", ethereumNonce) - .add("stakingInfo", stakingInfo) - .toString(); + .add("accountId", accountId) + .add("contractAccountId", contractAccountId) + .add("deleted", isDeleted) + .add("proxyAccountId", proxyAccountId) + .add("proxyReceived", proxyReceived) + .add("key", key) + .add("balance", balance) + .add("sendRecordThreshold", sendRecordThreshold) + .add("receiveRecordThreshold", receiveRecordThreshold) + .add("receiverSignatureRequired", isReceiverSignatureRequired) + .add("expirationTime", expirationTime) + .add("autoRenewPeriod", autoRenewPeriod) + .add("liveHashes", liveHashes) + .add("tokenRelationships", tokenRelationships) + .add("accountMemo", accountMemo) + .add("ownedNfts", ownedNfts) + .add("maxAutomaticTokenAssociations", maxAutomaticTokenAssociations) + .add("aliasKey", aliasKey) + .add("ledgerId", ledgerId) + .add("ethereumNonce", ethereumNonce) + .add("stakingInfo", stakingInfo) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java b/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java index 5f6be2defd..f943a5c96b 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.concurrent.CompletableFuture; @@ -27,17 +9,19 @@ */ public class AccountInfoFlow { - private static PublicKey getAccountPublicKey( - Client client, - AccountId accountId - ) throws PrecheckStatusException, TimeoutException { - return requirePublicKey(accountId, new AccountInfoQuery().setAccountId(accountId).execute(client).key); + private static PublicKey getAccountPublicKey(Client client, AccountId accountId) + throws PrecheckStatusException, TimeoutException { + return requirePublicKey( + accountId, new AccountInfoQuery().setAccountId(accountId).execute(client).key); } private static CompletableFuture getAccountPublicKeyAsync(Client client, AccountId accountId) { - return new AccountInfoQuery().setAccountId(accountId).executeAsync(client).thenApply(accountInfo -> { - return requirePublicKey(accountId, accountInfo.key); - }); + return new AccountInfoQuery() + .setAccountId(accountId) + .executeAsync(client) + .thenApply(accountInfo -> { + return requirePublicKey(accountId, accountInfo.key); + }); } private static PublicKey requirePublicKey(AccountId accountId, Key key) { @@ -58,12 +42,8 @@ private static PublicKey requirePublicKey(AccountId accountId, Key key) { * @throws PrecheckStatusException when the precheck fails * @throws TimeoutException when the transaction times out */ - public static boolean verifySignature( - Client client, - AccountId accountId, - byte[] message, - byte[] signature - ) throws PrecheckStatusException, TimeoutException { + public static boolean verifySignature(Client client, AccountId accountId, byte[] message, byte[] signature) + throws PrecheckStatusException, TimeoutException { return getAccountPublicKey(client, accountId).verify(message, signature); } @@ -77,11 +57,8 @@ public static boolean verifySignature( * @throws PrecheckStatusException when the precheck fails * @throws TimeoutException when the transaction times out */ - public static boolean verifyTransactionSignature( - Client client, - AccountId accountId, - Transaction transaction - ) throws PrecheckStatusException, TimeoutException { + public static boolean verifyTransactionSignature(Client client, AccountId accountId, Transaction transaction) + throws PrecheckStatusException, TimeoutException { return getAccountPublicKey(client, accountId).verifyTransaction(transaction); } @@ -95,11 +72,7 @@ public static boolean verifyTransactionSignature( * @return is the signature valid */ public static CompletableFuture verifySignatureAsync( - Client client, - AccountId accountId, - byte[] message, - byte[] signature - ) { + Client client, AccountId accountId, byte[] message, byte[] signature) { return getAccountPublicKeyAsync(client, accountId).thenApply(pubKey -> pubKey.verify(message, signature)); } @@ -112,10 +85,7 @@ public static CompletableFuture verifySignatureAsync( * @return is the signature valid */ public static CompletableFuture verifyTransactionSignatureAsync( - Client client, - AccountId accountId, - Transaction transaction - ) { + Client client, AccountId accountId, Transaction transaction) { return getAccountPublicKeyAsync(client, accountId).thenApply(pubKey -> pubKey.verifyTransaction(transaction)); } } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java index db3f1992cc..dafff909de 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.CryptoGetInfoQuery; @@ -41,8 +23,7 @@ public final class AccountInfoQuery extends Query /** * Constructor. */ - public AccountInfoQuery() { - } + public AccountInfoQuery() {} /** * Extract the account id. diff --git a/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java index 8f987d9192..0c0a745981 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.CryptoGetAccountRecordsQuery; @@ -25,11 +7,10 @@ import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Get all the records for an account for any transfers into it and out of it, @@ -42,8 +23,7 @@ public final class AccountRecordsQuery extends Query, Ac /** * Constructor. */ - public AccountRecordsQuery() { - } + public AccountRecordsQuery() {} /** * Extract the account id. diff --git a/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java b/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java index 8c3eb66a37..2e5f6abedb 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.CryptoGetStakersQuery; @@ -25,11 +7,10 @@ import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Get all the accounts that are proxy staking to this account. @@ -44,8 +25,7 @@ public final class AccountStakersQuery extends Query, AccountS /** * Constructor. */ - public AccountStakersQuery() { - } + public AccountStakersQuery() {} /** * Extract the account id. diff --git a/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java index 4a91123fd6..f594a0c6f7 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.BoolValue; @@ -31,10 +13,9 @@ import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Change properties for the given account. @@ -55,20 +36,28 @@ public final class AccountUpdateTransaction extends Transaction { @Nullable private AccountId accountId = null; + @Nullable private AccountId proxyAccountId = null; + @Nullable private Key key = null; + @Nullable private Instant expirationTime = null; + @Nullable private Duration autoRenewPeriod = null; + @Nullable private Boolean receiverSigRequired = null; + @Nullable private String accountMemo = null; + @Nullable private Integer maxAutomaticTokenAssociations = null; + @Nullable private Key aliasKey; @@ -84,8 +73,7 @@ public final class AccountUpdateTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + AccountUpdateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -485,7 +475,8 @@ void initFromTransactionBody() { accountMemo = body.getMemo().getValue(); } if (body.hasMaxAutomaticTokenAssociations()) { - maxAutomaticTokenAssociations = body.getMaxAutomaticTokenAssociations().getValue(); + maxAutomaticTokenAssociations = + body.getMaxAutomaticTokenAssociations().getValue(); } if (body.hasDeclineReward()) { @@ -545,7 +536,8 @@ CryptoUpdateTransactionBody.Builder build() { } if (declineStakingReward != null) { - builder.setDeclineReward(BoolValue.newBuilder().setValue(declineStakingReward).build()); + builder.setDeclineReward( + BoolValue.newBuilder().setValue(declineStakingReward).build()); } return builder; diff --git a/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java b/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java index 6301e6c32e..35be25cd89 100644 --- a/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.mirror.NetworkServiceGrpc; @@ -46,26 +28,28 @@ public class AddressBookQuery { @Nullable private FileId fileId = null; + @Nullable private Integer limit = null; + private int maxAttempts = 10; private Duration maxBackoff = Duration.ofSeconds(8L); /** * Constructor. */ - public AddressBookQuery() { - } + public AddressBookQuery() {} private static boolean shouldRetry(Throwable throwable) { if (throwable instanceof StatusRuntimeException statusRuntimeException) { var code = statusRuntimeException.getStatus().getCode(); var description = statusRuntimeException.getStatus().getDescription(); - return (code == io.grpc.Status.Code.UNAVAILABLE) || - (code == io.grpc.Status.Code.RESOURCE_EXHAUSTED) || - (code == Status.Code.INTERNAL && description != null && Executable.RST_STREAM.matcher(description) - .matches()); + return (code == io.grpc.Status.Code.UNAVAILABLE) + || (code == io.grpc.Status.Code.RESOURCE_EXHAUSTED) + || (code == Status.Code.INTERNAL + && description != null + && Executable.RST_STREAM.matcher(description).matches()); } return false; @@ -169,10 +153,8 @@ public NodeAddressBook execute(Client client, Duration timeout) { var deadline = Deadline.after(timeout.toMillis(), TimeUnit.MILLISECONDS); for (int attempt = 1; true; attempt++) { try { - var addressProtoIter = ClientCalls.blockingServerStreamingCall( - buildCall(client, deadline), - buildQuery() - ); + var addressProtoIter = + ClientCalls.blockingServerStreamingCall(buildCall(client, deadline), buildQuery()); List addresses = new ArrayList<>(); while (addressProtoIter.hasNext()) { addresses.add(NodeAddress.fromProtobuf(addressProtoIter.next())); @@ -223,31 +205,29 @@ public CompletableFuture executeAsync(Client client, Duration t void executeAsync(Client client, Deadline deadline, CompletableFuture returnFuture, int attempt) { List addresses = new ArrayList<>(); ClientCalls.asyncServerStreamingCall( - buildCall(client, deadline), - buildQuery(), - new StreamObserver() { - @Override - public void onNext(com.hiero.sdk.proto.NodeAddress addressProto) { - addresses.add(NodeAddress.fromProtobuf(addressProto)); - } + buildCall(client, deadline), buildQuery(), new StreamObserver() { + @Override + public void onNext(com.hiero.sdk.proto.NodeAddress addressProto) { + addresses.add(NodeAddress.fromProtobuf(addressProto)); + } - @Override - public void onError(Throwable error) { - if (attempt >= maxAttempts || !shouldRetry(error)) { - LOGGER.error("Error attempting to get address book at FileId {}", fileId, error); - returnFuture.completeExceptionally(error); - return; + @Override + public void onError(Throwable error) { + if (attempt >= maxAttempts || !shouldRetry(error)) { + LOGGER.error("Error attempting to get address book at FileId {}", fileId, error); + returnFuture.completeExceptionally(error); + return; + } + warnAndDelay(attempt, error); + addresses.clear(); + executeAsync(client, deadline, returnFuture, attempt + 1); } - warnAndDelay(attempt, error); - addresses.clear(); - executeAsync(client, deadline, returnFuture, attempt + 1); - } - @Override - public void onCompleted() { - returnFuture.complete(new NodeAddressBook().setNodeAddresses(addresses)); - } - }); + @Override + public void onCompleted() { + returnFuture.complete(new NodeAddressBook().setNodeAddresses(addresses)); + } + }); } /** @@ -266,13 +246,13 @@ com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery() { return builder.build(); } - private ClientCall - buildCall(Client client, Deadline deadline) { + private ClientCall buildCall( + Client client, Deadline deadline) { try { - return client.mirrorNetwork.getNextMirrorNode().getChannel().newCall( - NetworkServiceGrpc.getGetNodesMethod(), - CallOptions.DEFAULT.withDeadline(deadline) - ); + return client.mirrorNetwork + .getNextMirrorNode() + .getChannel() + .newCall(NetworkServiceGrpc.getGetNodesMethod(), CallOptions.DEFAULT.withDeadline(deadline)); } catch (InterruptedException e) { throw new RuntimeException(e); } @@ -281,8 +261,11 @@ com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery() { private void warnAndDelay(int attempt, Throwable error) { var delay = Math.min(500 * (long) Math.pow(2, attempt), maxBackoff.toMillis()); LOGGER.warn( - "Error fetching address book at FileId {} during attempt #{}. Waiting {} ms before next attempt: {}", - fileId, attempt, delay, error.getMessage()); + "Error fetching address book at FileId {} during attempt #{}. Waiting {} ms before next attempt: {}", + fileId, + attempt, + delay, + error.getMessage()); try { Thread.sleep(delay); diff --git a/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java b/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java index ba633c5d44..d46cab956e 100644 --- a/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java +++ b/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; /** * A custom transfer fee that was assessed during the handling of a CryptoTransfer. @@ -53,11 +34,10 @@ public class AssessedCustomFee { public final List payerAccountIdList; AssessedCustomFee( - long amount, - @Nullable TokenId tokenId, - @Nullable AccountId feeCollectorAccountId, - List payerAccountIdList - ) { + long amount, + @Nullable TokenId tokenId, + @Nullable AccountId feeCollectorAccountId, + List payerAccountIdList) { this.amount = amount; this.tokenId = tokenId; this.feeCollectorAccountId = feeCollectorAccountId; @@ -76,11 +56,12 @@ static AssessedCustomFee fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee asse payerList.add(AccountId.fromProtobuf(payerId)); } return new AssessedCustomFee( - assessedCustomFee.getAmount(), - assessedCustomFee.hasTokenId() ? TokenId.fromProtobuf(assessedCustomFee.getTokenId()) : null, - assessedCustomFee.hasFeeCollectorAccountId() ? AccountId.fromProtobuf(assessedCustomFee.getFeeCollectorAccountId()) : null, - payerList - ); + assessedCustomFee.getAmount(), + assessedCustomFee.hasTokenId() ? TokenId.fromProtobuf(assessedCustomFee.getTokenId()) : null, + assessedCustomFee.hasFeeCollectorAccountId() + ? AccountId.fromProtobuf(assessedCustomFee.getFeeCollectorAccountId()) + : null, + payerList); } /** @@ -91,17 +72,18 @@ static AssessedCustomFee fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee asse * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static AssessedCustomFee fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee.parseFrom(bytes).toBuilder() + .build()); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("amount", amount) - .add("tokenId", tokenId) - .add("feeCollectorAccountId", feeCollectorAccountId) - .add("payerAccountIdList", payerAccountIdList) - .toString(); + .add("amount", amount) + .add("tokenId", tokenId) + .add("feeCollectorAccountId", feeCollectorAccountId) + .add("payerAccountIdList", payerAccountIdList) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java b/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java index 89acf60972..00b04ed088 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java +++ b/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/BadKeyException.java b/sdk/src/main/java/com/hiero/sdk/BadKeyException.java index a81affad9d..aebe3d81c8 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadKeyException.java +++ b/sdk/src/main/java/com/hiero/sdk/BadKeyException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java b/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java index 12ec01877a..f327f7d596 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java +++ b/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java @@ -1,26 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; /** * Custom exception for when there are issues with the mnemonic. diff --git a/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java b/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java index 8655d50651..d59c203ab2 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java +++ b/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java b/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java index 8b71140318..d97c9d1ee2 100644 --- a/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java +++ b/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java @@ -1,34 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.annotations.VisibleForTesting; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.annotation.Nullable; /** * Abstracts away most of the similar functionality between {@link Network} and {@link MirrorNetwork} @@ -38,9 +19,9 @@ * @param - The specific node type for this network. */ abstract class BaseNetwork< - BaseNetworkT extends BaseNetwork, - KeyT, - BaseNodeT extends BaseNode> { + BaseNetworkT extends BaseNetwork, + KeyT, + BaseNodeT extends BaseNode> { protected static final Integer DEFAULT_MAX_NODE_ATTEMPTS = -1; protected static final Random random = new Random(); @@ -220,7 +201,7 @@ synchronized BaseNetworkT setMaxNodeBackoff(Duration maxNodeBackoff) { * * @return the minimum node readmit time */ - synchronized public Duration getMinNodeReadmitTime() { + public synchronized Duration getMinNodeReadmitTime() { return minNodeReadmitTime; } @@ -229,7 +210,7 @@ synchronized public Duration getMinNodeReadmitTime() { * * @param minNodeReadmitTime the minimum node readmit time */ - synchronized public void setMinNodeReadmitTime(Duration minNodeReadmitTime) { + public synchronized void setMinNodeReadmitTime(Duration minNodeReadmitTime) { this.minNodeReadmitTime = minNodeReadmitTime; for (var node : nodes) { @@ -310,12 +291,10 @@ protected List getNodesToRemove(Map network) { return nodes; } - private boolean nodeIsInGivenNetwork(BaseNodeT node, Map network) { + private boolean nodeIsInGivenNetwork(BaseNodeT node, Map network) { for (var entry : network.entrySet()) { - if ( - node.getKey().equals(entry.getValue()) && - node.address.equals(BaseNodeAddress.fromString(entry.getKey())) - ) { + if (node.getKey().equals(entry.getValue()) + && node.address.equals(BaseNodeAddress.fromString(entry.getKey()))) { return true; } } @@ -367,7 +346,8 @@ synchronized BaseNetworkT setNetwork(Map network) throws TimeoutEx for (var entry : network.entrySet()) { var node = createNodeFromNetworkEntry(entry); - if (newNodeKeys.contains(node.getKey()) && newNodeAddresses.contains(node.getAddress().toString())) { + if (newNodeKeys.contains(node.getKey()) + && newNodeAddresses.contains(node.getAddress().toString())) { continue; } @@ -459,13 +439,13 @@ synchronized void readmitNodes() { } } - this.earliestReadmitTime = nextEarliestReadmitTime; if (this.earliestReadmitTime.isBefore(now.plus(minNodeReadmitTime))) { this.earliestReadmitTime = now.plus(minNodeReadmitTime); } - outer: for (var i = 0; i < this.nodes.size(); i++) { + outer: + for (var i = 0; i < this.nodes.size(); i++) { // Check if `healthyNodes` already contains this node for (var j = 0; j < this.healthyNodes.size(); j++) { if (this.nodes.get(i) == this.healthyNodes.get(j)) { @@ -478,7 +458,6 @@ synchronized void readmitNodes() { this.healthyNodes.add(this.nodes.get(i)); } } - } } @@ -531,7 +510,7 @@ protected synchronized List getNumberOfMostHealthyNodes(int count) th var returnNodes = new HashMap(count); - for (var i = 0; i < count; i++ ) { + for (var i = 0; i < count; i++) { var node = getRandomNode(); if (!returnNodes.containsKey(node.getKey())) { @@ -544,7 +523,6 @@ protected synchronized List getNumberOfMostHealthyNodes(int count) th return returnList; } - synchronized void beginClose() { for (var node : nodes) { if (node.channel != null) { @@ -563,7 +541,8 @@ synchronized Throwable awaitClose(Instant deadline, @Nullable Throwable previous for (var node : nodes) { if (node.channel != null) { - var timeoutMillis = Duration.between(Instant.now(), deadline).toMillis(); + var timeoutMillis = + Duration.between(Instant.now(), deadline).toMillis(); if (timeoutMillis <= 0 || !node.channel.awaitTermination(timeoutMillis, TimeUnit.MILLISECONDS)) { throw new TimeoutException("Failed to properly shutdown all channels"); } else { diff --git a/sdk/src/main/java/com/hiero/sdk/BaseNode.java b/sdk/src/main/java/com/hiero/sdk/BaseNode.java index a25f1160fe..f84875b455 100644 --- a/sdk/src/main/java/com/hiero/sdk/BaseNode.java +++ b/sdk/src/main/java/com/hiero/sdk/BaseNode.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import io.grpc.ChannelCredentials; @@ -26,8 +8,6 @@ import io.grpc.ManagedChannelBuilder; import io.grpc.TlsChannelCredentials; import io.grpc.inprocess.InProcessChannelBuilder; - -import java.lang.module.ModuleDescriptor; import java.time.Duration; import java.time.Instant; import java.util.Objects; @@ -281,12 +261,12 @@ synchronized ManagedChannel getChannel() { } channel = channelBuilder - .keepAliveTimeout(10, TimeUnit.SECONDS) - .keepAliveWithoutCalls(true) - .disableRetry() - .userAgent(getUserAgent()) - .executor(executor) - .build(); + .keepAliveTimeout(10, TimeUnit.SECONDS) + .keepAliveWithoutCalls(true) + .disableRetry() + .userAgent(getUserAgent()) + .executor(executor) + .build(); return channel; } @@ -320,7 +300,6 @@ boolean channelFailedToConnect(Instant timeoutTime) { return !hasConnected; } - private CompletableFuture channelFailedToConnectAsync(int i, ConnectivityState state) { hasConnected = (state == ConnectivityState.READY); if (i >= GET_STATE_MAX_ATTEMPTS || hasConnected) { diff --git a/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java b/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java index 33e672d8fe..2ea1171e6f 100644 --- a/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java +++ b/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java @@ -1,27 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import javax.annotation.Nullable; import java.util.Objects; import java.util.regex.Pattern; +import javax.annotation.Nullable; /** * Internal utility class. @@ -39,6 +21,7 @@ class BaseNodeAddress { @Nullable private final String address; + private final int port; private final boolean secure; @@ -169,7 +152,9 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BaseNodeAddress that = (BaseNodeAddress) o; - return Objects.equals(getName(), that.getName()) && Objects.equals(getAddress(), that.getAddress()) && port == that.port; + return Objects.equals(getName(), that.getName()) + && Objects.equals(getAddress(), that.getAddress()) + && port == that.port; } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java b/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java index 4c535fbc15..012ce1d3fe 100644 --- a/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -64,7 +46,8 @@ abstract class ChunkedTransaction> extends Trans * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ChunkedTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ChunkedTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); } @@ -184,7 +167,8 @@ public T setChunkSize(int chunkSize) { @Override public byte[] getTransactionHash() { if (outerTransactions.size() > nodeAccountIds.size()) { - throw new IllegalStateException("a single transaction hash can not be calculated for a chunked transaction, try calling `getAllTransactionHashesPerNode`"); + throw new IllegalStateException( + "a single transaction hash can not be calculated for a chunked transaction, try calling `getAllTransactionHashesPerNode`"); } return super.getTransactionHash(); @@ -193,7 +177,8 @@ public byte[] getTransactionHash() { @Override public Map getTransactionHashPerNode() { if (outerTransactions.size() > nodeAccountIds.size()) { - throw new IllegalStateException("a single transaction hash can not be calculated for a chunked transaction, try calling `getAllTransactionHashesPerNode`"); + throw new IllegalStateException( + "a single transaction hash can not be calculated for a chunked transaction, try calling `getAllTransactionHashesPerNode`"); } return super.getTransactionHashPerNode(); @@ -206,7 +191,8 @@ public Map getTransactionHashPerNode() { */ public final List> getAllTransactionHashesPerNode() { if (!this.isFrozen()) { - throw new IllegalStateException("transaction must have been frozen before calculating the hash will be stable, try calling `freeze`"); + throw new IllegalStateException( + "transaction must have been frozen before calculating the hash will be stable, try calling `freeze`"); } transactionIds.setLocked(true); @@ -224,8 +210,11 @@ public final List> getAllTransactionHashesPerNode() { for (var nodeIndex = 0; nodeIndex < nodeCount; ++nodeIndex) { hashes.put( - nodeAccountIds.get(nodeIndex), - hash(outerTransactions.get(offset + nodeIndex).getSignedTransactionBytes().toByteArray())); + nodeAccountIds.get(nodeIndex), + hash(outerTransactions + .get(offset + nodeIndex) + .getSignedTransactionBytes() + .toByteArray())); } transactionHashes.add(hashes); @@ -237,7 +226,8 @@ public final List> getAllTransactionHashesPerNode() { @Override public T addSignature(PublicKey publicKey, byte[] signature) { if (data.size() > chunkSize) { - throw new IllegalStateException("Cannot manually add signature to chunked transaction with length greater than " + chunkSize); + throw new IllegalStateException( + "Cannot manually add signature to chunked transaction with length greater than " + chunkSize); } return super.addSignature(publicKey, signature); } @@ -245,7 +235,8 @@ public T addSignature(PublicKey publicKey, byte[] signature) { @Override public Map> getSignatures() { if (data.size() > chunkSize) { - throw new IllegalStateException("Cannot call getSignatures() on a chunked transaction with length greater than " + chunkSize); + throw new IllegalStateException( + "Cannot call getSignatures() on a chunked transaction with length greater than " + chunkSize); } return super.getSignatures(); } @@ -289,7 +280,8 @@ private void freezeAndSign(Client client) { } @Override - public TransactionResponse execute(Client client, Duration timeoutPerChunk) throws TimeoutException, PrecheckStatusException { + public TransactionResponse execute(Client client, Duration timeoutPerChunk) + throws TimeoutException, PrecheckStatusException { return executeAll(client, timeoutPerChunk).get(0); } @@ -314,7 +306,8 @@ public List executeAll(Client client) throws PrecheckStatus * @throws TimeoutException when the transaction times out * @throws PrecheckStatusException when the precheck fails */ - public List executeAll(Client client, Duration timeoutPerChunk) throws PrecheckStatusException, TimeoutException { + public List executeAll(Client client, Duration timeoutPerChunk) + throws PrecheckStatusException, TimeoutException { freezeAndSign(client); var responses = new ArrayList(transactionIds.size()); @@ -324,9 +317,9 @@ public List executeAll(Client client, Duration timeoutPerCh if (shouldGetReceipt()) { new TransactionReceiptQuery() - .setNodeAccountIds(Collections.singletonList(response.nodeId)) - .setTransactionId(response.transactionId) - .execute(client, timeoutPerChunk); + .setNodeAccountIds(Collections.singletonList(response.nodeId)) + .setTransactionId(response.transactionId) + .execute(client, timeoutPerChunk); } responses.add(response); @@ -356,21 +349,20 @@ public CompletableFuture> executeAllAsync(Client clien freezeAndSign(client); CompletableFuture> future = - CompletableFuture.supplyAsync(() -> new ArrayList<>(transactionIds.size())); + CompletableFuture.supplyAsync(() -> new ArrayList<>(transactionIds.size())); for (var i = 0; i < transactionIds.size(); i++) { future = future.thenCompose(list -> { var responseFuture = super.executeAsync(client, timeoutPerChunk); Function> receiptFuture = - (TransactionResponse response) -> response.getReceiptAsync(client, timeoutPerChunk) - .thenApply(receipt -> response); + (TransactionResponse response) -> response.getReceiptAsync(client, timeoutPerChunk) + .thenApply(receipt -> response); - Function> addToList = - (response) -> { - list.add(response); - return list; - }; + Function> addToList = (response) -> { + list.add(response); + return list; + }; if (shouldGetReceipt()) { return responseFuture.thenCompose(receiptFuture).thenApply(addToList); @@ -400,7 +392,8 @@ public void executeAllAsync(Client client, BiConsumer, * @param timeout The timeout after which the execution attempt will be cancelled. * @param callback a BiConsumer which handles the result or error. */ - public void executeAllAsync(Client client, Duration timeout, BiConsumer, Throwable> callback) { + public void executeAllAsync( + Client client, Duration timeout, BiConsumer, Throwable> callback) { ConsumerHelper.biConsumer(executeAllAsync(client, timeout), callback); } @@ -411,7 +404,8 @@ public void executeAllAsync(Client client, Duration timeout, BiConsumer> onSuccess, Consumer onFailure) { + public void executeAllAsync( + Client client, Consumer> onSuccess, Consumer onFailure) { ConsumerHelper.twoConsumers(executeAllAsync(client), onSuccess, onFailure); } @@ -423,7 +417,11 @@ public void executeAllAsync(Client client, Consumer> o * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void executeAllAsync(Client client, Duration timeout, Consumer> onSuccess, Consumer onFailure) { + public void executeAllAsync( + Client client, + Duration timeout, + Consumer> onSuccess, + Consumer onFailure) { ConsumerHelper.twoConsumers(executeAllAsync(client, timeout), onSuccess, onFailure); } @@ -437,25 +435,18 @@ public ScheduleCreateTransaction schedule() { requireNotFrozen(); if (!nodeAccountIds.isEmpty()) { throw new IllegalStateException( - "The underlying transaction for a scheduled transaction cannot have node account IDs set" - ); + "The underlying transaction for a scheduled transaction cannot have node account IDs set"); } if (data.size() > chunkSize) { - throw new IllegalStateException("Cannot schedule a chunked transaction with length greater than " + chunkSize); + throw new IllegalStateException( + "Cannot schedule a chunked transaction with length greater than " + chunkSize); } var bodyBuilder = spawnBodyBuilder(null); onFreeze(bodyBuilder); - onFreezeChunk( - bodyBuilder, - null, - 0, - data.size(), - 1, - 1 - ); + onFreezeChunk(bodyBuilder, null, 0, data.size(), 1, 1); return doSchedule(bodyBuilder); } @@ -469,8 +460,7 @@ int getRequiredChunks() { } if (requiredChunks > maxChunks) { - throw new IllegalArgumentException( - "message of " + this.data.size() + " bytes requires " + requiredChunks + throw new IllegalArgumentException("message of " + this.data.size() + " bytes requires " + requiredChunks + " chunks but the maximum allowed chunks is " + maxChunks + ", try using setMaxChunks"); } return requiredChunks; @@ -492,26 +482,23 @@ void wipeTransactionLists(int requiredChunks) { } onFreezeChunk( - Objects.requireNonNull(frozenBodyBuilder).setTransactionID(transactionIds.get(i).toProtobuf()), - transactionIds.get(0).toProtobuf(), - startIndex, - endIndex, - i, - requiredChunks - ); + Objects.requireNonNull(frozenBodyBuilder) + .setTransactionID(transactionIds.get(i).toProtobuf()), + transactionIds.get(0).toProtobuf(), + startIndex, + endIndex, + i, + requiredChunks); } // For each node we add a transaction with that node for (var nodeId : nodeAccountIds) { sigPairLists.add(SignatureMap.newBuilder()); innerSignedTransactions.add(SignedTransaction.newBuilder() - .setBodyBytes( - frozenBodyBuilder - .setNodeAccountID(nodeId.toProtobuf()) - .build() - .toByteString() - ) - ); + .setBodyBytes(frozenBodyBuilder + .setNodeAccountID(nodeId.toProtobuf()) + .build() + .toByteString())); outerTransactions.add(null); } } @@ -520,7 +507,13 @@ void wipeTransactionLists(int requiredChunks) { /** * A common base for file and topic message transactions. */ - abstract void onFreezeChunk(TransactionBody.Builder body, @Nullable TransactionID initialTransactionId, int startIndex, int endIndex, int chunk, int total); + abstract void onFreezeChunk( + TransactionBody.Builder body, + @Nullable TransactionID initialTransactionId, + int startIndex, + int endIndex, + int chunk, + int total); /** * Should the receipt be retrieved? diff --git a/sdk/src/main/java/com/hiero/sdk/Client.java b/sdk/src/main/java/com/hiero/sdk/Client.java index 390be419c4..4dfed14b37 100644 --- a/sdk/src/main/java/com/hiero/sdk/Client.java +++ b/sdk/src/main/java/com/hiero/sdk/Client.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.annotations.VisibleForTesting; @@ -81,13 +63,17 @@ public final class Client implements AutoCloseable { final ExecutorService executor; private final AtomicReference grpcDeadline = new AtomicReference(DEFAULT_GRPC_DEADLINE); private final Set subscriptions = ConcurrentHashMap.newKeySet(); + @Nullable Hbar defaultMaxTransactionFee = null; + Hbar defaultMaxQueryPayment = DEFAULT_MAX_QUERY_PAYMENT; Network network; MirrorNetwork mirrorNetwork; + @Nullable private Operator operator; + private Duration requestTimeout = DEFAULT_REQUEST_TIMEOUT; private Duration closeTimeout = DEFAULT_CLOSE_TIMEOUT; private int maxAttempts = DEFAULT_MAX_ATTEMPTS; @@ -99,8 +85,10 @@ public final class Client implements AutoCloseable { // If networkUpdatePeriod is null, any network updates in progress will not complete @Nullable private Duration networkUpdatePeriod; + @Nullable private CompletableFuture networkUpdateFuture; + private Logger logger = new Logger(LogLevel.SILENT); /** @@ -113,12 +101,12 @@ public final class Client implements AutoCloseable { */ @VisibleForTesting Client( - ExecutorService executor, - Network network, - MirrorNetwork mirrorNetwork, - @Nullable Duration networkUpdateInitialDelay, boolean shouldShutdownExecutor, - @Nullable Duration networkUpdatePeriod - ) { + ExecutorService executor, + Network network, + MirrorNetwork mirrorNetwork, + @Nullable Duration networkUpdateInitialDelay, + boolean shouldShutdownExecutor, + @Nullable Duration networkUpdatePeriod) { this.executor = executor; this.network = network; this.mirrorNetwork = mirrorNetwork; @@ -134,15 +122,19 @@ public final class Client implements AutoCloseable { */ static ExecutorService createExecutor() { var threadFactory = new ThreadFactoryBuilder() - .setNameFormat("hedera-sdk-%d") - .setDaemon(true) - .build(); + .setNameFormat("hedera-sdk-%d") + .setDaemon(true) + .build(); int nThreads = Runtime.getRuntime().availableProcessors(); - return new ThreadPoolExecutor(nThreads, nThreads, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(), - threadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + return new ThreadPoolExecutor( + nThreads, + nThreads, + 0L, + TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<>(), + threadFactory, + new ThreadPoolExecutor.CallerRunsPolicy()); } /** @@ -164,7 +156,6 @@ public static Client forNetwork(Map networkMap, ExecutorServi return new Client(executor, network, mirrorNetwork, null, false, null); } - /** * Construct a client given a set of nodes. * @@ -191,14 +182,13 @@ public static Client forNetwork(Map networkMap) { * @param mirrorNetworkList * @return */ - public static Client forMirrorNetwork(List mirrorNetworkList) throws InterruptedException, TimeoutException { + public static Client forMirrorNetwork(List mirrorNetworkList) + throws InterruptedException, TimeoutException { var executor = createExecutor(); var network = Network.forNetwork(executor, new HashMap<>()); var mirrorNetwork = MirrorNetwork.forNetwork(executor, mirrorNetworkList); var client = new Client(executor, network, mirrorNetwork, null, true, null); - var addressBook = new AddressBookQuery() - .setFileId(FileId.ADDRESS_BOOK) - .execute(client); + var addressBook = new AddressBookQuery().setFileId(FileId.ADDRESS_BOOK).execute(client); client.setNetworkFromAddressBook(addressBook); return client; } @@ -229,8 +219,8 @@ public static Client forMainnet(ExecutorService executor) { var network = Network.forMainnet(executor); var mirrorNetwork = MirrorNetwork.forMainnet(executor); - return new Client(executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, - false, DEFAULT_NETWORK_UPDATE_PERIOD); + return new Client( + executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, false, DEFAULT_NETWORK_UPDATE_PERIOD); } /** @@ -244,8 +234,8 @@ public static Client forTestnet(ExecutorService executor) { var network = Network.forTestnet(executor); var mirrorNetwork = MirrorNetwork.forTestnet(executor); - return new Client(executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, - false, DEFAULT_NETWORK_UPDATE_PERIOD); + return new Client( + executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, false, DEFAULT_NETWORK_UPDATE_PERIOD); } /** @@ -260,11 +250,10 @@ public static Client forPreviewnet(ExecutorService executor) { var network = Network.forPreviewnet(executor); var mirrorNetwork = MirrorNetwork.forPreviewnet(executor); - return new Client(executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, - false, DEFAULT_NETWORK_UPDATE_PERIOD); + return new Client( + executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, false, DEFAULT_NETWORK_UPDATE_PERIOD); } - /** * Construct a Hedera client pre-configured for Mainnet access. @@ -276,8 +265,8 @@ public static Client forMainnet() { var network = Network.forMainnet(executor); var mirrorNetwork = MirrorNetwork.forMainnet(executor); - return new Client(executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, - true, DEFAULT_NETWORK_UPDATE_PERIOD); + return new Client( + executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, true, DEFAULT_NETWORK_UPDATE_PERIOD); } /** @@ -291,8 +280,8 @@ public static Client forTestnet() { var network = Network.forTestnet(executor); var mirrorNetwork = MirrorNetwork.forTestnet(executor); - return new Client(executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, - true, DEFAULT_NETWORK_UPDATE_PERIOD); + return new Client( + executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, true, DEFAULT_NETWORK_UPDATE_PERIOD); } /** @@ -307,8 +296,8 @@ public static Client forPreviewnet() { var network = Network.forPreviewnet(executor); var mirrorNetwork = MirrorNetwork.forPreviewnet(executor); - return new Client(executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, - true, DEFAULT_NETWORK_UPDATE_PERIOD); + return new Client( + executor, network, mirrorNetwork, NETWORK_UPDATE_INITIAL_DELAY, true, DEFAULT_NETWORK_UPDATE_PERIOD); } /** @@ -336,8 +325,9 @@ public static Client fromConfig(Reader json) throws Exception { private static Map getNetworkNodes(JsonObject networks) { Map nodes = new HashMap<>(networks.size()); for (Map.Entry entry : networks.entrySet()) { - nodes.put(entry.getValue().toString().replace("\"", ""), - AccountId.fromString(entry.getKey().replace("\"", ""))); + nodes.put( + entry.getValue().toString().replace("\"", ""), + AccountId.fromString(entry.getKey().replace("\"", ""))); } return nodes; } @@ -369,7 +359,7 @@ public static Client fromConfigFile(File file) throws Exception { * * @return the list of mirror nodes */ - synchronized public List getMirrorNetwork() { + public synchronized List getMirrorNetwork() { return mirrorNetwork.getNetwork(); } @@ -399,18 +389,21 @@ private synchronized void scheduleNetworkUpdate(@Nullable Duration delay) { networkUpdateFuture.thenRun(() -> { // Checking networkUpdatePeriod != null must be synchronized, so I've put it in a synchronized method. requireNetworkUpdatePeriodNotNull(() -> { - new AddressBookQuery().setFileId(FileId.ADDRESS_BOOK).executeAsync(this) - .thenCompose(addressBook -> requireNetworkUpdatePeriodNotNull(() -> { - try { - this.setNetworkFromAddressBook(addressBook); - } catch (Throwable error) { - return CompletableFuture.failedFuture(error); - } - return CompletableFuture.completedFuture(null); - })).exceptionally(error -> { - logger.warn("Failed to update address book via mirror node query ", error); - return null; - }); + new AddressBookQuery() + .setFileId(FileId.ADDRESS_BOOK) + .executeAsync(this) + .thenCompose(addressBook -> requireNetworkUpdatePeriodNotNull(() -> { + try { + this.setNetworkFromAddressBook(addressBook); + } catch (Throwable error) { + return CompletableFuture.failedFuture(error); + } + return CompletableFuture.completedFuture(null); + })) + .exceptionally(error -> { + logger.warn("Failed to update address book via mirror node query ", error); + return null; + }); scheduleNetworkUpdate(networkUpdatePeriod); return null; }); @@ -447,7 +440,7 @@ void untrackSubscription(SubscriptionHandle subscriptionHandle) { * @return {@code this} */ public synchronized Client setNetworkFromAddressBook(NodeAddressBook addressBook) - throws InterruptedException, TimeoutException { + throws InterruptedException, TimeoutException { network.setNetwork(Network.addressBookToNetwork(addressBook.nodeAddresses)); network.setAddressBook(addressBook); return this; @@ -458,7 +451,7 @@ public synchronized Client setNetworkFromAddressBook(NodeAddressBook addressBook * * @return the client's network */ - synchronized public Map getNetwork() { + public synchronized Map getNetwork() { return network.getNetwork(); } @@ -471,7 +464,7 @@ synchronized public Map getNetwork() { * @throws InterruptedException when a thread is interrupted while it's waiting, sleeping, or otherwise occupied */ public synchronized Client setNetwork(Map network) - throws InterruptedException, TimeoutException { + throws InterruptedException, TimeoutException { this.network.setNetwork(network); return this; } @@ -567,9 +560,9 @@ public Void ping(AccountId nodeAccountId) throws PrecheckStatusException, Timeou */ public Void ping(AccountId nodeAccountId, Duration timeout) throws PrecheckStatusException, TimeoutException { new AccountBalanceQuery() - .setAccountId(nodeAccountId) - .setNodeAccountIds(Collections.singletonList(nodeAccountId)) - .execute(this, timeout); + .setAccountId(nodeAccountId) + .setNodeAccountIds(Collections.singletonList(nodeAccountId)) + .execute(this, timeout); return null; } @@ -594,16 +587,16 @@ public CompletableFuture pingAsync(AccountId nodeAccountId) { public CompletableFuture pingAsync(AccountId nodeAccountId, Duration timeout) { var result = new CompletableFuture(); new AccountBalanceQuery() - .setAccountId(nodeAccountId) - .setNodeAccountIds(Collections.singletonList(nodeAccountId)) - .executeAsync(this, timeout) - .whenComplete((balance, error) -> { - if (error == null) { - result.complete(null); - } else { - result.completeExceptionally(error); - } - }); + .setAccountId(nodeAccountId) + .setNodeAccountIds(Collections.singletonList(nodeAccountId)) + .executeAsync(this, timeout) + .whenComplete((balance, error) -> { + if (error == null) { + result.complete(null); + } else { + result.completeExceptionally(error); + } + }); return result; } @@ -647,8 +640,8 @@ public void pingAsync(AccountId nodeAccountId, Consumer onSuccess, Consume * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void pingAsync(AccountId nodeAccountId, Duration timeout, Consumer onSuccess, - Consumer onFailure) { + public void pingAsync( + AccountId nodeAccountId, Duration timeout, Consumer onSuccess, Consumer onFailure) { ConsumerHelper.twoConsumers(pingAsync(nodeAccountId, timeout), onSuccess, onFailure); } @@ -704,7 +697,8 @@ public synchronized CompletableFuture pingAllAsync(Duration timeoutPerPing list.add(pingAsync(nodeAccountId, timeoutPerPing)); } - return CompletableFuture.allOf(list.toArray(new CompletableFuture[0])).thenApply((v) -> null); + return CompletableFuture.allOf(list.toArray(new CompletableFuture[0])) + .thenApply((v) -> null); } /** @@ -780,16 +774,15 @@ public synchronized Client setOperator(AccountId accountId, PrivateKey privateKe * @param transactionSigner The signer for the operator * @return {@code this} */ - public synchronized Client setOperatorWith(AccountId accountId, PublicKey publicKey, - UnaryOperator transactionSigner) { + public synchronized Client setOperatorWith( + AccountId accountId, PublicKey publicKey, UnaryOperator transactionSigner) { if (getNetworkName() != null) { try { accountId.validateChecksum(this); } catch (BadEntityIdException exc) { throw new IllegalArgumentException( - "Tried to set the client operator account ID to an account ID with an invalid checksum: " - + exc.getMessage() - ); + "Tried to set the client operator account ID to an account ID with an invalid checksum: " + + exc.getMessage()); } } @@ -1441,7 +1434,8 @@ private Client initializeWithNetwork() throws Exception { Client client; if (network.isJsonObject()) { client = clientFromNetworkJson(); - } else {; + } else { + ; client = clientFromNetworkString(); } return client; @@ -1463,7 +1457,7 @@ private void setNetworkNameOn(Client client) { client.setNetworkName(NetworkName.fromString(networkNameString)); } catch (Exception ignored) { throw new IllegalArgumentException("networkName in config was \"" + networkNameString - + "\", expected either \"mainnet\", \"testnet\" or \"previewnet\""); + + "\", expected either \"mainnet\", \"testnet\" or \"previewnet\""); } } } diff --git a/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java b/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java index ce9e5017a1..fa37d076fb 100644 --- a/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java +++ b/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.concurrent.CompletableFuture; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java b/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java index e8bc2967a5..f2ee254640 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -26,9 +8,8 @@ import com.hiero.sdk.proto.ResponseHeader; import com.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * Get the bytecode for a smart contract instance. @@ -40,8 +21,7 @@ public final class ContractByteCodeQuery extends Query { @Nullable private ContractId contractId = null; + private long gas = 0; private byte[] functionParameters = {}; private long maxResultSize = 0; + @Nullable private AccountId senderAccountId = null; /** * Constructor. */ - public ContractCallQuery() { - } + public ContractCallQuery() {} /** * Extract the contract id. @@ -201,7 +184,6 @@ public AccountId getSenderAccountId() { * @param senderAccountId the account that is the "sender" * @return {@code this} */ - public ContractCallQuery setSenderAccountId(AccountId senderAccountId) { Objects.requireNonNull(senderAccountId); this.senderAccountId = senderAccountId; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java b/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java index 09a3ad5372..bed7ad0299 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -80,24 +62,35 @@ public class ContractCreateFlow { static final int FILE_CREATE_MAX_BYTES = 2048; private String bytecode = ""; + @Nullable private Integer maxChunks = null; + @Nullable private Key adminKey = null; + private long gas = 0; private Hbar initialBalance = Hbar.ZERO; + @Nullable private AccountId proxyAccountId = null; + private int maxAutomaticTokenAssociations = 0; + @Nullable private Duration autoRenewPeriod = null; + @Nullable private AccountId autoRenewAccountId = null; + private byte[] constructorParameters = {}; + @Nullable private String contractMemo = null; + @Nullable private List nodeAccountIds = null; + private String createBytecode = ""; private String appendBytecode = ""; @@ -124,8 +117,7 @@ public class ContractCreateFlow { /** * Constructor */ - public ContractCreateFlow() { - } + public ContractCreateFlow() {} /** * Extract the hex-encoded bytecode of the contract. @@ -568,8 +560,8 @@ private void splitBytecode() { private FileCreateTransaction createFileCreateTransaction(Client client) { var fileCreateTx = new FileCreateTransaction() - .setKeys(Objects.requireNonNull(client.getOperatorPublicKey())) - .setContents(createBytecode); + .setKeys(Objects.requireNonNull(client.getOperatorPublicKey())) + .setContents(createBytecode); if (nodeAccountIds != null) { fileCreateTx.setNodeAccountIds(nodeAccountIds); } @@ -577,9 +569,7 @@ private FileCreateTransaction createFileCreateTransaction(Client client) { } private FileAppendTransaction createFileAppendTransaction(FileId fileId) { - var fileAppendTx = new FileAppendTransaction() - .setFileId(fileId) - .setContents(appendBytecode); + var fileAppendTx = new FileAppendTransaction().setFileId(fileId).setContents(appendBytecode); if (maxChunks != null) { fileAppendTx.setMaxChunks(maxChunks); } @@ -591,12 +581,12 @@ private FileAppendTransaction createFileAppendTransaction(FileId fileId) { private ContractCreateTransaction createContractCreateTransaction(FileId fileId) { var contractCreateTx = new ContractCreateTransaction() - .setBytecodeFileId(fileId) - .setConstructorParameters(constructorParameters) - .setGas(gas) - .setInitialBalance(initialBalance) - .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) - .setDeclineStakingReward(declineStakingReward); + .setBytecodeFileId(fileId) + .setConstructorParameters(constructorParameters) + .setGas(gas) + .setInitialBalance(initialBalance) + .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) + .setDeclineStakingReward(declineStakingReward); if (adminKey != null) { contractCreateTx.setAdminKey(adminKey); } @@ -639,8 +629,8 @@ private ContractCreateTransaction createContractCreateTransaction(FileId fileId) */ TransactionReceiptQuery createTransactionReceiptQuery(TransactionResponse response) { return new TransactionReceiptQuery() - .setNodeAccountIds(Collections.singletonList(response.nodeId)) - .setTransactionId(response.transactionId); + .setNodeAccountIds(Collections.singletonList(response.nodeId)) + .setTransactionId(response.transactionId); } /** @@ -665,23 +655,20 @@ public TransactionResponse execute(Client client) throws PrecheckStatusException * @throws TimeoutException when the transaction times out */ public TransactionResponse execute(Client client, Duration timeoutPerTransaction) - throws PrecheckStatusException, TimeoutException { + throws PrecheckStatusException, TimeoutException { try { splitBytecode(); var fileId = createFileCreateTransaction(client) - .execute(client, timeoutPerTransaction) - .getReceipt(client, timeoutPerTransaction) - .fileId; + .execute(client, timeoutPerTransaction) + .getReceipt(client, timeoutPerTransaction) + .fileId; Objects.requireNonNull(fileId); if (!appendBytecode.isEmpty()) { - createFileAppendTransaction(fileId) - .execute(client, timeoutPerTransaction); + createFileAppendTransaction(fileId).execute(client, timeoutPerTransaction); } var response = createContractCreateTransaction(fileId).execute(client, timeoutPerTransaction); response.getReceipt(client, timeoutPerTransaction); - new FileDeleteTransaction() - .setFileId(fileId) - .execute(client, timeoutPerTransaction); + new FileDeleteTransaction().setFileId(fileId).execute(client, timeoutPerTransaction); return response; } catch (ReceiptStatusException e) { throw new RuntimeException(e); @@ -707,26 +694,30 @@ public CompletableFuture executeAsync(Client client) { */ public CompletableFuture executeAsync(Client client, Duration timeoutPerTransaction) { splitBytecode(); - return createFileCreateTransaction(client).executeAsync(client, timeoutPerTransaction) - .thenCompose(fileCreateResponse -> createTransactionReceiptQuery(fileCreateResponse) + return createFileCreateTransaction(client) .executeAsync(client, timeoutPerTransaction) - .thenApply(receipt -> receipt.fileId)).thenCompose(fileId -> { - CompletableFuture appendFuture = - appendBytecode.isEmpty() ? CompletableFuture.completedFuture(null) : - createFileAppendTransaction(fileId).executeAsync(client, timeoutPerTransaction) - .thenApply(ignored -> null); - return appendFuture.thenCompose( - ignored -> createContractCreateTransaction(fileId).executeAsync(client, timeoutPerTransaction) - .thenApply(contractCreateResponse -> { - createTransactionReceiptQuery(contractCreateResponse).executeAsync(client, - timeoutPerTransaction).thenRun(() -> { - new FileDeleteTransaction() - .setFileId(fileId) - .executeAsync(client, timeoutPerTransaction); - }); - return contractCreateResponse; - })); - }); + .thenCompose(fileCreateResponse -> createTransactionReceiptQuery(fileCreateResponse) + .executeAsync(client, timeoutPerTransaction) + .thenApply(receipt -> receipt.fileId)) + .thenCompose(fileId -> { + CompletableFuture appendFuture = appendBytecode.isEmpty() + ? CompletableFuture.completedFuture(null) + : createFileAppendTransaction(fileId) + .executeAsync(client, timeoutPerTransaction) + .thenApply(ignored -> null); + return appendFuture.thenCompose(ignored -> createContractCreateTransaction(fileId) + .executeAsync(client, timeoutPerTransaction) + .thenApply(contractCreateResponse -> { + createTransactionReceiptQuery(contractCreateResponse) + .executeAsync(client, timeoutPerTransaction) + .thenRun(() -> { + new FileDeleteTransaction() + .setFileId(fileId) + .executeAsync(client, timeoutPerTransaction); + }); + return contractCreateResponse; + })); + }); } /** @@ -746,8 +737,8 @@ public void executeAsync(Client client, BiConsumer callback) { + public void executeAsync( + Client client, Duration timeoutPerTransaction, BiConsumer callback) { ConsumerHelper.biConsumer(executeAsync(client, timeoutPerTransaction), callback); } @@ -770,8 +761,11 @@ public void executeAsync(Client client, Consumer onSuccess, * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void executeAsync(Client client, Duration timeoutPerTransaction, Consumer onSuccess, - Consumer onFailure) { + public void executeAsync( + Client client, + Duration timeoutPerTransaction, + Consumer onSuccess, + Consumer onFailure) { ConsumerHelper.twoConsumers(executeAsync(client, timeoutPerTransaction), onSuccess, onFailure); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java index 0cfbcade7a..f4133d47c9 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -27,12 +9,11 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; -import org.bouncycastle.util.Arrays; import java.time.Duration; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; +import org.bouncycastle.util.Arrays; /** * Start a new smart contract instance. @@ -82,6 +63,7 @@ public final class ContractCreateTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + ContractCreateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -191,7 +178,6 @@ public byte[] getBytecode() { * @param bytecode The bytecode * @return {@code this} */ - public ContractCreateTransaction setBytecode(byte[] bytecode) { Objects.requireNonNull(bytecode); requireNotFrozen(); diff --git a/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java index 1ae5aa56e1..3885ec37dd 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Marks a contract as deleted, moving all its current hbars to another account. @@ -38,16 +19,17 @@ public final class ContractDeleteTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + ContractDeleteTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -165,7 +149,6 @@ void validateChecksums(Client client) throws BadEntityIdException { } } - @Override MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getDeleteContractMethod(); diff --git a/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java index ee56770096..a7214ba752 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -27,10 +9,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Call a function of the given smart contract instance, giving it parameters as its inputs. @@ -45,6 +26,7 @@ public final class ContractExecuteTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + ContractExecuteTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java b/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java index ede72bc376..6b077f2fab 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java @@ -1,26 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; - import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; @@ -29,7 +10,6 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import javax.annotation.Nullable; - import org.bouncycastle.util.encoders.DecoderException; import org.bouncycastle.util.encoders.Hex; @@ -78,13 +58,11 @@ public final class ContractFunctionParameters { private static ByteString encodeString(String string) { ByteString strBytes = ByteString.copyFromUtf8(string); // prepend the size of the string in UTF-8 bytes - return int256(strBytes.size(), 32) - .concat(rightPad32(strBytes)); + return int256(strBytes.size(), 32).concat(rightPad32(strBytes)); } private static ByteString encodeBytes(byte[] bytes) { - return int256(bytes.length, 32) - .concat(rightPad32(ByteString.copyFrom(bytes))); + return int256(bytes.length, 32).concat(rightPad32(ByteString.copyFrom(bytes))); } private static ByteString encodeBytes4(byte[] bytes) { @@ -94,7 +72,6 @@ private static ByteString encodeBytes4(byte[] bytes) { return rightPad32(ByteString.copyFrom(bytes)); } - private static ByteString encodeBytes32(byte[] bytes) { if (bytes.length > 32) { throw new IllegalArgumentException("byte32 encoding forbids byte array length greater than 32"); @@ -110,8 +87,7 @@ private static ByteString encodeBool(boolean bool) { private static ByteString encodeArray(Stream elements) { List list = elements.collect(Collectors.toList()); - return int256(list.size(), 32) - .concat(ByteString.copyFrom(list)); + return int256(list.size(), 32).concat(ByteString.copyFrom(list)); } private static ByteString encodeDynArr(List elements) { @@ -165,9 +141,9 @@ static ByteString int256(long val, int bitWidth, boolean signed) { static byte[] getTruncatedBytes(BigInteger bigInt, int bitWidth) { byte[] bytes = bigInt.toByteArray(); int expectedBytes = bitWidth / 8; - return bytes.length <= expectedBytes ? - bytes : - Arrays.copyOfRange(bytes, bytes.length - expectedBytes, bytes.length); + return bytes.length <= expectedBytes + ? bytes + : Arrays.copyOfRange(bytes, bytes.length - expectedBytes, bytes.length); } static ByteString int256(BigInteger bigInt, int bitWidth) { @@ -194,9 +170,8 @@ static ByteString leftPad32(ByteString input) { static ByteString leftPad32(ByteString input, boolean negative) { int rem = 32 - input.size() % 32; return rem == 32 - ? input - : (negative ? negativePadding : padding).substring(0, rem) - .concat(input); + ? input + : (negative ? negativePadding : padding).substring(0, rem).concat(input); } static ByteString leftPad32(byte[] input, boolean negative) { @@ -212,8 +187,7 @@ private static byte[] decodeAddress(String address) { address = address.startsWith("0x") ? address.substring(2) : address; if (address.length() != ADDRESS_LEN_HEX) { - throw new IllegalArgumentException( - "Solidity addresses must be 40 hex chars"); + throw new IllegalArgumentException("Solidity addresses must be 40 hex chars"); } try { @@ -246,8 +220,8 @@ public ContractFunctionParameters addString(String param) { */ public ContractFunctionParameters addStringArray(String[] strings) { List byteStrings = Arrays.stream(strings) - .map(ContractFunctionParameters::encodeString) - .collect(Collectors.toList()); + .map(ContractFunctionParameters::encodeString) + .collect(Collectors.toList()); ByteString argBytes = encodeDynArr(byteStrings); @@ -276,8 +250,8 @@ public ContractFunctionParameters addBytes(byte[] param) { */ public ContractFunctionParameters addBytesArray(byte[][] param) { List byteArrays = Arrays.stream(param) - .map(ContractFunctionParameters::encodeBytes) - .collect(Collectors.toList()); + .map(ContractFunctionParameters::encodeBytes) + .collect(Collectors.toList()); args.add(new Argument("bytes[]", encodeDynArr(byteArrays), true)); @@ -305,8 +279,7 @@ public ContractFunctionParameters addBytes4(byte[] param) { * @throws IllegalArgumentException if the length of any byte array is not 4. */ public ContractFunctionParameters addBytes4Array(byte[][] param) { - Stream byteArrays = Arrays.stream(param) - .map(ContractFunctionParameters::encodeBytes4); + Stream byteArrays = Arrays.stream(param).map(ContractFunctionParameters::encodeBytes4); args.add(new Argument("bytes4[]", encodeArray(byteArrays), true)); @@ -339,8 +312,7 @@ public ContractFunctionParameters addBytes32(byte[] param) { */ public ContractFunctionParameters addBytes32Array(byte[][] param) { // array of fixed-size elements - Stream byteArrays = Arrays.stream(param) - .map(ContractFunctionParameters::encodeBytes32); + Stream byteArrays = Arrays.stream(param).map(ContractFunctionParameters::encodeBytes32); args.add(new Argument("bytes32[]", encodeArray(byteArrays), true)); @@ -371,8 +343,7 @@ public ContractFunctionParameters addBoolArray(boolean[] param) { boolWrapperArray[i] = param[i]; } - Stream bools = Arrays.stream(boolWrapperArray) - .map(ContractFunctionParameters::encodeBool); + Stream bools = Arrays.stream(boolWrapperArray).map(ContractFunctionParameters::encodeBool); args.add(new Argument("bool[]", encodeArray(bools), true)); @@ -776,9 +747,8 @@ public ContractFunctionParameters addInt256(BigInteger value) { public ContractFunctionParameters addInt8Array(byte[] intArray) { IntStream intStream = IntStream.range(0, intArray.length).map(idx -> intArray[idx]); - ByteString arrayBytes = ByteString.copyFrom( - intStream.mapToObj(i -> int256(i, 8)) - .collect(Collectors.toList())); + ByteString arrayBytes = + ByteString.copyFrom(intStream.mapToObj(i -> int256(i, 8)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -795,8 +765,7 @@ public ContractFunctionParameters addInt8Array(byte[] intArray) { */ public ContractFunctionParameters addInt16Array(int[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 16)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 16)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -813,8 +782,7 @@ public ContractFunctionParameters addInt16Array(int[] intArray) { */ public ContractFunctionParameters addInt24Array(int[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 24)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 24)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -831,8 +799,7 @@ public ContractFunctionParameters addInt24Array(int[] intArray) { */ public ContractFunctionParameters addInt32Array(int[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 32)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 32)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -849,8 +816,7 @@ public ContractFunctionParameters addInt32Array(int[] intArray) { */ public ContractFunctionParameters addInt40Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 40)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 40)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -867,8 +833,7 @@ public ContractFunctionParameters addInt40Array(long[] intArray) { */ public ContractFunctionParameters addInt48Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 48)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 48)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -885,8 +850,7 @@ public ContractFunctionParameters addInt48Array(long[] intArray) { */ public ContractFunctionParameters addInt56Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 56)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 56)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -903,8 +867,7 @@ public ContractFunctionParameters addInt56Array(long[] intArray) { */ public ContractFunctionParameters addInt64Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> int256(i, 64)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> int256(i, 64)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -921,8 +884,7 @@ public ContractFunctionParameters addInt64Array(long[] intArray) { */ public ContractFunctionParameters addInt72Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 72)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 72)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -939,8 +901,7 @@ public ContractFunctionParameters addInt72Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt80Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 80)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 80)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -957,8 +918,7 @@ public ContractFunctionParameters addInt80Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt88Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 88)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 88)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -975,8 +935,7 @@ public ContractFunctionParameters addInt88Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt96Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 96)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 96)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -993,8 +952,7 @@ public ContractFunctionParameters addInt96Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt104Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 104)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 104)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1011,8 +969,7 @@ public ContractFunctionParameters addInt104Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt112Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 112)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 112)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1029,8 +986,7 @@ public ContractFunctionParameters addInt112Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt120Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 120)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 120)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1047,8 +1003,7 @@ public ContractFunctionParameters addInt120Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt128Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 128)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 128)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1065,8 +1020,7 @@ public ContractFunctionParameters addInt128Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt136Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 136)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 136)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1083,8 +1037,7 @@ public ContractFunctionParameters addInt136Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt144Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 144)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 144)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1101,8 +1054,7 @@ public ContractFunctionParameters addInt144Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt152Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 152)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 152)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1119,8 +1071,7 @@ public ContractFunctionParameters addInt152Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt160Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 160)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 160)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1137,8 +1088,7 @@ public ContractFunctionParameters addInt160Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt168Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 168)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 168)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1155,8 +1105,7 @@ public ContractFunctionParameters addInt168Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt176Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 176)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 176)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1173,8 +1122,7 @@ public ContractFunctionParameters addInt176Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt184Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 184)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 184)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1191,8 +1139,7 @@ public ContractFunctionParameters addInt184Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt192Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 192)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 192)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1209,8 +1156,7 @@ public ContractFunctionParameters addInt192Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt200Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 200)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 200)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1227,8 +1173,7 @@ public ContractFunctionParameters addInt200Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt208Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 208)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 208)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1245,8 +1190,7 @@ public ContractFunctionParameters addInt208Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt216Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 216)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 216)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1263,8 +1207,7 @@ public ContractFunctionParameters addInt216Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt224Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 224)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 224)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1281,8 +1224,7 @@ public ContractFunctionParameters addInt224Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt232Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 232)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 232)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1299,8 +1241,7 @@ public ContractFunctionParameters addInt232Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt240Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 240)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 240)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1317,8 +1258,7 @@ public ContractFunctionParameters addInt240Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt248Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 248)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 248)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1335,8 +1275,7 @@ public ContractFunctionParameters addInt248Array(BigInteger[] intArray) { */ public ContractFunctionParameters addInt256Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> int256(i, 256)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> int256(i, 256)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1859,9 +1798,8 @@ public ContractFunctionParameters addUint256(BigInteger value) { public ContractFunctionParameters addUint8Array(byte[] intArray) { IntStream intStream = IntStream.range(0, intArray.length).map(idx -> intArray[idx]); - ByteString arrayBytes = ByteString.copyFrom( - intStream.mapToObj(i -> uint256(i, 8)) - .collect(Collectors.toList())); + ByteString arrayBytes = + ByteString.copyFrom(intStream.mapToObj(i -> uint256(i, 8)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1881,8 +1819,7 @@ public ContractFunctionParameters addUint8Array(byte[] intArray) { */ public ContractFunctionParameters addUint16Array(int[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 16)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 16)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1902,8 +1839,7 @@ public ContractFunctionParameters addUint16Array(int[] intArray) { */ public ContractFunctionParameters addUint24Array(int[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 24)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 24)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1923,8 +1859,7 @@ public ContractFunctionParameters addUint24Array(int[] intArray) { */ public ContractFunctionParameters addUint32Array(int[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 32)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 32)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1944,8 +1879,7 @@ public ContractFunctionParameters addUint32Array(int[] intArray) { */ public ContractFunctionParameters addUint40Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 40)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 40)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1965,8 +1899,7 @@ public ContractFunctionParameters addUint40Array(long[] intArray) { */ public ContractFunctionParameters addUint48Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 48)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 48)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -1986,8 +1919,7 @@ public ContractFunctionParameters addUint48Array(long[] intArray) { */ public ContractFunctionParameters addUint56Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 56)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 56)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2007,8 +1939,7 @@ public ContractFunctionParameters addUint56Array(long[] intArray) { */ public ContractFunctionParameters addUint64Array(long[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).mapToObj(i -> uint256(i, 64)) - .collect(Collectors.toList())); + Arrays.stream(intArray).mapToObj(i -> uint256(i, 64)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2029,8 +1960,7 @@ public ContractFunctionParameters addUint64Array(long[] intArray) { */ public ContractFunctionParameters addUint72Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 72)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 72)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2051,8 +1981,7 @@ public ContractFunctionParameters addUint72Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint80Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 80)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 80)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2073,8 +2002,7 @@ public ContractFunctionParameters addUint80Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint88Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 88)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 88)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2095,8 +2023,7 @@ public ContractFunctionParameters addUint88Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint96Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 96)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 96)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2117,8 +2044,7 @@ public ContractFunctionParameters addUint96Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint104Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 104)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 104)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2139,8 +2065,7 @@ public ContractFunctionParameters addUint104Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint112Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 112)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 112)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2161,8 +2086,7 @@ public ContractFunctionParameters addUint112Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint120Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 120)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 120)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2183,8 +2107,7 @@ public ContractFunctionParameters addUint120Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint128Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 128)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 128)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2205,8 +2128,7 @@ public ContractFunctionParameters addUint128Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint136Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 136)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 136)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2227,8 +2149,7 @@ public ContractFunctionParameters addUint136Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint144Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 144)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 144)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2249,8 +2170,7 @@ public ContractFunctionParameters addUint144Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint152Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 152)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 152)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2271,8 +2191,7 @@ public ContractFunctionParameters addUint152Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint160Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 160)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 160)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2293,8 +2212,7 @@ public ContractFunctionParameters addUint160Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint168Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 168)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 168)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2315,8 +2233,7 @@ public ContractFunctionParameters addUint168Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint176Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 176)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 176)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2337,8 +2254,7 @@ public ContractFunctionParameters addUint176Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint184Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 184)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 184)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2359,8 +2275,7 @@ public ContractFunctionParameters addUint184Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint192Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 192)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 192)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2381,8 +2296,7 @@ public ContractFunctionParameters addUint192Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint200Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 200)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 200)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2403,8 +2317,7 @@ public ContractFunctionParameters addUint200Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint208Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 208)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 208)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2425,8 +2338,7 @@ public ContractFunctionParameters addUint208Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint216Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 216)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 216)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2447,8 +2359,7 @@ public ContractFunctionParameters addUint216Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint224Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 224)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 224)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2469,8 +2380,7 @@ public ContractFunctionParameters addUint224Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint232Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 232)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 232)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2491,8 +2401,7 @@ public ContractFunctionParameters addUint232Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint240Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 240)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 240)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2513,8 +2422,7 @@ public ContractFunctionParameters addUint240Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint248Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 248)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 248)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2535,8 +2443,7 @@ public ContractFunctionParameters addUint248Array(BigInteger[] intArray) { */ public ContractFunctionParameters addUint256Array(BigInteger[] intArray) { ByteString arrayBytes = ByteString.copyFrom( - Arrays.stream(intArray).map(i -> uint256(i, 256)) - .collect(Collectors.toList())); + Arrays.stream(intArray).map(i -> uint256(i, 256)).collect(Collectors.toList())); arrayBytes = uint256(intArray.length, 32).concat(arrayBytes); @@ -2574,11 +2481,10 @@ public ContractFunctionParameters addAddress(String address) { * @throws NullPointerException if any value in the array is null. */ public ContractFunctionParameters addAddressArray(String[] addresses) { - ByteString addressArray = encodeArray( - Arrays.stream(addresses).map(a -> { - byte[] address = decodeAddress(a); - return leftPad32(ByteString.copyFrom(address)); - })); + ByteString addressArray = encodeArray(Arrays.stream(addresses).map(a -> { + byte[] address = decodeAddress(a); + return leftPad32(ByteString.copyFrom(address)); + })); args.add(new Argument("address[]", addressArray, true)); @@ -2651,8 +2557,7 @@ ByteString toBytes(@Nullable String funcName) { var dynamicArgs = new ArrayList(); - ContractFunctionSelector functionSelector = funcName != null - ? new ContractFunctionSelector(funcName) : null; + ContractFunctionSelector functionSelector = funcName != null ? new ContractFunctionSelector(funcName) : null; // iterate the arguments and determine whether they are dynamic or not for (Argument arg : args) { @@ -2681,7 +2586,7 @@ ByteString toBytes(@Nullable String funcName) { return ByteString.copyFrom(paramsBytes); } - private final static class Argument { + private static final class Argument { private final String type; private final ByteString value; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java b/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java index 07bbc959d5..db01756adc 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.esaulpaugh.headlong.abi.Tuple; @@ -32,7 +14,6 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; - import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; @@ -44,7 +25,7 @@ * this Github issue. */ public final class ContractFunctionResult { - private static final ByteString errorPrefix = ByteString.copyFrom(new byte[]{8, -61, 121, -96}); + private static final ByteString errorPrefix = ByteString.copyFrom(new byte[] {8, -61, 121, -96}); /** * The ID of the contract that was invoked. @@ -136,8 +117,12 @@ public final class ContractFunctionResult { ContractFunctionResult(ContractFunctionResultOrBuilder inner) { contractId = ContractId.fromProtobuf(inner.getContractID()); - evmAddress = inner.hasEvmAddress() ? - new ContractId(contractId.shard, contractId.realm, inner.getEvmAddress().getValue().toByteArray()) : null; + evmAddress = inner.hasEvmAddress() + ? new ContractId( + contractId.shard, + contractId.realm, + inner.getEvmAddress().getValue().toByteArray()) + : null; String errMsg = inner.getErrorMessage(); errorMessage = !errMsg.isEmpty() ? errMsg : null; @@ -158,9 +143,13 @@ public final class ContractFunctionResult { gasUsed = inner.getGasUsed(); - logs = inner.getLogInfoList().stream().map(ContractLogInfo::fromProtobuf).collect(Collectors.toList()); + logs = inner.getLogInfoList().stream() + .map(ContractLogInfo::fromProtobuf) + .collect(Collectors.toList()); - createdContractIds = inner.getCreatedContractIDsList().stream().map(ContractId::fromProtobuf).collect(Collectors.toList()); + createdContractIds = inner.getCreatedContractIDsList().stream() + .map(ContractId::fromProtobuf) + .collect(Collectors.toList()); stateChanges = new ArrayList(); // for (var stateChangeProto : inner.getStateChangesList()) { @@ -175,7 +164,9 @@ public final class ContractFunctionResult { senderAccountId = inner.hasSenderId() ? AccountId.fromProtobuf(inner.getSenderId()) : null; - contractNonces = inner.getContractNoncesList().stream().map(ContractNonceInfo::fromProtobuf).collect(Collectors.toList()); + contractNonces = inner.getContractNoncesList().stream() + .map(ContractNonceInfo::fromProtobuf) + .collect(Collectors.toList()); signerNonce = inner.getSignerNonce().getValue(); } @@ -213,7 +204,8 @@ public List getStringArray(int index) { for (int i = 0; i < count; i++) { var strOffset = getIntValueAt(offset + 32 + (i * 32)); var len = getIntValueAt(offset + strOffset + 32); - var str = getByteString(offset + strOffset + 32 + 32, offset + strOffset + 32 + 32 + len).toStringUtf8(); + var str = getByteString(offset + strOffset + 32 + 32, offset + strOffset + 32 + 32 + len) + .toStringUtf8(); strings.add(str); } @@ -428,17 +420,16 @@ private ByteString getByteString(int startIndex, int endIndex) { */ com.hiero.sdk.proto.ContractFunctionResult toProtobuf() { var contractFunctionResult = com.hiero.sdk.proto.ContractFunctionResult.newBuilder() - .setContractID(contractId.toProtobuf()) - .setContractCallResult(rawResult) - .setBloom(bloom) - .setGasUsed(gasUsed) - .setSignerNonce(Int64Value.of(this.signerNonce)); + .setContractID(contractId.toProtobuf()) + .setContractCallResult(rawResult) + .setBloom(bloom) + .setGasUsed(gasUsed) + .setSignerNonce(Int64Value.of(this.signerNonce)); if (evmAddress != null) { contractFunctionResult.setEvmAddress(BytesValue.newBuilder() - .setValue(ByteString.copyFrom(Objects.requireNonNull(evmAddress.evmAddress))) - .build() - ); + .setValue(ByteString.copyFrom(Objects.requireNonNull(evmAddress.evmAddress))) + .build()); } if (errorMessage != null) { @@ -471,22 +462,22 @@ com.hiero.sdk.proto.ContractFunctionResult toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("contractId", contractId) - .add("evmAddress", evmAddress) - .add("errorMessage", errorMessage) - .add("bloom", Hex.toHexString(bloom.toByteArray())) - .add("gasUsed", gasUsed) - .add("logs", logs) - .add("createdContractIds", createdContractIds) - .add("stateChanges", stateChanges) - .add("gas", gas) - .add("hbarAmount", hbarAmount) - .add("contractFunctionparametersBytes", Hex.toHexString(contractFunctionParametersBytes)) - .add("rawResult", Hex.toHexString(rawResult.toByteArray())) - .add("senderAccountId", senderAccountId) - .add("contractNonces", contractNonces) - .add("signerNonce", signerNonce) - .toString(); + .add("contractId", contractId) + .add("evmAddress", evmAddress) + .add("errorMessage", errorMessage) + .add("bloom", Hex.toHexString(bloom.toByteArray())) + .add("gasUsed", gasUsed) + .add("logs", logs) + .add("createdContractIds", createdContractIds) + .add("stateChanges", stateChanges) + .add("gas", gas) + .add("hbarAmount", hbarAmount) + .add("contractFunctionparametersBytes", Hex.toHexString(contractFunctionParametersBytes)) + .add("rawResult", Hex.toHexString(rawResult.toByteArray())) + .add("senderAccountId", senderAccountId) + .add("contractNonces", contractNonces) + .add("signerNonce", signerNonce) + .toString(); } public Tuple getResult(String types) { diff --git a/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java b/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java index 44eae35cbf..e6018191ae 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java @@ -1,31 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import org.bouncycastle.jcajce.provider.digest.Keccak; +import static java.nio.charset.StandardCharsets.US_ASCII; -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Objects; - -import static java.nio.charset.StandardCharsets.US_ASCII; +import javax.annotation.Nullable; +import org.bouncycastle.jcajce.provider.digest.Keccak; /** * Builder class for Solidity function selectors. diff --git a/sdk/src/main/java/com/hiero/sdk/ContractId.java b/sdk/src/main/java/com/hiero/sdk/ContractId.java index 396162501f..9096d97754 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractId.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractId.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -118,10 +100,7 @@ public static ContractId fromString(String id) { var match = EVM_ADDRESS_REGEX.matcher(id); if (match.find()) { return new ContractId( - Long.parseLong(match.group(1)), - Long.parseLong(match.group(2)), - Hex.decode(match.group(3)) - ); + Long.parseLong(match.group(1)), Long.parseLong(match.group(2)), Hex.decode(match.group(3))); } else { return EntityIdHelper.fromString(id, ContractId::new); } @@ -151,10 +130,7 @@ public static ContractId fromSolidityAddress(String address) { */ public static ContractId fromEvmAddress(@Nonnegative long shard, @Nonnegative long realm, String evmAddress) { return new ContractId( - shard, - realm, - Hex.decode(evmAddress.startsWith("0x") ? evmAddress.substring(2) : evmAddress) - ); + shard, realm, Hex.decode(evmAddress.startsWith("0x") ? evmAddress.substring(2) : evmAddress)); } /** @@ -167,10 +143,9 @@ static ContractId fromProtobuf(ContractID contractId) { Objects.requireNonNull(contractId); if (contractId.hasEvmAddress()) { return new ContractId( - contractId.getShardNum(), - contractId.getRealmNum(), - contractId.getEvmAddress().toByteArray() - ); + contractId.getShardNum(), + contractId.getRealmNum(), + contractId.getEvmAddress().toByteArray()); } else { return new ContractId(contractId.getShardNum(), contractId.getRealmNum(), contractId.getContractNum()); } @@ -206,9 +181,7 @@ public String toSolidityAddress() { * @return the protobuf object */ ContractID toProtobuf() { - var builder = ContractID.newBuilder() - .setShardNum(shard) - .setRealmNum(realm); + var builder = ContractID.newBuilder().setShardNum(shard).setRealmNum(realm); if (evmAddress != null) { builder.setEvmAddress(ByteString.copyFrom(evmAddress)); } else { @@ -245,8 +218,8 @@ public CompletableFuture populateContractNumAsync(Client client) { EvmAddress address = new EvmAddress(this.evmAddress); return EntityIdHelper.getContractNumFromMirrorNodeAsync(client, address.toString()) - .thenApply(contractNumFromMirrorNode -> - new ContractId(this.shard, this.realm, contractNumFromMirrorNode, checksum)); + .thenApply(contractNumFromMirrorNode -> + new ContractId(this.shard, this.realm, contractNumFromMirrorNode, checksum)); } /** @@ -281,9 +254,7 @@ public String getChecksum() { @Override com.hiero.sdk.proto.Key toProtobufKey() { - return com.hiero.sdk.proto.Key.newBuilder() - .setContractID(toProtobuf()) - .build(); + return com.hiero.sdk.proto.Key.newBuilder().setContractID(toProtobuf()).build(); } @Override @@ -320,7 +291,7 @@ public int hashCode() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractInfo.java b/sdk/src/main/java/com/hiero/sdk/ContractInfo.java index 001e142024..c6f049319b 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractInfo.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -24,10 +6,9 @@ import com.hiero.sdk.proto.ContractGetInfoResponse; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; +import javax.annotation.Nullable; /** * Current information on the smart contract instance, including its balance. @@ -136,21 +117,20 @@ public final class ContractInfo { * @param ledgerId the ledger id */ private ContractInfo( - ContractId contractId, - AccountId accountId, - String contractAccountId, - @Nullable Key adminKey, - Instant expirationTime, - Duration autoRenewPeriod, - @Nullable AccountId autoRenewAccountId, - long storage, - String contractMemo, - Hbar balance, - boolean isDeleted, - Map tokenRelationships, - LedgerId ledgerId, - @Nullable StakingInfo stakingInfo - ) { + ContractId contractId, + AccountId accountId, + String contractAccountId, + @Nullable Key adminKey, + Instant expirationTime, + Duration autoRenewPeriod, + @Nullable AccountId autoRenewAccountId, + long storage, + String contractMemo, + Hbar balance, + boolean isDeleted, + Map tokenRelationships, + LedgerId ledgerId, + @Nullable StakingInfo stakingInfo) { this.contractId = contractId; this.accountId = accountId; this.contractAccountId = contractAccountId; @@ -174,35 +154,32 @@ private ContractInfo( * @return the contract object */ static ContractInfo fromProtobuf(ContractGetInfoResponse.ContractInfo contractInfo) { - var adminKey = contractInfo.hasAdminKey() - ? Key.fromProtobufKey(contractInfo.getAdminKey()) - : null; + var adminKey = contractInfo.hasAdminKey() ? Key.fromProtobufKey(contractInfo.getAdminKey()) : null; var tokenRelationships = new HashMap(contractInfo.getTokenRelationshipsCount()); for (var relationship : contractInfo.getTokenRelationshipsList()) { tokenRelationships.put( - TokenId.fromProtobuf(relationship.getTokenId()), - TokenRelationship.fromProtobuf(relationship) - ); + TokenId.fromProtobuf(relationship.getTokenId()), TokenRelationship.fromProtobuf(relationship)); } return new ContractInfo( - ContractId.fromProtobuf(contractInfo.getContractID()), - AccountId.fromProtobuf(contractInfo.getAccountID()), - contractInfo.getContractAccountID(), - adminKey, - InstantConverter.fromProtobuf(contractInfo.getExpirationTime()), - DurationConverter.fromProtobuf(contractInfo.getAutoRenewPeriod()), - contractInfo.hasAutoRenewAccountId() ? AccountId.fromProtobuf(contractInfo.getAutoRenewAccountId()) : null, - contractInfo.getStorage(), - contractInfo.getMemo(), - Hbar.fromTinybars(contractInfo.getBalance()), - contractInfo.getDeleted(), - tokenRelationships, - LedgerId.fromByteString(contractInfo.getLedgerId()), - contractInfo.hasStakingInfo() ? StakingInfo.fromProtobuf(contractInfo.getStakingInfo()) : null - ); + ContractId.fromProtobuf(contractInfo.getContractID()), + AccountId.fromProtobuf(contractInfo.getAccountID()), + contractInfo.getContractAccountID(), + adminKey, + InstantConverter.fromProtobuf(contractInfo.getExpirationTime()), + DurationConverter.fromProtobuf(contractInfo.getAutoRenewPeriod()), + contractInfo.hasAutoRenewAccountId() + ? AccountId.fromProtobuf(contractInfo.getAutoRenewAccountId()) + : null, + contractInfo.getStorage(), + contractInfo.getMemo(), + Hbar.fromTinybars(contractInfo.getBalance()), + contractInfo.getDeleted(), + tokenRelationships, + LedgerId.fromByteString(contractInfo.getLedgerId()), + contractInfo.hasStakingInfo() ? StakingInfo.fromProtobuf(contractInfo.getStakingInfo()) : null); } /** @@ -213,7 +190,8 @@ static ContractInfo fromProtobuf(ContractGetInfoResponse.ContractInfo contractIn * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static ContractInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(ContractGetInfoResponse.ContractInfo.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(ContractGetInfoResponse.ContractInfo.parseFrom(bytes).toBuilder() + .build()); } /** @@ -223,15 +201,15 @@ public static ContractInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferE */ ContractGetInfoResponse.ContractInfo toProtobuf() { var contractInfoBuilder = ContractGetInfoResponse.ContractInfo.newBuilder() - .setContractID(contractId.toProtobuf()) - .setAccountID(accountId.toProtobuf()) - .setContractAccountID(contractAccountId) - .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) - .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) - .setStorage(storage) - .setMemo(contractMemo) - .setBalance(balance.toTinybars()) - .setLedgerId(ledgerId.toByteString()); + .setContractID(contractId.toProtobuf()) + .setAccountID(accountId.toProtobuf()) + .setContractAccountID(contractAccountId) + .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) + .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) + .setStorage(storage) + .setMemo(contractMemo) + .setBalance(balance.toTinybars()) + .setLedgerId(ledgerId.toByteString()); if (adminKey != null) { contractInfoBuilder.setAdminKey(adminKey.toProtobufKey()); @@ -251,21 +229,21 @@ ContractGetInfoResponse.ContractInfo toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("contractId", contractId) - .add("accountId", accountId) - .add("contractAccountId", contractAccountId) - .add("adminKey", adminKey) - .add("expirationTime", expirationTime) - .add("autoRenewPeriod", autoRenewPeriod) - .add("autoRenewAccountId", autoRenewAccountId) - .add("storage", storage) - .add("contractMemo", contractMemo) - .add("balance", balance) - .add("isDeleted", isDeleted) - .add("tokenRelationships", tokenRelationships) - .add("ledgerId", ledgerId) - .add("stakingInfo", stakingInfo) - .toString(); + .add("contractId", contractId) + .add("accountId", accountId) + .add("contractAccountId", contractAccountId) + .add("adminKey", adminKey) + .add("expirationTime", expirationTime) + .add("autoRenewPeriod", autoRenewPeriod) + .add("autoRenewAccountId", autoRenewAccountId) + .add("storage", storage) + .add("contractMemo", contractMemo) + .add("balance", balance) + .add("isDeleted", isDeleted) + .add("tokenRelationships", tokenRelationships) + .add("ledgerId", ledgerId) + .add("stakingInfo", stakingInfo) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java index cb2c19ecb3..e8a47aa86a 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.ContractGetInfoQuery; @@ -42,8 +24,7 @@ public final class ContractInfoQuery extends Query(); @@ -132,8 +112,6 @@ public String toString() { topicList.add(Hex.toHexString(topic.toByteArray())); } - return stringHelper - .add("topics", topicList) - .toString(); + return stringHelper.add("topics", topicList).toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractNonceInfo.java b/sdk/src/main/java/com/hiero/sdk/ContractNonceInfo.java index 34ec5d4d7e..95062c2d26 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractNonceInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractNonceInfo.java @@ -1,27 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; - import java.util.Objects; /** @@ -39,10 +20,7 @@ public final class ContractNonceInfo { */ public final Long nonce; - public ContractNonceInfo( - ContractId contractId, - Long nonce - ) { + public ContractNonceInfo(ContractId contractId, Long nonce) { this.contractId = contractId; this.nonce = nonce; } @@ -55,9 +33,7 @@ public ContractNonceInfo( */ static ContractNonceInfo fromProtobuf(com.hiero.sdk.proto.ContractNonceInfo contractNonceInfo) { return new ContractNonceInfo( - ContractId.fromProtobuf(contractNonceInfo.getContractId()), - contractNonceInfo.getNonce() - ); + ContractId.fromProtobuf(contractNonceInfo.getContractId()), contractNonceInfo.getNonce()); } /** @@ -68,7 +44,8 @@ static ContractNonceInfo fromProtobuf(com.hiero.sdk.proto.ContractNonceInfo cont * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static ContractNonceInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.ContractNonceInfo.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.ContractNonceInfo.parseFrom(bytes).toBuilder() + .build()); } /** @@ -78,9 +55,9 @@ public static ContractNonceInfo fromBytes(byte[] bytes) throws InvalidProtocolBu */ com.hiero.sdk.proto.ContractNonceInfo toProtobuf() { return com.hiero.sdk.proto.ContractNonceInfo.newBuilder() - .setContractId(contractId.toProtobuf()) - .setNonce(nonce) - .build(); + .setContractId(contractId.toProtobuf()) + .setNonce(nonce) + .build(); } @Override @@ -104,9 +81,9 @@ public boolean equals(Object o) { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("contractId", contractId) - .add("nonce", nonce) - .toString(); + .add("contractId", contractId) + .add("nonce", nonce) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/ContractStateChange.java b/sdk/src/main/java/com/hiero/sdk/ContractStateChange.java index ac638a2c08..9453b69fd8 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractStateChange.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractStateChange.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.google.protobuf.InvalidProtocolBufferException; - -import java.util.ArrayList; import java.util.List; /** diff --git a/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java index 4ecf236b7b..216061caa7 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.BoolValue; @@ -31,10 +13,9 @@ import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Modify a smart contract instance to have the given parameter values. @@ -62,18 +43,25 @@ public final class ContractUpdateTransaction extends Transaction { @Nullable private ContractId contractId = null; + @Nullable private AccountId proxyAccountId = null; + @Nullable private FileId bytecodeFileId = null; + @Nullable private Instant expirationTime = null; + @Nullable private Key adminKey = null; + @Nullable private Integer maxAutomaticTokenAssociations = null; + @Nullable private Duration autoRenewPeriod = null; + @Nullable private String contractMemo = null; @@ -92,8 +80,7 @@ public final class ContractUpdateTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + ContractUpdateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -480,7 +469,8 @@ void initFromTransactionBody() { adminKey = Key.fromProtobufKey(body.getAdminKey()); } if (body.hasMaxAutomaticTokenAssociations()) { - maxAutomaticTokenAssociations = body.getMaxAutomaticTokenAssociations().getValue(); + maxAutomaticTokenAssociations = + body.getMaxAutomaticTokenAssociations().getValue(); } if (body.hasAutoRenewPeriod()) { autoRenewPeriod = DurationConverter.fromProtobuf(body.getAutoRenewPeriod()); @@ -544,7 +534,8 @@ ContractUpdateTransactionBody.Builder build() { } if (declineStakingReward != null) { - builder.setDeclineReward(BoolValue.newBuilder().setValue(declineStakingReward).build()); + builder.setDeclineReward( + BoolValue.newBuilder().setValue(declineStakingReward).build()); } if (autoRenewAccountId != null) { diff --git a/sdk/src/main/java/com/hiero/sdk/Crypto.java b/sdk/src/main/java/com/hiero/sdk/Crypto.java index 797f518cd8..cf9f37be6b 100644 --- a/sdk/src/main/java/com/hiero/sdk/Crypto.java +++ b/sdk/src/main/java/com/hiero/sdk/Crypto.java @@ -1,24 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.AlgorithmParameters; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import javax.annotation.Nullable; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; import org.bouncycastle.asn1.sec.SECNamedCurves; import org.bouncycastle.asn1.x9.X9ECParameters; import org.bouncycastle.asn1.x9.X9IntegerConverter; @@ -32,21 +28,6 @@ import org.bouncycastle.math.ec.ECAlgorithms; import org.bouncycastle.math.ec.ECPoint; -import javax.annotation.Nullable; -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.ShortBufferException; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import java.math.BigInteger; -import java.nio.charset.StandardCharsets; -import java.security.AlgorithmParameters; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; - /** * Utility class used internally by the sdk. */ @@ -61,16 +42,15 @@ final class Crypto { static final X9ECParameters ECDSA_SECP256K1_CURVE = SECNamedCurves.getByName("secp256k1"); static final ECDomainParameters ECDSA_SECP256K1_DOMAIN = new ECDomainParameters( - ECDSA_SECP256K1_CURVE.getCurve(), - ECDSA_SECP256K1_CURVE.getG(), - ECDSA_SECP256K1_CURVE.getN(), - ECDSA_SECP256K1_CURVE.getH()); + ECDSA_SECP256K1_CURVE.getCurve(), + ECDSA_SECP256K1_CURVE.getG(), + ECDSA_SECP256K1_CURVE.getN(), + ECDSA_SECP256K1_CURVE.getH()); /** * Constructor. */ - private Crypto() { - } + private Crypto() {} /** * Derive a sha 256 key. @@ -169,8 +149,7 @@ private static Cipher initAesCipher(Cipher aesCipher, KeyParameter cipherKey, by int mode = forDecrypt ? Cipher.DECRYPT_MODE : Cipher.ENCRYPT_MODE; try { - aesCipher.init(mode, new SecretKeySpec(cipherKey.getKey(), 0, 16, "AES"), - new IvParameterSpec(iv)); + aesCipher.init(mode, new SecretKeySpec(cipherKey.getKey(), 0, 16, "AES"), new IvParameterSpec(iv)); } catch (InvalidKeyException e) { throw new Error("platform does not support AES-128 ciphers", e); } catch (InvalidAlgorithmParameterException e) { @@ -328,7 +307,7 @@ static byte[] recoverPublicKeyECDSAFromSignature(int recId, BigInteger r, BigInt private static ECPoint decompressKey(BigInteger xBN, boolean yBit) { var X_9_INTEGER_CONVERTER = new X9IntegerConverter(); byte[] compEnc = X_9_INTEGER_CONVERTER.integerToBytes( - xBN, 1 + X_9_INTEGER_CONVERTER.getByteLength(ECDSA_SECP256K1_DOMAIN.getCurve())); + xBN, 1 + X_9_INTEGER_CONVERTER.getByteLength(ECDSA_SECP256K1_DOMAIN.getCurve())); compEnc[0] = (byte) (yBit ? 0x03 : 0x02); try { return ECDSA_SECP256K1_DOMAIN.getCurve().decodePoint(compEnc); diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFee.java b/sdk/src/main/java/com/hiero/sdk/CustomFee.java index c7e5269805..fc050a79ae 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFee.java @@ -1,36 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -import java.util.Objects; +import javax.annotation.Nullable; /** * Base class for custom fees. */ -abstract public class CustomFee { +public abstract class CustomFee { /** * The account to receive the custom fee */ @@ -45,8 +25,7 @@ abstract public class CustomFee { /** * Constructor. */ - CustomFee() { - } + CustomFee() {} /** * Convert the protobuf object to a custom fee object. @@ -66,7 +45,8 @@ static CustomFee fromProtobufInner(com.hiero.sdk.proto.CustomFee customFee) { return CustomRoyaltyFee.fromProtobuf(customFee.getRoyaltyFee()); default: - throw new IllegalStateException("CustomFee#fromProtobuf: unhandled fee case: " + customFee.getFeeCase()); + throw new IllegalStateException( + "CustomFee#fromProtobuf: unhandled fee case: " + customFee.getFeeCase()); } } @@ -88,7 +68,8 @@ static CustomFee fromProtobuf(com.hiero.sdk.proto.CustomFee customFee) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static CustomFee fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.CustomFee.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.CustomFee.parseFrom(bytes).toBuilder().build()); } /** @@ -179,7 +160,7 @@ public byte[] toBytes() { */ protected MoreObjects.ToStringHelper toStringHelper() { return MoreObjects.toStringHelper(this) - .add("feeCollectorAccountId", feeCollectorAccountId) - .add("allCollectorsAreExempt", allCollectorsAreExempt); + .add("feeCollectorAccountId", feeCollectorAccountId) + .add("allCollectorsAreExempt", allCollectorsAreExempt); } } diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java b/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java index ed7f9145ef..9342bec1ec 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java @@ -1,27 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.Objects; -abstract class CustomFeeBase > extends CustomFee { +abstract class CustomFeeBase> extends CustomFee { /** * Assign the fee collector account id. diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java b/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java index e1160e9d42..ac0cbcb8bd 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java @@ -1,27 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.google.common.base.MoreObjects; import com.hiero.sdk.proto.FixedFee; - import javax.annotation.Nullable; /** @@ -39,8 +19,7 @@ public class CustomFixedFee extends CustomFeeBase { /** * Constructor. */ - public CustomFixedFee() { - } + public CustomFixedFee() {} /** * Create a custom fixed fee from a fixed fee protobuf. @@ -49,8 +28,7 @@ public CustomFixedFee() { * @return the new custom fixed fee object */ static CustomFixedFee fromProtobuf(FixedFee fixedFee) { - var returnFee = new CustomFixedFee() - .setAmount(fixedFee.getAmount()); + var returnFee = new CustomFixedFee().setAmount(fixedFee.getAmount()); if (fixedFee.hasDenominatingTokenId()) { returnFee.setDenominatingTokenId(TokenId.fromProtobuf(fixedFee.getDenominatingTokenId())); } @@ -60,9 +38,9 @@ static CustomFixedFee fromProtobuf(FixedFee fixedFee) { @Override CustomFixedFee deepCloneSubclass() { return new CustomFixedFee() - .setAmount(amount) - .setDenominatingTokenId(denominatingTokenId) - .finishDeepClone(this); + .setAmount(amount) + .setDenominatingTokenId(denominatingTokenId) + .finishDeepClone(this); } /** @@ -148,9 +126,9 @@ void validateChecksums(Client client) throws BadEntityIdException { @Override public String toString() { return toStringHelper() - .add("amount", getAmount()) - .add("demoninatingTokenId", getDenominatingTokenId()) - .toString(); + .add("amount", getAmount()) + .add("demoninatingTokenId", getDenominatingTokenId()) + .toString(); } /** @@ -159,8 +137,7 @@ public String toString() { * @return the protobuf converted object */ FixedFee toFixedFeeProtobuf() { - var fixedFeeBuilder = FixedFee.newBuilder() - .setAmount(getAmount()); + var fixedFeeBuilder = FixedFee.newBuilder().setAmount(getAmount()); if (getDenominatingTokenId() != null) { fixedFeeBuilder.setDenominatingTokenId(getDenominatingTokenId().toProtobuf()); } @@ -169,8 +146,7 @@ FixedFee toFixedFeeProtobuf() { @Override com.hiero.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder() - .setFixedFee(toFixedFeeProtobuf()); + var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder().setFixedFee(toFixedFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } } diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java b/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java index e88e632135..6481db15c2 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java @@ -1,27 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Fraction; import com.hiero.sdk.proto.FractionalFee; - import java.util.Objects; /** @@ -38,8 +19,7 @@ public class CustomFractionalFee extends CustomFeeBase { /** * Constructor. */ - public CustomFractionalFee() { - } + public CustomFractionalFee() {} /** * Create a custom fractional fee from a fee protobuf. @@ -50,22 +30,22 @@ public CustomFractionalFee() { static CustomFractionalFee fromProtobuf(FractionalFee fractionalFee) { var fraction = fractionalFee.getFractionalAmount(); return new CustomFractionalFee() - .setNumerator(fraction.getNumerator()) - .setDenominator(fraction.getDenominator()) - .setMin(fractionalFee.getMinimumAmount()) - .setMax(fractionalFee.getMaximumAmount()) - .setAssessmentMethod(FeeAssessmentMethod.valueOf(fractionalFee.getNetOfTransfers())); + .setNumerator(fraction.getNumerator()) + .setDenominator(fraction.getDenominator()) + .setMin(fractionalFee.getMinimumAmount()) + .setMax(fractionalFee.getMaximumAmount()) + .setAssessmentMethod(FeeAssessmentMethod.valueOf(fractionalFee.getNetOfTransfers())); } @Override CustomFractionalFee deepCloneSubclass() { return new CustomFractionalFee() - .setNumerator(numerator) - .setDenominator(denominator) - .setMin(min) - .setMax(max) - .setAssessmentMethod(assessmentMethod) - .finishDeepClone(this); + .setNumerator(numerator) + .setDenominator(denominator) + .setMin(min) + .setMax(max) + .setAssessmentMethod(assessmentMethod) + .finishDeepClone(this); } /** @@ -180,12 +160,12 @@ public CustomFractionalFee setAssessmentMethod(FeeAssessmentMethod assessmentMet @Override public String toString() { return toStringHelper() - .add("numerator", getNumerator()) - .add("denominator", getDenominator()) - .add("min", getMin()) - .add("max", getMax()) - .add("assessmentMethod", getAssessmentMethod()) - .toString(); + .add("numerator", getNumerator()) + .add("denominator", getDenominator()) + .add("min", getMin()) + .add("max", getMax()) + .add("assessmentMethod", getAssessmentMethod()) + .toString(); } /** @@ -195,21 +175,17 @@ public String toString() { */ FractionalFee toFractionalFeeProtobuf() { return FractionalFee.newBuilder() - .setMinimumAmount(getMin()) - .setMaximumAmount(getMax()) - .setFractionalAmount( - Fraction.newBuilder() - .setNumerator(getNumerator()) - .setDenominator(getDenominator()) - ) - .setNetOfTransfers(assessmentMethod.code) - .build(); + .setMinimumAmount(getMin()) + .setMaximumAmount(getMax()) + .setFractionalAmount( + Fraction.newBuilder().setNumerator(getNumerator()).setDenominator(getDenominator())) + .setNetOfTransfers(assessmentMethod.code) + .build(); } @Override com.hiero.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder() - .setFractionalFee(toFractionalFeeProtobuf()); + var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder().setFractionalFee(toFractionalFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } } diff --git a/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java b/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java index 5cc19721a4..9b4ca8ffbf 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java +++ b/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java @@ -1,30 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.google.common.base.MoreObjects; import com.hiero.sdk.proto.Fraction; import com.hiero.sdk.proto.RoyaltyFee; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * Custom royalty fee utility class. @@ -33,14 +13,14 @@ public class CustomRoyaltyFee extends CustomFeeBase { private long numerator = 0; private long denominator = 1; + @Nullable private CustomFixedFee fallbackFee = null; /** * Constructor. */ - public CustomRoyaltyFee() { - } + public CustomRoyaltyFee() {} /** * Create a custom royalty fee from a royalty fee protobuf. @@ -50,9 +30,8 @@ public CustomRoyaltyFee() { */ static CustomRoyaltyFee fromProtobuf(RoyaltyFee royaltyFee) { var fraction = royaltyFee.getExchangeValueFraction(); - var returnFee = new CustomRoyaltyFee() - .setNumerator(fraction.getNumerator()) - .setDenominator(fraction.getDenominator()); + var returnFee = + new CustomRoyaltyFee().setNumerator(fraction.getNumerator()).setDenominator(fraction.getDenominator()); if (royaltyFee.hasFallbackFee()) { returnFee.fallbackFee = CustomFixedFee.fromProtobuf(royaltyFee.getFallbackFee()); } @@ -68,7 +47,6 @@ CustomRoyaltyFee deepCloneSubclass() { returnFee.feeCollectorAccountId = feeCollectorAccountId; returnFee.allCollectorsAreExempt = allCollectorsAreExempt; return returnFee; - } /** @@ -141,11 +119,8 @@ public CustomFixedFee getFallbackFee() { */ RoyaltyFee toRoyaltyFeeProtobuf() { var royaltyFeeBuilder = RoyaltyFee.newBuilder() - .setExchangeValueFraction( - Fraction.newBuilder() - .setNumerator(numerator) - .setDenominator(denominator) - ); + .setExchangeValueFraction( + Fraction.newBuilder().setNumerator(numerator).setDenominator(denominator)); if (fallbackFee != null) { royaltyFeeBuilder.setFallbackFee(fallbackFee.toFixedFeeProtobuf()); } @@ -154,17 +129,16 @@ RoyaltyFee toRoyaltyFeeProtobuf() { @Override com.hiero.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder() - .setRoyaltyFee(toRoyaltyFeeProtobuf()); + var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder().setRoyaltyFee(toRoyaltyFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } @Override public String toString() { return toStringHelper() - .add("numerator", numerator) - .add("denominator", denominator) - .add("fallbackFee", fallbackFee) - .toString(); + .add("numerator", numerator) + .add("denominator", denominator) + .add("fallbackFee", fallbackFee) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/Delayer.java b/sdk/src/main/java/com/hiero/sdk/Delayer.java index 32d33913b7..55fb8b968f 100644 --- a/sdk/src/main/java/com/hiero/sdk/Delayer.java +++ b/sdk/src/main/java/com/hiero/sdk/Delayer.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.time.Duration; @@ -28,6 +10,7 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + /** * Utility class used internally by the sdk. */ @@ -45,8 +28,7 @@ final class Delayer { /** * Constructor. */ - private Delayer() { - } + private Delayer() {} /** * Set the delay backoff attempts. @@ -71,10 +53,7 @@ static CompletableFuture delayBackOff(int attempt, Executor executor) { static CompletableFuture delayFor(long milliseconds, Executor executor) { logger.trace("waiting for {} seconds before trying again", (double) milliseconds / 1000.0); - return CompletableFuture.runAsync( - () -> { - }, - delayedExecutor(milliseconds, TimeUnit.MILLISECONDS, executor)); + return CompletableFuture.runAsync(() -> {}, delayedExecutor(milliseconds, TimeUnit.MILLISECONDS, executor)); } private static Executor delayedExecutor(long delay, TimeUnit unit, Executor executor) { diff --git a/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java b/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java index 561a4fe828..f3dca902f4 100644 --- a/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java +++ b/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java @@ -1,29 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.ContractID; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * The ID for a smart contract instance on Hedera. @@ -106,12 +87,12 @@ public static DelegateContractId fromBytes(byte[] bytes) throws InvalidProtocolB @Override com.hiero.sdk.proto.Key toProtobufKey() { return com.hiero.sdk.proto.Key.newBuilder() - .setDelegatableContractId(toProtobuf()) - .build(); + .setDelegatableContractId(toProtobuf()) + .build(); } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } @@ -125,7 +106,5 @@ public boolean equals( Object o) { } else { return false; } - } } - diff --git a/sdk/src/main/java/com/hiero/sdk/DurationConverter.java b/sdk/src/main/java/com/hiero/sdk/DurationConverter.java index 3a642b52d1..a2d78b88d3 100644 --- a/sdk/src/main/java/com/hiero/sdk/DurationConverter.java +++ b/sdk/src/main/java/com/hiero/sdk/DurationConverter.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.time.Duration; @@ -25,8 +7,7 @@ * Utility class used internally by the sdk. */ final class DurationConverter { - private DurationConverter() { - } + private DurationConverter() {} /** * Create a duration object from a protobuf. @@ -46,7 +27,7 @@ static Duration fromProtobuf(com.hiero.sdk.proto.Duration duration) { */ static com.hiero.sdk.proto.Duration toProtobuf(Duration duration) { return com.hiero.sdk.proto.Duration.newBuilder() - .setSeconds(duration.getSeconds()) - .build(); + .setSeconds(duration.getSeconds()) + .build(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/Endpoint.java b/sdk/src/main/java/com/hiero/sdk/Endpoint.java index 999ec24a3c..040660c822 100644 --- a/sdk/src/main/java/com/hiero/sdk/Endpoint.java +++ b/sdk/src/main/java/com/hiero/sdk/Endpoint.java @@ -1,30 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.hiero.sdk.proto.ServiceEndpoint; - -import java.util.Arrays; import javax.annotation.Nullable; -import java.util.Objects; /** * Utility class used internally by the sdk. @@ -41,8 +20,7 @@ public class Endpoint implements Cloneable { /** * Constructor. */ - public Endpoint() { - } + public Endpoint() {} /** * Create an endpoint object from a service endpoint protobuf. @@ -54,9 +32,9 @@ static Endpoint fromProtobuf(ServiceEndpoint serviceEndpoint) { var port = (int) (serviceEndpoint.getPort() & 0x00000000ffffffffL); return new Endpoint() - .setAddress(serviceEndpoint.getIpAddressV4().toByteArray()) - .setPort(port) - .setDomainName(serviceEndpoint.getDomainName()); + .setAddress(serviceEndpoint.getIpAddressV4().toByteArray()) + .setPort(port) + .setDomainName(serviceEndpoint.getDomainName()); } /** @@ -142,9 +120,10 @@ public String toString() { if (this.domainName != null && !this.domainName.isEmpty()) { return domainName + ":" + port; } else { - return ((int) address[0] & 0x000000FF) + "." + ((int) address[1] & 0x000000FF) + "." + - ((int) address[2] & 0x000000FF) + "." + ((int) address[3] & 0x000000FF) + - ":" + port; + return ((int) address[0] & 0x000000FF) + "." + ((int) address[1] & 0x000000FF) + "." + + ((int) address[2] & 0x000000FF) + + "." + ((int) address[3] & 0x000000FF) + ":" + + port; } } diff --git a/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java b/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java index 65e5008b70..0e389aee06 100644 --- a/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java +++ b/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java @@ -1,27 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import java.io.IOException; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -53,16 +34,15 @@ public class EntityIdHelper { */ static final int SOLIDITY_ADDRESS_LEN_HEX = SOLIDITY_ADDRESS_LEN * 2; - private static final Pattern ENTITY_ID_REGEX = Pattern.compile( - "(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([a-z]{5}))?$"); + private static final Pattern ENTITY_ID_REGEX = + Pattern.compile("(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([a-z]{5}))?$"); static final Duration MIRROR_NODE_CONNECTION_TIMEOUT = Duration.ofSeconds(30); /** * Constructor. */ - private EntityIdHelper() { - } + private EntityIdHelper() {} /** * Generate an R object from a string. @@ -76,14 +56,13 @@ static R fromString(String idString, WithIdNums constructObjectWithIdNums var match = ENTITY_ID_REGEX.matcher(idString); if (!match.find()) { throw new IllegalArgumentException( - "Invalid ID \"" + idString + "\": format should look like 0.0.123 or 0.0.123-vfmkw" - ); + "Invalid ID \"" + idString + "\": format should look like 0.0.123 or 0.0.123-vfmkw"); } return constructObjectWithIdNums.apply( - Long.parseLong(match.group(1)), - Long.parseLong(match.group(2)), - Long.parseLong(match.group(3)), - match.group(4)); + Long.parseLong(match.group(1)), + Long.parseLong(match.group(2)), + Long.parseLong(match.group(3)), + match.group(4)); } /** @@ -100,8 +79,7 @@ static R fromSolidityAddress(String address, WithIdNums withAddress) { private static R fromSolidityAddress(byte[] address, WithIdNums withAddress) { if (address.length != SOLIDITY_ADDRESS_LEN) { - throw new IllegalArgumentException( - "Solidity addresses must be 20 bytes or 40 hex chars"); + throw new IllegalArgumentException("Solidity addresses must be 20 bytes or 40 hex chars"); } var buf = ByteBuffer.wrap(address); @@ -118,8 +96,7 @@ static byte[] decodeSolidityAddress(String address) { address = address.startsWith("0x") ? address.substring(2) : address; if (address.length() != SOLIDITY_ADDRESS_LEN_HEX) { - throw new IllegalArgumentException( - "Solidity addresses must be 20 bytes or 40 hex chars"); + throw new IllegalArgumentException("Solidity addresses must be 20 bytes or 40 hex chars"); } try { @@ -142,8 +119,7 @@ static String toSolidityAddress(long shard, long realm, long num) { throw new IllegalStateException("shard out of 32-bit range " + shard); } - return Hex.toHexString( - ByteBuffer.allocate(20) + return Hex.toHexString(ByteBuffer.allocate(20) .putInt((int) shard) .putLong(realm) .putLong(num) @@ -159,7 +135,8 @@ static String toSolidityAddress(long shard, long realm, long num) { */ static String checksum(LedgerId ledgerId, String addr) { StringBuilder answer = new StringBuilder(); - List d = new ArrayList<>(); // Digits with 10 for ".", so if addr == "0.0.123" then d == [0, 10, 0, 10, 1, 2, 3] + List d = + new ArrayList<>(); // Digits with 10 for ".", so if addr == "0.0.123" then d == [0, 10, 0, 10, 1, 2, 3] long s0 = 0; // Sum of even positions (mod 11) long s1 = 0; // Sum of odd positions (mod 11) long s = 0; // Weighted sum of all positions (mod p3) @@ -169,7 +146,7 @@ static String checksum(LedgerId ledgerId, String addr) { long p3 = 26 * 26 * 26; // 3 digits in base 26 long p5 = 26 * 26 * 26 * 26 * 26; // 5 digits in base 26 long asciiA = Character.codePointAt("a", 0); // 97 - long m = 1_000_003; //min prime greater than a million. Used for the final permutation. + long m = 1_000_003; // min prime greater than a million. Used for the final permutation. long w = 31; // Sum s of digit values weights them by powers of w. Should be coprime to p5. List h = new ArrayList<>(ledgerId.toBytes().length + 6); @@ -216,16 +193,14 @@ static String checksum(LedgerId ledgerId, String addr) { * @throws BadEntityIdException */ static void validate(long shard, long realm, long num, Client client, @Nullable String checksum) - throws BadEntityIdException { + throws BadEntityIdException { if (client.getNetworkName() == null) { throw new IllegalStateException( - "Can't validate checksum without knowing which network the ID is for. Ensure client's network name is set."); + "Can't validate checksum without knowing which network the ID is for. Ensure client's network name is set."); } if (checksum != null) { - String expectedChecksum = EntityIdHelper.checksum( - client.getLedgerId(), - EntityIdHelper.toString(shard, realm, num) - ); + String expectedChecksum = + EntityIdHelper.checksum(client.getLedgerId(), EntityIdHelper.toString(shard, realm, num)); if (!checksum.equals(expectedChecksum)) { throw new BadEntityIdException(shard, realm, num, checksum, expectedChecksum); } @@ -256,11 +231,11 @@ static String toString(long shard, long realm, long num) { */ static String toStringWithChecksum(long shard, long realm, long num, Client client, @Nullable String checksum) { if (client.getLedgerId() != null) { - return "" + shard + "." + realm + "." + num + "-" + checksum(client.getLedgerId(), - EntityIdHelper.toString(shard, realm, num)); + return "" + shard + "." + realm + "." + num + "-" + + checksum(client.getLedgerId(), EntityIdHelper.toString(shard, realm, num)); } else { throw new IllegalStateException( - "Can't derive checksum for ID without knowing which network the ID is for. Ensure client's ledgerId is set."); + "Can't derive checksum for ID without knowing which network the ID is for. Ensure client's ledgerId is set."); } } @@ -290,8 +265,7 @@ static boolean isLongZeroAddress(byte[] address) { static CompletableFuture getAccountNumFromMirrorNodeAsync(Client client, String evmAddress) { String apiEndpoint = "/accounts/" + evmAddress; return performQueryToMirrorNodeAsync(client, apiEndpoint, null, false) - .thenApply(response -> - parseNumFromMirrorNodeResponse(response, "account")); + .thenApply(response -> parseNumFromMirrorNodeResponse(response, "account")); } /** @@ -306,8 +280,7 @@ static CompletableFuture getAccountNumFromMirrorNodeAsync(Client client, S public static CompletableFuture getEvmAddressFromMirrorNodeAsync(Client client, long num) { String apiEndpoint = "/accounts/" + num; return performQueryToMirrorNodeAsync(client, apiEndpoint, null, false) - .thenApply(response -> - EvmAddress.fromString(parseStringMirrorNodeResponse(response, "evm_address"))); + .thenApply(response -> EvmAddress.fromString(parseStringMirrorNodeResponse(response, "evm_address"))); } /** @@ -324,23 +297,21 @@ public static CompletableFuture getContractNumFromMirrorNodeAsync(Client c CompletableFuture responseFuture = performQueryToMirrorNodeAsync(client, apiEndpoint, null, false); - return responseFuture.thenApply(response -> - parseNumFromMirrorNodeResponse(response, "contract_id")); + return responseFuture.thenApply(response -> parseNumFromMirrorNodeResponse(response, "contract_id")); } - public static CompletableFuture getContractAddressFromMirrorNodeAsync(Client client, String id) { String apiEndpoint = "/contracts/" + id; CompletableFuture responseFuture = performQueryToMirrorNodeAsync(client, apiEndpoint, null, false); - return responseFuture.thenApply(response -> - parseStringMirrorNodeResponse(response, "evm_address")); + return responseFuture.thenApply(response -> parseStringMirrorNodeResponse(response, "evm_address")); } - static CompletableFuture performQueryToMirrorNodeAsync(Client client, String apiEndpoint, String jsonBody, boolean isContractCall) { + static CompletableFuture performQueryToMirrorNodeAsync( + Client client, String apiEndpoint, String jsonBody, boolean isContractCall) { Optional mirrorUrl = client.getMirrorNetwork().stream() - .map(url -> url.substring(0, url.indexOf(":"))) - .findFirst(); + .map(url -> url.substring(0, url.indexOf(":"))) + .findFirst(); if (mirrorUrl.isEmpty()) { return CompletableFuture.failedFuture(new IllegalArgumentException("Mirror URL not found")); @@ -357,32 +328,33 @@ static CompletableFuture performQueryToMirrorNodeAsync(Client client, St } HttpClient httpClient = HttpClient.newHttpClient(); - var httpBuilder = HttpRequest.newBuilder() - .timeout(MIRROR_NODE_CONNECTION_TIMEOUT) - .uri(URI.create(apiUrl)); + var httpBuilder = + HttpRequest.newBuilder().timeout(MIRROR_NODE_CONNECTION_TIMEOUT).uri(URI.create(apiUrl)); if (jsonBody != null) { - httpBuilder.header("Content-Type", "application/json") - .POST(HttpRequest.BodyPublishers.ofString(jsonBody)); + httpBuilder.header("Content-Type", "application/json").POST(HttpRequest.BodyPublishers.ofString(jsonBody)); } var httpRequest = httpBuilder.build(); - return httpClient.sendAsync(httpRequest, HttpResponse.BodyHandlers.ofString()) - .handle((response, ex) -> { - if (ex != null) { - if (ex instanceof HttpTimeoutException) { - throw new CompletionException(new RuntimeException("Request to Mirror Node timed out", ex)); - } else { - throw new CompletionException(new RuntimeException("Failed to send request to Mirror Node", ex)); + return httpClient + .sendAsync(httpRequest, HttpResponse.BodyHandlers.ofString()) + .handle((response, ex) -> { + if (ex != null) { + if (ex instanceof HttpTimeoutException) { + throw new CompletionException(new RuntimeException("Request to Mirror Node timed out", ex)); + } else { + throw new CompletionException( + new RuntimeException("Failed to send request to Mirror Node", ex)); + } + } + + int statusCode = response.statusCode(); + if (statusCode != 200) { + throw new CompletionException( + new RuntimeException("Received non-200 response from Mirror Node: " + response.body())); } - } - - int statusCode = response.statusCode(); - if (statusCode != 200) { - throw new CompletionException(new RuntimeException("Received non-200 response from Mirror Node: " + response.body())); - } - return response.body(); - }); + return response.body(); + }); } private static String parseStringMirrorNodeResponse(String responseBody, String memberName) { diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java b/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java index 8b1251bdef..0d0e2a9f1c 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.time.Duration; @@ -36,6 +18,7 @@ public class EthereumFlow { * Indicates when we should splice out the call data from an ethereum transaction data */ static int MAX_ETHEREUM_DATA_SIZE = 5120; + @Nullable private EthereumTransactionData ethereumData; @@ -45,49 +28,52 @@ public class EthereumFlow { @Nullable private Hbar maxGasAllowance; - /** * Constructor */ - public EthereumFlow() { - } + public EthereumFlow() {} - private static FileId createFile(byte[] callData, Client client, Duration timeoutPerTransaction) throws PrecheckStatusException, TimeoutException { + private static FileId createFile(byte[] callData, Client client, Duration timeoutPerTransaction) + throws PrecheckStatusException, TimeoutException { try { var transaction = new FileCreateTransaction() - .setContents(Arrays.copyOfRange(callData, 0, Math.min(FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length))) - .execute(client, timeoutPerTransaction); + .setContents(Arrays.copyOfRange( + callData, 0, Math.min(FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length))) + .execute(client, timeoutPerTransaction); var fileId = transaction.getReceipt(client, timeoutPerTransaction).fileId; if (callData.length > FileAppendTransaction.DEFAULT_CHUNK_SIZE) { new FileAppendTransaction() - .setFileId(fileId) - .setContents(Arrays.copyOfRange(callData, FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length)) - .execute(client, timeoutPerTransaction); + .setFileId(fileId) + .setContents( + Arrays.copyOfRange(callData, FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length)) + .execute(client, timeoutPerTransaction); } return fileId; } catch (ReceiptStatusException e) { throw new RuntimeException(e); } - } - private static CompletableFuture createFileAsync(byte[] callData, Client client, Duration timeoutPerTransaction) { + private static CompletableFuture createFileAsync( + byte[] callData, Client client, Duration timeoutPerTransaction) { return new FileCreateTransaction() - .setContents(Arrays.copyOfRange(callData, 0, Math.min(FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length))) - .executeAsync(client, timeoutPerTransaction) - .thenCompose((response) -> response.getReceiptAsync(client, timeoutPerTransaction)) - .thenCompose((receipt) -> { - if (callData.length > FileAppendTransaction.DEFAULT_CHUNK_SIZE) { - return new FileAppendTransaction() - .setFileId(receipt.fileId) - .setContents(Arrays.copyOfRange(callData, FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length)) - .executeAsync(client, timeoutPerTransaction) - .thenApply((r) -> receipt.fileId); - } else { - return CompletableFuture.completedFuture(receipt.fileId); - } - }); + .setContents(Arrays.copyOfRange( + callData, 0, Math.min(FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length))) + .executeAsync(client, timeoutPerTransaction) + .thenCompose((response) -> response.getReceiptAsync(client, timeoutPerTransaction)) + .thenCompose((receipt) -> { + if (callData.length > FileAppendTransaction.DEFAULT_CHUNK_SIZE) { + return new FileAppendTransaction() + .setFileId(receipt.fileId) + .setContents(Arrays.copyOfRange( + callData, FileAppendTransaction.DEFAULT_CHUNK_SIZE, callData.length)) + .executeAsync(client, timeoutPerTransaction) + .thenApply((r) -> receipt.fileId); + } else { + return CompletableFuture.completedFuture(receipt.fileId); + } + }); } /** @@ -166,7 +152,8 @@ public TransactionResponse execute(Client client) throws PrecheckStatusException * @throws PrecheckStatusException when the precheck fails * @throws TimeoutException when the transaction times out */ - public TransactionResponse execute(Client client, Duration timeoutPerTransaction) throws PrecheckStatusException, TimeoutException { + public TransactionResponse execute(Client client, Duration timeoutPerTransaction) + throws PrecheckStatusException, TimeoutException { if (ethereumData == null) { throw new IllegalStateException("Cannot execute a ethereum flow when ethereum data was not provided"); } @@ -182,7 +169,7 @@ public TransactionResponse execute(Client client, Duration timeoutPerTransaction ethereumTransaction.setEthereumData(ethereumDataBytes); } else { var callDataFileId = createFile(ethereumData.callData, client, timeoutPerTransaction); - ethereumData.callData = new byte[]{}; + ethereumData.callData = new byte[] {}; ethereumTransaction.setEthereumData(ethereumData.toBytes()).setCallDataFileId(callDataFileId); } @@ -214,7 +201,8 @@ public CompletableFuture executeAsync(Client client) { */ public CompletableFuture executeAsync(Client client, Duration timeoutPerTransaction) { if (ethereumData == null) { - return CompletableFuture.failedFuture(new IllegalStateException("Cannot execute a ethereum flow when ethereum data was not provided")); + return CompletableFuture.failedFuture( + new IllegalStateException("Cannot execute a ethereum flow when ethereum data was not provided")); } var ethereumTransaction = new EthereumTransaction(); @@ -228,13 +216,13 @@ public CompletableFuture executeAsync(Client client, Durati return ethereumTransaction.setEthereumData(ethereumDataBytes).executeAsync(client); } else { return createFileAsync(ethereumData.callData, client, timeoutPerTransaction) - .thenCompose((callDataFileId) -> { - ethereumData.callData = new byte[]{}; - return ethereumTransaction - .setEthereumData(ethereumData.toBytes()) - .setCallDataFileId(callDataFileId) - .executeAsync(client, timeoutPerTransaction); - }); + .thenCompose((callDataFileId) -> { + ethereumData.callData = new byte[] {}; + return ethereumTransaction + .setEthereumData(ethereumData.toBytes()) + .setCallDataFileId(callDataFileId) + .executeAsync(client, timeoutPerTransaction); + }); } } @@ -255,7 +243,8 @@ public void executeAsync(Client client, BiConsumer callback) { + public void executeAsync( + Client client, Duration timeoutPerTransaction, BiConsumer callback) { ConsumerHelper.biConsumer(executeAsync(client, timeoutPerTransaction), callback); } @@ -278,7 +267,11 @@ public void executeAsync(Client client, Consumer onSuccess, * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void executeAsync(Client client, Duration timeoutPerTransaction, Consumer onSuccess, Consumer onFailure) { + public void executeAsync( + Client client, + Duration timeoutPerTransaction, + Consumer onSuccess, + Consumer onFailure) { ConsumerHelper.twoConsumers(executeAsync(client, timeoutPerTransaction), onSuccess, onFailure); } } diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java index 1a76a7c021..f95b1d6b91 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -27,12 +9,10 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.Arrays; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Execute an Ethereum transaction on Hedera @@ -45,10 +25,10 @@ public class EthereumTransaction extends Transaction { /** * Constructor */ - public EthereumTransaction() { - } + public EthereumTransaction() {} - EthereumTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + EthereumTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -74,7 +54,6 @@ public byte[] getEthereumData() { * @param ethereumData raw ethereum transaction bytes * @return {@code this} */ - public EthereumTransaction setEthereumData(byte[] ethereumData) { Objects.requireNonNull(ethereumData); requireNotFrozen(); @@ -103,7 +82,6 @@ public FileId getCallDataFileId() { * @param fileId File ID of an HFS file containing the callData * @return {@code this} */ - public EthereumTransaction setCallDataFileId(FileId fileId) { Objects.requireNonNull(fileId); requireNotFrozen(); @@ -157,8 +135,8 @@ private void initFromTransactionBody() { private EthereumTransactionBody.Builder build() { var builder = EthereumTransactionBody.newBuilder() - .setEthereumData(ByteString.copyFrom(ethereumData)) - .setMaxGasAllowance(maxGasAllowanceHbar.toTinybars()); + .setEthereumData(ByteString.copyFrom(ethereumData)) + .setMaxGasAllowance(maxGasAllowanceHbar.toTinybars()); if (callDataFileId != null) { builder.setCallData(callDataFileId.toProtobuf()); } diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java index 42057466a8..49a1b695b4 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java index e207ffcfc7..fe3deff537 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; @@ -92,19 +74,18 @@ public class EthereumTransactionDataEip1559 extends EthereumTransactionData { public byte[] s; EthereumTransactionDataEip1559( - byte[] chainId, - byte[] nonce, - byte[] maxPriorityGas, - byte[] maxGas, - byte[] gasLimit, - byte[] to, - byte[] value, - byte[] callData, - byte[] accessList, - byte[] recoveryId, - byte[] r, - byte[] s - ) { + byte[] chainId, + byte[] nonce, + byte[] maxPriorityGas, + byte[] maxGas, + byte[] gasLimit, + byte[] to, + byte[] value, + byte[] callData, + byte[] accessList, + byte[] recoveryId, + byte[] r, + byte[] s) { super(callData); this.chainId = chainId; @@ -145,41 +126,51 @@ public static EthereumTransactionDataEip1559 fromBytes(byte[] bytes) { } return new EthereumTransactionDataEip1559( - rlpList.get(0).data(), - rlpList.get(1).data(), - rlpList.get(2).data(), - rlpList.get(3).data(), - rlpList.get(4).data(), - rlpList.get(5).data(), - rlpList.get(6).data(), - rlpList.get(7).data(), - rlpList.get(8).data(), - rlpList.get(9).data(), - rlpList.get(10).data(), - rlpList.get(11).data() - ); + rlpList.get(0).data(), + rlpList.get(1).data(), + rlpList.get(2).data(), + rlpList.get(3).data(), + rlpList.get(4).data(), + rlpList.get(5).data(), + rlpList.get(6).data(), + rlpList.get(7).data(), + rlpList.get(8).data(), + rlpList.get(9).data(), + rlpList.get(10).data(), + rlpList.get(11).data()); } public byte[] toBytes() { - return RLPEncoder.sequence(Integers.toBytes(0x02), List.of( - chainId, nonce, maxPriorityGas, maxGas, gasLimit, to, - value, callData, new ArrayList(), recoveryId, r, s - )); + return RLPEncoder.sequence( + Integers.toBytes(0x02), + List.of( + chainId, + nonce, + maxPriorityGas, + maxGas, + gasLimit, + to, + value, + callData, + new ArrayList(), + recoveryId, + r, + s)); } public String toString() { return MoreObjects.toStringHelper(this) - .add("chainId", Hex.toHexString(chainId)) - .add("nonce", Hex.toHexString(nonce)) - .add("maxPriorityGas", Hex.toHexString(maxPriorityGas)) - .add("maxGas", Hex.toHexString(maxGas)) - .add("gasLimit", Hex.toHexString(gasLimit)) - .add("to", Hex.toHexString(to)) - .add("value", Hex.toHexString(value)) - .add("accessList", Hex.toHexString(accessList)) - .add("recoveryId", Hex.toHexString(recoveryId)) - .add("r", Hex.toHexString(r)) - .add("s", Hex.toHexString(s)) - .toString(); + .add("chainId", Hex.toHexString(chainId)) + .add("nonce", Hex.toHexString(nonce)) + .add("maxPriorityGas", Hex.toHexString(maxPriorityGas)) + .add("maxGas", Hex.toHexString(maxGas)) + .add("gasLimit", Hex.toHexString(gasLimit)) + .add("to", Hex.toHexString(to)) + .add("value", Hex.toHexString(value)) + .add("accessList", Hex.toHexString(accessList)) + .add("recoveryId", Hex.toHexString(recoveryId)) + .add("r", Hex.toHexString(r)) + .add("s", Hex.toHexString(s)) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java index 3b3f3488f3..f97367ed01 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java +++ b/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java @@ -1,32 +1,13 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; import com.esaulpaugh.headlong.rlp.RLPEncoder; import com.esaulpaugh.headlong.rlp.RLPItem; import com.google.common.base.MoreObjects; -import org.bouncycastle.util.encoders.Hex; - import java.math.BigInteger; import java.util.List; +import org.bouncycastle.util.encoders.Hex; /** * The ethereum transaction data, in the legacy format @@ -36,7 +17,7 @@ public class EthereumTransactionDataLegacy extends EthereumTransactionData { /** * ID of the chain */ - public byte[] chainId = new byte[]{}; + public byte[] chainId = new byte[] {}; /** * Transaction's nonce @@ -84,16 +65,15 @@ public class EthereumTransactionDataLegacy extends EthereumTransactionData { public byte[] s; EthereumTransactionDataLegacy( - byte[] nonce, - byte[] gasPrice, - byte[] gasLimit, - byte[] to, - byte[] value, - byte[] callData, - byte[] v, - byte[] r, - byte[] s - ) { + byte[] nonce, + byte[] gasPrice, + byte[] gasLimit, + byte[] to, + byte[] value, + byte[] callData, + byte[] v, + byte[] r, + byte[] s) { super(callData); this.nonce = nonce; @@ -129,16 +109,15 @@ public static EthereumTransactionDataLegacy fromBytes(byte[] bytes) { } return new EthereumTransactionDataLegacy( - rlpList.get(0).data(), - rlpList.get(1).asBytes(), - rlpList.get(2).data(), - rlpList.get(3).data(), - rlpList.get(4).data(), - rlpList.get(5).data(), - rlpList.get(6).asBytes(), - rlpList.get(7).data(), - rlpList.get(8).data() - ); + rlpList.get(0).data(), + rlpList.get(1).asBytes(), + rlpList.get(2).data(), + rlpList.get(3).data(), + rlpList.get(4).data(), + rlpList.get(5).data(), + rlpList.get(6).asBytes(), + rlpList.get(7).data(), + rlpList.get(8).data()); } public byte[] toBytes() { @@ -147,16 +126,16 @@ public byte[] toBytes() { public String toString() { return MoreObjects.toStringHelper(this) - .add("chainId", Hex.toHexString(this.chainId)) - .add("nonce", Hex.toHexString(this.nonce)) - .add("gasPrice", Hex.toHexString(this.gasPrice)) - .add("gasLimit", Hex.toHexString(this.gasLimit)) - .add("to", Hex.toHexString(this.to)) - .add("value", Hex.toHexString(this.value)) - .add("recoveryId", this.recoveryId) - .add("v", Hex.toHexString(this.v)) - .add("r", Hex.toHexString(this.r)) - .add("s", Hex.toHexString(this.s)) - .toString(); + .add("chainId", Hex.toHexString(this.chainId)) + .add("nonce", Hex.toHexString(this.nonce)) + .add("gasPrice", Hex.toHexString(this.gasPrice)) + .add("gasLimit", Hex.toHexString(this.gasLimit)) + .add("to", Hex.toHexString(this.to)) + .add("value", Hex.toHexString(this.value)) + .add("recoveryId", this.recoveryId) + .add("v", Hex.toHexString(this.v)) + .add("r", Hex.toHexString(this.r)) + .add("s", Hex.toHexString(this.s)) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/EvmAddress.java b/sdk/src/main/java/com/hiero/sdk/EvmAddress.java index feeacd1e29..13bd446080 100644 --- a/sdk/src/main/java/com/hiero/sdk/EvmAddress.java +++ b/sdk/src/main/java/com/hiero/sdk/EvmAddress.java @@ -1,34 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; -import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AccountID; -import org.bouncycastle.util.encoders.Hex; - -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; import java.util.Arrays; -import java.util.Objects; -import java.util.regex.Pattern; +import javax.annotation.Nullable; +import org.bouncycastle.util.encoders.Hex; /** * The ID for a cryptocurrency account on Hedera. @@ -97,7 +73,7 @@ public int hashCode() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java b/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java index 1db01d2b72..d61924afa1 100644 --- a/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java +++ b/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -61,19 +43,16 @@ public final class ExchangeRate { */ static ExchangeRate fromProtobuf(com.hiero.sdk.proto.ExchangeRate pb) { return new ExchangeRate( - pb.getHbarEquiv(), - pb.getCentEquiv(), - InstantConverter.fromProtobuf(pb.getExpirationTime()) - ); + pb.getHbarEquiv(), pb.getCentEquiv(), InstantConverter.fromProtobuf(pb.getExpirationTime())); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("hbars", hbars) - .add("cents", cents) - .add("expirationTime", expirationTime) - .add("exchangeRateInCents", exchangeRateInCents) - .toString(); + .add("hbars", hbars) + .add("cents", cents) + .add("expirationTime", expirationTime) + .add("exchangeRateInCents", exchangeRateInCents) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java b/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java index 0554564f5c..416713a9e4 100644 --- a/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java +++ b/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -49,9 +31,7 @@ private ExchangeRates(ExchangeRate currentRate, ExchangeRate nextRate) { */ static ExchangeRates fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet pb) { return new ExchangeRates( - ExchangeRate.fromProtobuf(pb.getCurrentRate()), - ExchangeRate.fromProtobuf(pb.getNextRate()) - ); + ExchangeRate.fromProtobuf(pb.getCurrentRate()), ExchangeRate.fromProtobuf(pb.getNextRate())); } /** @@ -62,16 +42,15 @@ static ExchangeRates fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet pb) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static ExchangeRates fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.ExchangeRateSet.parseFrom(bytes).toBuilder().build()); } - @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("currentRate", currentRate.toString()) - .add("nextRate", nextRate.toString()) - .toString(); + .add("currentRate", currentRate.toString()) + .add("nextRate", nextRate.toString()) + .toString(); } - } diff --git a/sdk/src/main/java/com/hiero/sdk/Executable.java b/sdk/src/main/java/com/hiero/sdk/Executable.java index f2bb685009..d80aedd19f 100644 --- a/sdk/src/main/java/com/hiero/sdk/Executable.java +++ b/sdk/src/main/java/com/hiero/sdk/Executable.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static com.hiero.sdk.FutureConverter.toCompletableFuture; @@ -61,8 +43,9 @@ abstract class Executable { @SuppressWarnings("java:S2245") protected static final Random random = new Random(); - static final Pattern RST_STREAM = Pattern - .compile(".*\\brst[^0-9a-zA-Z]stream\\b.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + + static final Pattern RST_STREAM = + Pattern.compile(".*\\brst[^0-9a-zA-Z]stream\\b.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); /** * The maximum times execution will be attempted */ @@ -99,12 +82,14 @@ abstract class Executable requestListener; // Lambda responsible for executing synchronous gRPC requests. Pluggable for unit testing. @VisibleForTesting Function blockingUnaryCall = - (grpcRequest) -> ClientCalls.blockingUnaryCall(grpcRequest.createCall(), grpcRequest.getRequest()); + (grpcRequest) -> ClientCalls.blockingUnaryCall(grpcRequest.createCall(), grpcRequest.getRequest()); + private java.util.function.Function responseListener; Executable() { @@ -346,7 +331,8 @@ private void delay(long delay) { try { if (delay > 0) { if (logger.isEnabledForLevel(LogLevel.DEBUG)) { - logger.debug("Sleeping for: " + delay + " | Thread name: " + Thread.currentThread().getName()); + logger.debug("Sleeping for: " + delay + " | Thread name: " + + Thread.currentThread().getName()); } Thread.sleep(delay); } @@ -496,15 +482,17 @@ public CompletableFuture executeAsync(Client client, Duration timeout) { mergeFromClient(client); - onExecuteAsync(client).thenRun(() -> { - checkNodeAccountIds(); - setNodesFromNodeAccountIds(client); + onExecuteAsync(client) + .thenRun(() -> { + checkNodeAccountIds(); + setNodesFromNodeAccountIds(client); - executeAsyncInternal(client, 1, null, retval, timeout); - }).exceptionally(error -> { - retval.completeExceptionally(error); - return null; - }); + executeAsyncInternal(client, 1, null, retval, timeout); + }) + .exceptionally(error -> { + retval.completeExceptionally(error); + return null; + }); return retval; } @@ -564,24 +552,25 @@ public void executeAsync(Client client, Duration timeout, Consumer onSuccess, * @param error the error if the transaction was not successful */ protected void logTransaction( - TransactionId transactionId, - Client client, - Node node, - boolean isAsync, - int attempt, - @Nullable ResponseT response, - @Nullable Throwable error) { + TransactionId transactionId, + Client client, + Node node, + boolean isAsync, + int attempt, + @Nullable ResponseT response, + @Nullable Throwable error) { if (!logger.isEnabledForLevel(LogLevel.TRACE)) { return; } - logger.trace("Execute{} Transaction ID: {}, submit to {}, node: {}, attempt: {}", - isAsync ? "Async" : "", - transactionId, - client.network, - node.getAccountId(), - attempt); + logger.trace( + "Execute{} Transaction ID: {}, submit to {}, node: {}, attempt: {}", + isAsync ? "Async" : "", + transactionId, + client.network, + node.getAccountId(), + attempt); if (response != null) { logger.trace(" - Response: {}", response); @@ -613,8 +602,7 @@ void setNodesFromNodeAccountIds(Client client) { // When multiple nodes are available the system retries with different node on each attempt // instead of different proxy of the same node for (var accountId : nodeAccountIds) { - @Nullable - var nodeProxies = client.network.getNodeProxies(accountId); + @Nullable var nodeProxies = client.network.getNodeProxies(accountId); if (nodeProxies == null || nodeProxies.isEmpty()) { continue; } @@ -624,8 +612,7 @@ void setNodesFromNodeAccountIds(Client client) { nodes.add(Objects.requireNonNull(node)); } if (nodes.isEmpty()) { - throw new IllegalStateException( - "All node account IDs did not map to valid nodes in the client's network"); + throw new IllegalStateException("All node account IDs did not map to valid nodes in the client's network"); } } @@ -692,12 +679,11 @@ private ProtoRequestT getRequestForExecute() { } private void executeAsyncInternal( - Client client, - int attempt, - @Nullable Throwable lastException, - CompletableFuture returnFuture, - Duration timeout - ) { + Client client, + int attempt, + @Nullable Throwable lastException, + CompletableFuture returnFuture, + Duration timeout) { // If the logger on the request is not set, use the logger in client // (if set, otherwise do not use logger) if (this.logger == null && client.getLogger() != null) { @@ -710,81 +696,109 @@ private void executeAsyncInternal( if (attempt > maxAttempts) { returnFuture.completeExceptionally( - new CompletionException(new MaxAttemptsExceededException(lastException))); + new CompletionException(new MaxAttemptsExceededException(lastException))); return; } var timeoutTime = Instant.now().plus(timeout); - GrpcRequest grpcRequest = new GrpcRequest(client.network, attempt, - Duration.between(Instant.now(), timeoutTime)); + GrpcRequest grpcRequest = + new GrpcRequest(client.network, attempt, Duration.between(Instant.now(), timeoutTime)); Supplier> afterUnhealthyDelay = () -> { - return grpcRequest.getNode().isHealthy() ? - CompletableFuture.completedFuture((Void) null) : - Delayer.delayFor(grpcRequest.getNode().getRemainingTimeForBackoff(), client.executor); + return grpcRequest.getNode().isHealthy() + ? CompletableFuture.completedFuture((Void) null) + : Delayer.delayFor(grpcRequest.getNode().getRemainingTimeForBackoff(), client.executor); }; afterUnhealthyDelay.get().thenRun(() -> { - grpcRequest.getNode().channelFailedToConnectAsync().thenAccept(connectionFailed -> { - if (connectionFailed) { - var connectionException = grpcRequest.reactToConnectionFailure(); - executeAsyncInternal(client, attempt + 1, connectionException, returnFuture, - Duration.between(Instant.now(), timeoutTime)); - return; - } - - toCompletableFuture( - ClientCalls.futureUnaryCall(grpcRequest.createCall(), grpcRequest.getRequest())).handle( - (response, error) -> { - logTransaction(this.getTransactionIdInternal(), client, grpcRequest.getNode(), true, attempt, - response, error); - - if (grpcRequest.shouldRetryExceptionally(error)) { - // the transaction had a network failure reaching Hedera - executeAsyncInternal(client, attempt + 1, error, returnFuture, - Duration.between(Instant.now(), timeoutTime)); - return null; - } - - if (error != null) { - // not a network failure, some other weirdness going on; just fail fast - returnFuture.completeExceptionally(new CompletionException(error)); - return null; + grpcRequest + .getNode() + .channelFailedToConnectAsync() + .thenAccept(connectionFailed -> { + if (connectionFailed) { + var connectionException = grpcRequest.reactToConnectionFailure(); + executeAsyncInternal( + client, + attempt + 1, + connectionException, + returnFuture, + Duration.between(Instant.now(), timeoutTime)); + return; } - var status = mapResponseStatus(response); - var executionState = getExecutionState(status, response); - grpcRequest.handleResponse(response, status, executionState); - - switch (executionState) { - case SERVER_ERROR: - executeAsyncInternal(client, attempt + 1, grpcRequest.mapStatusException(), - returnFuture, Duration.between(Instant.now(), timeoutTime)); - break; - case RETRY: - Delayer.delayFor((attempt < maxAttempts) ? grpcRequest.getDelay() : 0, client.executor) - .thenRun(() -> executeAsyncInternal(client, attempt + 1, - grpcRequest.mapStatusException(), - returnFuture, Duration.between(Instant.now(), timeoutTime))); - break; - case REQUEST_ERROR: - returnFuture.completeExceptionally( - new CompletionException(grpcRequest.mapStatusException())); - break; - case SUCCESS: - default: - returnFuture.complete(grpcRequest.mapResponse()); - } + toCompletableFuture( + ClientCalls.futureUnaryCall(grpcRequest.createCall(), grpcRequest.getRequest())) + .handle((response, error) -> { + logTransaction( + this.getTransactionIdInternal(), + client, + grpcRequest.getNode(), + true, + attempt, + response, + error); + + if (grpcRequest.shouldRetryExceptionally(error)) { + // the transaction had a network failure reaching Hedera + executeAsyncInternal( + client, + attempt + 1, + error, + returnFuture, + Duration.between(Instant.now(), timeoutTime)); + return null; + } + + if (error != null) { + // not a network failure, some other weirdness going on; just fail fast + returnFuture.completeExceptionally(new CompletionException(error)); + return null; + } + + var status = mapResponseStatus(response); + var executionState = getExecutionState(status, response); + grpcRequest.handleResponse(response, status, executionState); + + switch (executionState) { + case SERVER_ERROR: + executeAsyncInternal( + client, + attempt + 1, + grpcRequest.mapStatusException(), + returnFuture, + Duration.between(Instant.now(), timeoutTime)); + break; + case RETRY: + Delayer.delayFor( + (attempt < maxAttempts) ? grpcRequest.getDelay() : 0, + client.executor) + .thenRun(() -> executeAsyncInternal( + client, + attempt + 1, + grpcRequest.mapStatusException(), + returnFuture, + Duration.between(Instant.now(), timeoutTime))); + break; + case REQUEST_ERROR: + returnFuture.completeExceptionally( + new CompletionException(grpcRequest.mapStatusException())); + break; + case SUCCESS: + default: + returnFuture.complete(grpcRequest.mapResponse()); + } + return null; + }) + .exceptionally(error -> { + returnFuture.completeExceptionally(error); + return null; + }); + }) + .exceptionally(error -> { + returnFuture.completeExceptionally(error); return null; - }).exceptionally(error -> { - returnFuture.completeExceptionally(error); - return null; - }); - }).exceptionally(error -> { - returnFuture.completeExceptionally(error); - return null; - }); + }); }); } @@ -825,9 +839,11 @@ boolean shouldRetryExceptionally(@Nullable Throwable error) { var status = statusException.getStatus().getCode(); var description = statusException.getStatus().getDescription(); - return (status == Code.UNAVAILABLE) || - (status == Code.RESOURCE_EXHAUSTED) || - (status == Code.INTERNAL && description != null && RST_STREAM.matcher(description).matches()); + return (status == Code.UNAVAILABLE) + || (status == Code.RESOURCE_EXHAUSTED) + || (status == Code.INTERNAL + && description != null + && RST_STREAM.matcher(description).matches()); } return false; @@ -847,7 +863,7 @@ ExecutionState getExecutionState(Status status, ResponseT response) { case OK: return ExecutionState.SUCCESS; default: - return ExecutionState.REQUEST_ERROR; // user error + return ExecutionState.REQUEST_ERROR; // user error } } @@ -855,9 +871,10 @@ ExecutionState getExecutionState(Status status, ResponseT response) { class GrpcRequest { @Nullable private final Network network; + private final Node node; private final int attempt; - //private final ClientCall call; + // private final ClientCall call; private final ProtoRequestT request; private final long startAt; private final long delay; @@ -875,14 +892,13 @@ class GrpcRequest { this.startAt = System.nanoTime(); // Exponential back-off for Delayer: 250ms, 500ms, 1s, 2s, 4s, 8s, ... 8s - delay = (long) Math.min(Objects.requireNonNull(minBackoff).toMillis() * Math.pow(2, attempt - 1.0), - Objects.requireNonNull(maxBackoff).toMillis()); + delay = (long) Math.min( + Objects.requireNonNull(minBackoff).toMillis() * Math.pow(2, attempt - 1.0), + Objects.requireNonNull(maxBackoff).toMillis()); } public CallOptions getCallOptions() { - long deadline = Math.min( - this.grpcDeadline.toMillis(), - Executable.this.grpcDeadline.toMillis()); + long deadline = Math.min(this.grpcDeadline.toMillis(), Executable.this.grpcDeadline.toMillis()); return CallOptions.DEFAULT.withDeadlineAfter(deadline, TimeUnit.MILLISECONDS); } @@ -910,8 +926,11 @@ public long getDelay() { Throwable reactToConnectionFailure() { Objects.requireNonNull(network).increaseBackoff(node); - logger.warn("Retrying in {} ms after channel connection failure with node {} during attempt #{}", - node.getRemainingTimeForBackoff(), node.getAccountId(), attempt); + logger.warn( + "Retrying in {} ms after channel connection failure with node {} during attempt #{}", + node.getRemainingTimeForBackoff(), + node.getAccountId(), + attempt); verboseLog(node); return new IllegalStateException("Failed to connect to node " + node.getAccountId()); } @@ -923,9 +942,12 @@ boolean shouldRetryExceptionally(@Nullable Throwable e) { if (retry) { Objects.requireNonNull(network).increaseBackoff(node); - logger.warn("Retrying in {} ms after failure with node {} during attempt #{}: {}", - node.getRemainingTimeForBackoff(), node.getAccountId(), attempt, - e != null ? e.getMessage() : "NULL"); + logger.warn( + "Retrying in {} ms after failure with node {} during attempt #{}: {}", + node.getRemainingTimeForBackoff(), + node.getAccountId(), + attempt, + e != null ? e.getMessage() : "NULL"); verboseLog(node); } @@ -948,8 +970,13 @@ void handleResponse(ResponseT response, Status status, ExecutionState executionS this.response = Executable.this.responseListener.apply(response); this.responseStatus = status; - logger.trace("Received {} response in {} s from node {} during attempt #{}: {}", - responseStatus, latency, node.getAccountId(), attempt, response); + logger.trace( + "Received {} response in {} s from node {} during attempt #{}: {}", + responseStatus, + latency, + node.getAccountId(), + attempt, + response); if (executionState == ExecutionState.SERVER_ERROR && attemptedAllNodes) { executionState = ExecutionState.RETRY; @@ -957,15 +984,20 @@ void handleResponse(ResponseT response, Status status, ExecutionState executionS } switch (executionState) { case RETRY -> { - logger.warn("Retrying in {} ms after failure with node {} during attempt #{}: {}", - delay, node.getAccountId(), attempt, responseStatus); + logger.warn( + "Retrying in {} ms after failure with node {} during attempt #{}: {}", + delay, + node.getAccountId(), + attempt, + responseStatus); verboseLog(node); } - case SERVER_ERROR -> - logger.warn("Problem submitting request to node {} for attempt #{}, retry with new node: {}", - node.getAccountId(), attempt, responseStatus); - default -> { - } + case SERVER_ERROR -> logger.warn( + "Problem submitting request to node {} for attempt #{}, retry with new node: {}", + node.getAccountId(), + attempt, + responseStatus); + default -> {} } } @@ -978,11 +1010,11 @@ void verboseLog(Node node) { } else { ipAddress = node.address.getAddress(); } - logger.trace("Node IP {} Timestamp {} Transaction Type {}", - ipAddress, - System.currentTimeMillis(), - this.getClass().getSimpleName() - ); + logger.trace( + "Node IP {} Timestamp {} Transaction Type {}", + ipAddress, + System.currentTimeMillis(), + this.getClass().getSimpleName()); } } } diff --git a/sdk/src/main/java/com/hiero/sdk/ExecutionState.java b/sdk/src/main/java/com/hiero/sdk/ExecutionState.java index 9d02adb355..6fc199a4ad 100644 --- a/sdk/src/main/java/com/hiero/sdk/ExecutionState.java +++ b/sdk/src/main/java/com/hiero/sdk/ExecutionState.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java b/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java index 04e7807518..8136b49071 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/FeeComponents.java b/sdk/src/main/java/com/hiero/sdk/FeeComponents.java index 06770f3565..7aec8a6ea0 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeComponents.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeComponents.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -74,8 +56,7 @@ public class FeeComponents implements Cloneable { /** * Constructor. */ - public FeeComponents() { - } + public FeeComponents() {} /** * Create a fee components object from a protobuf. @@ -85,17 +66,17 @@ public FeeComponents() { */ static FeeComponents fromProtobuf(com.hiero.sdk.proto.FeeComponents feeComponents) { return new FeeComponents() - .setMin(feeComponents.getMin()) - .setMax(feeComponents.getMax()) - .setConstant(feeComponents.getConstant()) - .setTransactionBandwidthByte(feeComponents.getBpt()) - .setTransactionVerification(feeComponents.getVpt()) - .setTransactionRamByteHour(feeComponents.getRbh()) - .setTransactionStorageByteHour(feeComponents.getSbh()) - .setContractTransactionGas(feeComponents.getGas()) - .setTransferVolumeHbar(feeComponents.getTv()) - .setResponseMemoryByte(feeComponents.getBpr()) - .setResponseDiskByte(feeComponents.getSbpr()); + .setMin(feeComponents.getMin()) + .setMax(feeComponents.getMax()) + .setConstant(feeComponents.getConstant()) + .setTransactionBandwidthByte(feeComponents.getBpt()) + .setTransactionVerification(feeComponents.getVpt()) + .setTransactionRamByteHour(feeComponents.getRbh()) + .setTransactionStorageByteHour(feeComponents.getSbh()) + .setContractTransactionGas(feeComponents.getGas()) + .setTransferVolumeHbar(feeComponents.getTv()) + .setResponseMemoryByte(feeComponents.getBpr()) + .setResponseDiskByte(feeComponents.getSbpr()); } /** @@ -106,7 +87,8 @@ static FeeComponents fromProtobuf(com.hiero.sdk.proto.FeeComponents feeComponent * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeComponents fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.FeeComponents.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.FeeComponents.parseFrom(bytes).toBuilder().build()); } /** @@ -336,35 +318,35 @@ public FeeComponents setResponseDiskByte(long responseDiskByte) { */ com.hiero.sdk.proto.FeeComponents toProtobuf() { return com.hiero.sdk.proto.FeeComponents.newBuilder() - .setMin(getMin()) - .setMax(getMax()) - .setConstant(getConstant()) - .setBpt(getTransactionBandwidthByte()) - .setVpt(getTransactionVerification()) - .setRbh(getTransactionRamByteHour()) - .setSbh(getTransactionStorageByteHour()) - .setGas(getContractTransactionGas()) - .setTv(getTransferVolumeHbar()) - .setBpr(getResponseMemoryByte()) - .setSbpr(getResponseDiskByte()) - .build(); + .setMin(getMin()) + .setMax(getMax()) + .setConstant(getConstant()) + .setBpt(getTransactionBandwidthByte()) + .setVpt(getTransactionVerification()) + .setRbh(getTransactionRamByteHour()) + .setSbh(getTransactionStorageByteHour()) + .setGas(getContractTransactionGas()) + .setTv(getTransferVolumeHbar()) + .setBpr(getResponseMemoryByte()) + .setSbpr(getResponseDiskByte()) + .build(); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("min", getMin()) - .add("max", getMax()) - .add("constant", getConstant()) - .add("transactionBandwidthByte", getTransactionBandwidthByte()) - .add("transactionVerification", getTransactionVerification()) - .add("transactionRamByteHour", getTransactionRamByteHour()) - .add("transactionStorageByteHour", getTransactionStorageByteHour()) - .add("contractTransactionGas", getContractTransactionGas()) - .add("transferVolumeHbar", getTransferVolumeHbar()) - .add("responseMemoryByte", getResponseMemoryByte()) - .add("responseDiskByte", getResponseDiskByte()) - .toString(); + .add("min", getMin()) + .add("max", getMax()) + .add("constant", getConstant()) + .add("transactionBandwidthByte", getTransactionBandwidthByte()) + .add("transactionVerification", getTransactionVerification()) + .add("transactionRamByteHour", getTransactionRamByteHour()) + .add("transactionStorageByteHour", getTransactionStorageByteHour()) + .add("contractTransactionGas", getContractTransactionGas()) + .add("transferVolumeHbar", getTransferVolumeHbar()) + .add("responseMemoryByte", getResponseMemoryByte()) + .add("responseDiskByte", getResponseDiskByte()) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/FeeData.java b/sdk/src/main/java/com/hiero/sdk/FeeData.java index ee4f8093eb..9fa18b385b 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeData.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeData.java @@ -1,27 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; - import javax.annotation.Nullable; /** @@ -31,17 +12,19 @@ public class FeeData implements Cloneable { @Nullable private FeeComponents nodeData = null; + @Nullable private FeeComponents networkData = null; + @Nullable private FeeComponents serviceData = null; + private FeeDataType type = FeeDataType.DEFAULT; /** * Constructor. */ - public FeeData() { - } + public FeeData() {} /** * Initialize fee data object from a protobuf. @@ -51,10 +34,10 @@ public FeeData() { */ static FeeData fromProtobuf(com.hiero.sdk.proto.FeeData feeData) { return new FeeData() - .setNodeData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getNodedata()) : null) - .setNetworkData(feeData.hasNetworkdata() ? FeeComponents.fromProtobuf(feeData.getNetworkdata()) : null) - .setServiceData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getServicedata()) : null) - .setType(FeeDataType.valueOf(feeData.getSubType())); + .setNodeData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getNodedata()) : null) + .setNetworkData(feeData.hasNetworkdata() ? FeeComponents.fromProtobuf(feeData.getNetworkdata()) : null) + .setServiceData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getServicedata()) : null) + .setType(FeeDataType.valueOf(feeData.getSubType())); } /** @@ -65,7 +48,8 @@ static FeeData fromProtobuf(com.hiero.sdk.proto.FeeData feeData) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeData fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.FeeData.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.FeeData.parseFrom(bytes).toBuilder().build()); } /** @@ -174,11 +158,11 @@ com.hiero.sdk.proto.FeeData toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("nodeData", getNodeData()) - .add("networkData", getNetworkData()) - .add("serviceData", getServiceData()) - .add("type", getType()) - .toString(); + .add("nodeData", getNodeData()) + .add("networkData", getNetworkData()) + .add("serviceData", getServiceData()) + .add("type", getType()) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/FeeDataType.java b/sdk/src/main/java/com/hiero/sdk/FeeDataType.java index b9460c19dd..a4cc5af3fc 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeDataType.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeDataType.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.SubType; @@ -57,7 +39,6 @@ public enum FeeDataType { */ SCHEDULE_CREATE_CONTRACT_CALL(SubType.SCHEDULE_CREATE_CONTRACT_CALL); - final SubType code; FeeDataType(SubType code) { diff --git a/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java b/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java index 3f7f2277b4..92324afaf2 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java @@ -1,33 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * The fee schedule for a specific hedera functionality and the time period this fee schedule will expire. @@ -36,14 +17,14 @@ */ public class FeeSchedule implements Cloneable { private List transactionFeeSchedules = new ArrayList<>(); + @Nullable private Instant expirationTime; /** * Constructor. */ - public FeeSchedule() { - } + public FeeSchedule() {} /** * Create a fee schedule from a protobuf. @@ -53,10 +34,12 @@ public FeeSchedule() { */ static FeeSchedule fromProtobuf(com.hiero.sdk.proto.FeeSchedule feeSchedule) { FeeSchedule returnFeeSchedule = new FeeSchedule() - .setExpirationTime(feeSchedule.hasExpiryTime() ? InstantConverter.fromProtobuf(feeSchedule.getExpiryTime()) : null); + .setExpirationTime( + feeSchedule.hasExpiryTime() + ? InstantConverter.fromProtobuf(feeSchedule.getExpiryTime()) + : null); for (var transactionFeeSchedule : feeSchedule.getTransactionFeeScheduleList()) { - returnFeeSchedule - .addTransactionFeeSchedule(TransactionFeeSchedule.fromProtobuf(transactionFeeSchedule)); + returnFeeSchedule.addTransactionFeeSchedule(TransactionFeeSchedule.fromProtobuf(transactionFeeSchedule)); } return returnFeeSchedule; } @@ -69,7 +52,8 @@ static FeeSchedule fromProtobuf(com.hiero.sdk.proto.FeeSchedule feeSchedule) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeSchedule fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.FeeSchedule.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.FeeSchedule.parseFrom(bytes).toBuilder().build()); } /** @@ -151,9 +135,9 @@ com.hiero.sdk.proto.FeeSchedule toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("transactionFeeSchedules", getTransactionFeeSchedules()) - .add("expirationTime", getExpirationTime()) - .toString(); + .add("transactionFeeSchedules", getTransactionFeeSchedules()) + .add("expirationTime", getExpirationTime()) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java b/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java index ad6adb40c9..ce85a5ee85 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java +++ b/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java @@ -1,28 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.CurrentAndNextFeeSchedule; - import javax.annotation.Nullable; /** @@ -33,6 +14,7 @@ public class FeeSchedules { @Nullable private FeeSchedule current; + @Nullable private FeeSchedule next; @@ -51,8 +33,14 @@ public FeeSchedules() { */ static FeeSchedules fromProtobuf(CurrentAndNextFeeSchedule feeSchedules) { return new FeeSchedules() - .setCurrent(feeSchedules.hasCurrentFeeSchedule() ? FeeSchedule.fromProtobuf(feeSchedules.getCurrentFeeSchedule()) : null) - .setNext(feeSchedules.hasNextFeeSchedule() ? FeeSchedule.fromProtobuf(feeSchedules.getNextFeeSchedule()) : null); + .setCurrent( + feeSchedules.hasCurrentFeeSchedule() + ? FeeSchedule.fromProtobuf(feeSchedules.getCurrentFeeSchedule()) + : null) + .setNext( + feeSchedules.hasNextFeeSchedule() + ? FeeSchedule.fromProtobuf(feeSchedules.getNextFeeSchedule()) + : null); } /** @@ -63,7 +51,8 @@ static FeeSchedules fromProtobuf(CurrentAndNextFeeSchedule feeSchedules) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FeeSchedules fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(CurrentAndNextFeeSchedule.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + CurrentAndNextFeeSchedule.parseFrom(bytes).toBuilder().build()); } /** @@ -136,8 +125,8 @@ public byte[] toBytes() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("current", getCurrent()) - .add("next", getNext()) - .toString(); + .add("current", getCurrent()) + .add("next", getNext()) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java index 2d846438ce..91ae9b9836 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java @@ -43,8 +43,7 @@ public FileAppendTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileAppendTransaction( - LinkedHashMap> txs) + FileAppendTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); diff --git a/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java b/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java index f710ed98a7..97fb5049f8 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -48,8 +30,7 @@ public final class FileContentsQuery extends Query> txs) throws InvalidProtocolBufferException { + FileCreateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java index 275486e7ae..b4ade447e7 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** *

A transaction to delete a file on the Hedera network. @@ -49,8 +30,7 @@ public final class FileDeleteTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + FileDeleteTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/FileId.java b/sdk/src/main/java/com/hiero/sdk/FileId.java index e4ba08a9de..31f3c201e4 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileId.java +++ b/sdk/src/main/java/com/hiero/sdk/FileId.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.FileID; - +import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; -import java.util.Objects; /** * The ID for a file on Hedera. @@ -57,6 +38,7 @@ public final class FileId implements Comparable { */ @Nonnegative public final long num; + @Nullable private final String checksum; @@ -149,14 +131,14 @@ public String toSolidityAddress() { } /** - * @return protobuf representing the file id + * @return protobuf representing the file id */ FileID toProtobuf() { return FileID.newBuilder() - .setShardNum(shard) - .setRealmNum(realm) - .setFileNum(num) - .build(); + .setShardNum(shard) + .setRealmNum(realm) + .setFileNum(num) + .build(); } /** @@ -219,7 +201,7 @@ public int hashCode() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/FileInfo.java b/sdk/src/main/java/com/hiero/sdk/FileInfo.java index 0c9e64c0ce..1790ca51fd 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/FileInfo.java @@ -1,29 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.FileGetInfoResponse; import java.time.Instant; - import javax.annotation.Nullable; /** @@ -70,14 +51,13 @@ public final class FileInfo { public final LedgerId ledgerId; private FileInfo( - FileId fileId, - long size, - Instant expirationTime, - boolean isDeleted, - @Nullable KeyList keys, - String fileMemo, - LedgerId ledgerId - ) { + FileId fileId, + long size, + Instant expirationTime, + boolean isDeleted, + @Nullable KeyList keys, + String fileMemo, + LedgerId ledgerId) { this.fileId = fileId; this.size = size; this.expirationTime = expirationTime; @@ -94,19 +74,16 @@ private FileInfo( * @return the new file info object */ static FileInfo fromProtobuf(FileGetInfoResponse.FileInfo fileInfo) { - @Nullable KeyList keys = fileInfo.hasKeys() ? - KeyList.fromProtobuf(fileInfo.getKeys(), null) : - null; + @Nullable KeyList keys = fileInfo.hasKeys() ? KeyList.fromProtobuf(fileInfo.getKeys(), null) : null; return new FileInfo( - FileId.fromProtobuf(fileInfo.getFileID()), - fileInfo.getSize(), - InstantConverter.fromProtobuf(fileInfo.getExpirationTime()), - fileInfo.getDeleted(), - keys, - fileInfo.getMemo(), - LedgerId.fromByteString(fileInfo.getLedgerId()) - ); + FileId.fromProtobuf(fileInfo.getFileID()), + fileInfo.getSize(), + InstantConverter.fromProtobuf(fileInfo.getExpirationTime()), + fileInfo.getDeleted(), + keys, + fileInfo.getMemo(), + LedgerId.fromByteString(fileInfo.getLedgerId())); } /** @@ -117,7 +94,8 @@ static FileInfo fromProtobuf(FileGetInfoResponse.FileInfo fileInfo) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static FileInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(FileGetInfoResponse.FileInfo.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + FileGetInfoResponse.FileInfo.parseFrom(bytes).toBuilder().build()); } /** @@ -127,12 +105,12 @@ public static FileInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferExcep */ FileGetInfoResponse.FileInfo toProtobuf() { var fileInfoBuilder = FileGetInfoResponse.FileInfo.newBuilder() - .setFileID(fileId.toProtobuf()) - .setSize(size) - .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) - .setDeleted(isDeleted) - .setMemo(fileMemo) - .setLedgerId(ledgerId.toByteString()); + .setFileID(fileId.toProtobuf()) + .setSize(size) + .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) + .setDeleted(isDeleted) + .setMemo(fileMemo) + .setLedgerId(ledgerId.toByteString()); if (keys != null) { var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); @@ -150,14 +128,14 @@ FileGetInfoResponse.FileInfo toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("fileId", fileId) - .add("size", size) - .add("expirationTime", expirationTime) - .add("isDeleted", isDeleted) - .add("keys", keys) - .add("fileMemo", fileMemo) - .add("ledgerId", ledgerId) - .toString(); + .add("fileId", fileId) + .add("size", size) + .add("expirationTime", expirationTime) + .add("isDeleted", isDeleted) + .add("keys", keys) + .add("fileMemo", fileMemo) + .add("ledgerId", ledgerId) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java index 74e6bf8a5b..10f68ef9ab 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.FileGetInfoQuery; @@ -47,8 +29,7 @@ public final class FileInfoQuery extends Query { /** * Constructor. */ - public FileInfoQuery() { - } + public FileInfoQuery() {} /** * Extract the file id. diff --git a/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java index 36b9b20e5e..fad3013ac4 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -28,15 +10,14 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; -import java.time.Instant; - -import javax.annotation.Nullable; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Updates a file by submitting the transaction. @@ -47,19 +28,22 @@ public final class FileUpdateTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + FileUpdateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -109,7 +94,7 @@ public FileUpdateTransaction setFileId(FileId fileId) { /** * Get the keys which must sign any transactions modifying this file. * - * @return the list of keys + * @return the list of keys */ @Nullable public Collection getKeys() { diff --git a/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java b/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java index 1678983282..4fb3126328 100644 --- a/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -30,11 +12,10 @@ import java.time.Instant; import java.time.OffsetTime; import java.time.ZoneOffset; - -import javax.annotation.Nullable; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Set the freezing period in which the platform will stop creating events and accepting transactions. @@ -43,18 +24,20 @@ public final class FreezeTransaction extends Transaction { private int endHour = 0; private int endMinute = 0; + @Nullable private Instant startTime = null; + @Nullable private FileId fileId = null; + private byte[] fileHash = {}; private FreezeType freezeType = FreezeType.UNKNOWN_FREEZE_TYPE; /** * Constructor. */ - public FreezeTransaction() { - } + public FreezeTransaction() {} /** * Constructor. @@ -63,7 +46,8 @@ public FreezeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + FreezeTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -108,7 +92,7 @@ public FreezeTransaction setStartTime(Instant startTime) { */ @Deprecated public FreezeTransaction setStartTime(int hour, int minute) { - return setStartTime(Instant.ofEpochMilli(((long)hour * 60 * 60 + (long)minute * 60) * 1000)); + return setStartTime(Instant.ofEpochMilli(((long) hour * 60 * 60 + (long) minute * 60) * 1000)); } /** @@ -191,7 +175,7 @@ public FileId getFileId() { /** * Assign the file id. * - * @param fileId the file id + * @param fileId the file id * @return {@code this} */ public FreezeTransaction setFileId(FileId fileId) { @@ -247,8 +231,7 @@ public FreezeTransaction setFreezeType(FreezeType freezeType) { } @Override - void validateChecksums(Client client) { - } + void validateChecksums(Client client) {} @Override MethodDescriptor getMethodDescriptor() { diff --git a/sdk/src/main/java/com/hiero/sdk/FreezeType.java b/sdk/src/main/java/com/hiero/sdk/FreezeType.java index a8376dbd63..1a1fe0bd87 100644 --- a/sdk/src/main/java/com/hiero/sdk/FreezeType.java +++ b/sdk/src/main/java/com/hiero/sdk/FreezeType.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** @@ -76,8 +58,8 @@ static FreezeType valueOf(com.hiero.sdk.proto.FreezeType code) { case FREEZE_ABORT -> FREEZE_ABORT; case TELEMETRY_UPGRADE -> TELEMETRY_UPGRADE; case UNRECOGNIZED -> - // NOTE: Protobuf deserialization will not give us the code on the wire - throw new IllegalArgumentException( + // NOTE: Protobuf deserialization will not give us the code on the wire + throw new IllegalArgumentException( "network returned unrecognized response code; your SDK may be out of date"); }; } diff --git a/sdk/src/main/java/com/hiero/sdk/FutureConverter.java b/sdk/src/main/java/com/hiero/sdk/FutureConverter.java index 4006d78ca3..e691b6be6c 100644 --- a/sdk/src/main/java/com/hiero/sdk/FutureConverter.java +++ b/sdk/src/main/java/com/hiero/sdk/FutureConverter.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.util.concurrent.FutureCallback; @@ -24,19 +6,17 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; - import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.function.Consumer; // Converts between ListenableFuture (Guava) and CompletableFuture (StreamSupport). // https://github.com/lukas-krecan/future-converter/blob/master/java8-guava/src/main/java/net/javacrumbs/futureconverter/java8guava/FutureConverter.java#L28 final class FutureConverter { - private FutureConverter() { - } + private FutureConverter() {} /** * Generate a T object from a listenable future. @@ -45,8 +25,7 @@ private FutureConverter() { * @return the T type object */ static CompletableFuture toCompletableFuture(ListenableFuture listenableFuture) { - return Java8FutureUtils.createCompletableFuture( - GuavaFutureUtils.createValueSourceFuture(listenableFuture)); + return Java8FutureUtils.createCompletableFuture(GuavaFutureUtils.createValueSourceFuture(listenableFuture)); } // https://github.com/lukas-krecan/future-converter/blob/master/common/src/main/java/net/javacrumbs/futureconverter/common/internal/ValueSource.java @@ -57,8 +36,7 @@ private interface ValueSource { } // https://github.com/lukas-krecan/future-converter/blob/master/common/src/main/java/net/javacrumbs/futureconverter/common/internal/ValueSourceFuture.java - private abstract static class ValueSourceFuture extends FutureWrapper - implements ValueSource { + private abstract static class ValueSourceFuture extends FutureWrapper implements ValueSource { ValueSourceFuture(Future wrappedFuture) { super(wrappedFuture); } @@ -93,8 +71,7 @@ public T get() throws InterruptedException, ExecutionException { } @Override - public T get(long timeout, TimeUnit unit) - throws InterruptedException, ExecutionException, TimeoutException { + public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return wrappedFuture.get(timeout, unit); } @@ -105,18 +82,16 @@ Future getWrappedFuture() { // https://github.com/lukas-krecan/future-converter/blob/master/guava-common/src/main/java/net/javacrumbs/futureconverter/guavacommon/GuavaFutureUtils.java private static class GuavaFutureUtils { - public static ValueSourceFuture createValueSourceFuture( - ListenableFuture listenableFuture) { + public static ValueSourceFuture createValueSourceFuture(ListenableFuture listenableFuture) { if (listenableFuture instanceof ValueSourceFutureBackedListenableFuture) { - return ((ValueSourceFutureBackedListenableFuture) listenableFuture) - .getWrappedFuture(); + return ((ValueSourceFutureBackedListenableFuture) listenableFuture).getWrappedFuture(); } else { return new ListenableFutureBackedValueSourceFuture<>(listenableFuture); } } private static class ValueSourceFutureBackedListenableFuture extends FutureWrapper - implements ListenableFuture { + implements ListenableFuture { ValueSourceFutureBackedListenableFuture(ValueSourceFuture valueSourceFuture) { super(valueSourceFuture); } @@ -128,36 +103,31 @@ ValueSourceFuture getWrappedFuture() { @Override public void addListener(Runnable listener, Executor executor) { - getWrappedFuture() - .addCallbacks( - value -> executor.execute(listener), - ex -> executor.execute(listener)); + getWrappedFuture().addCallbacks(value -> executor.execute(listener), ex -> executor.execute(listener)); } } - private static class ListenableFutureBackedValueSourceFuture - extends ValueSourceFuture { + private static class ListenableFutureBackedValueSourceFuture extends ValueSourceFuture { private ListenableFutureBackedValueSourceFuture(ListenableFuture wrappedFuture) { super(wrappedFuture); } @Override - public void addCallbacks( - Consumer successCallback, Consumer failureCallback) { + public void addCallbacks(Consumer successCallback, Consumer failureCallback) { Futures.addCallback( - getWrappedFuture(), - new FutureCallback() { - @Override - public void onSuccess(T result) { - successCallback.accept(result); - } - - @Override - public void onFailure(Throwable t) { - failureCallback.accept(t); - } - }, - MoreExecutors.directExecutor()); + getWrappedFuture(), + new FutureCallback() { + @Override + public void onSuccess(T result) { + successCallback.accept(result); + } + + @Override + public void onFailure(Throwable t) { + failureCallback.accept(t); + } + }, + MoreExecutors.directExecutor()); } @Override @@ -177,8 +147,7 @@ public static CompletableFuture createCompletableFuture(ValueSource va } } - private static final class ValueSourceBackedCompletableFuture - extends CompletableFuture { + private static final class ValueSourceBackedCompletableFuture extends CompletableFuture { private final ValueSource valueSource; @SuppressWarnings("ConstructorLeaksThis") @@ -198,24 +167,20 @@ public boolean cancel(boolean mayInterruptIfRunning) { } } - private static final class CompletableFutureBackedValueSource - extends ValueSourceFuture { + private static final class CompletableFutureBackedValueSource extends ValueSourceFuture { private CompletableFutureBackedValueSource(CompletableFuture completableFuture) { super(completableFuture); } @Override - public void addCallbacks( - Consumer successCallback, Consumer failureCallback) { - getWrappedFuture() - .whenComplete( - (v, t) -> { - if (t == null) { - successCallback.accept(v); - } else { - failureCallback.accept(t); - } - }); + public void addCallbacks(Consumer successCallback, Consumer failureCallback) { + getWrappedFuture().whenComplete((v, t) -> { + if (t == null) { + successCallback.accept(v); + } else { + failureCallback.accept(t); + } + }); } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/Hbar.java b/sdk/src/main/java/com/hiero/sdk/Hbar.java index a621db40dc..8110273588 100644 --- a/sdk/src/main/java/com/hiero/sdk/Hbar.java +++ b/sdk/src/main/java/com/hiero/sdk/Hbar.java @@ -1,27 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.Splitter; - -import javax.annotation.Nullable; import java.math.BigDecimal; import java.math.MathContext; import java.util.Objects; @@ -46,7 +26,9 @@ public final class Hbar implements Comparable { * A constant value of the minimum number of hbars. */ public static final Hbar MIN = Hbar.from(-50_000_000_000L); - private static final Pattern FROM_STRING_PATTERN = Pattern.compile("^((?:\\+|\\-)?\\d+(?:\\.\\d+)?)(\\ (tℏ|μℏ|mℏ|ℏ|kℏ|Mℏ|Gℏ))?$"); + + private static final Pattern FROM_STRING_PATTERN = + Pattern.compile("^((?:\\+|\\-)?\\d+(?:\\.\\d+)?)(\\ (tℏ|μℏ|mℏ|ℏ|kℏ|Mℏ|Gℏ))?$"); private final long valueInTinybar; /** @@ -93,7 +75,8 @@ public Hbar(BigDecimal amount) { var tinybars = amount.multiply(BigDecimal.valueOf(unit.tinybar)); if (tinybars.doubleValue() % 1 != 0) { - throw new IllegalArgumentException("Amount and Unit combination results in a fractional value for tinybar. Ensure tinybar value is a whole number."); + throw new IllegalArgumentException( + "Amount and Unit combination results in a fractional value for tinybar. Ensure tinybar value is a whole number."); } valueInTinybar = tinybars.longValue(); @@ -105,7 +88,8 @@ private static HbarUnit getUnit(String symbolString) { return unit; } } - throw new IllegalArgumentException("Attempted to convert string to Hbar, but unit symbol \"" + symbolString + "\" was not recognized"); + throw new IllegalArgumentException( + "Attempted to convert string to Hbar, but unit symbol \"" + symbolString + "\" was not recognized"); } /** @@ -117,7 +101,8 @@ private static HbarUnit getUnit(String symbolString) { public static Hbar fromString(CharSequence text) { var matcher = FROM_STRING_PATTERN.matcher(text); if (!matcher.matches()) { - throw new IllegalArgumentException("Attempted to convert string to Hbar, but \"" + text + "\" was not correctly formatted"); + throw new IllegalArgumentException( + "Attempted to convert string to Hbar, but \"" + text + "\" was not correctly formatted"); } var parts = Splitter.on(' ').splitToList(text.toString()); return new Hbar(new BigDecimal(parts.get(0)), parts.size() == 2 ? getUnit(parts.get(1)) : HbarUnit.HBAR); @@ -243,7 +228,7 @@ public String toString(HbarUnit unit) { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java b/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java index 01bbf159ca..c35c49314e 100644 --- a/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java +++ b/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java @@ -1,31 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.CryptoAllowance; import com.hiero.sdk.proto.GrantedCryptoAllowance; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * An approved allowance of hbar transfers for a spender. @@ -72,10 +53,9 @@ public class HbarAllowance { */ static HbarAllowance fromProtobuf(CryptoAllowance allowanceProto) { return new HbarAllowance( - allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, - allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, - Hbar.fromTinybars(allowanceProto.getAmount()) - ); + allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, + allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, + Hbar.fromTinybars(allowanceProto.getAmount())); } /** @@ -86,10 +66,9 @@ static HbarAllowance fromProtobuf(CryptoAllowance allowanceProto) { */ static HbarAllowance fromProtobuf(GrantedCryptoAllowance allowanceProto) { return new HbarAllowance( - null, - allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, - Hbar.fromTinybars(allowanceProto.getAmount()) - ); + null, + allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, + Hbar.fromTinybars(allowanceProto.getAmount())); } /** @@ -124,8 +103,7 @@ void validateChecksums(Client client) throws BadEntityIdException { * @return the protobuf */ CryptoAllowance toProtobuf() { - var builder = CryptoAllowance.newBuilder() - .setAmount(amount.toTinybars()); + var builder = CryptoAllowance.newBuilder().setAmount(amount.toTinybars()); if (ownerAccountId != null) { builder.setOwner(ownerAccountId.toProtobuf()); } @@ -141,8 +119,7 @@ CryptoAllowance toProtobuf() { * @return the granted crypto allowance */ GrantedCryptoAllowance toGrantedProtobuf() { - var builder = GrantedCryptoAllowance.newBuilder() - .setAmount(amount.toTinybars()); + var builder = GrantedCryptoAllowance.newBuilder().setAmount(amount.toTinybars()); if (spenderAccountId != null) { builder.setSpender(spenderAccountId.toProtobuf()); } @@ -161,9 +138,9 @@ public byte[] toBytes() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("ownerAccountId", ownerAccountId) - .add("spenderAccountId", spenderAccountId) - .add("amount", amount) - .toString(); + .add("ownerAccountId", ownerAccountId) + .add("spenderAccountId", spenderAccountId) + .add("amount", amount) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/HbarUnit.java b/sdk/src/main/java/com/hiero/sdk/HbarUnit.java index 6bb56a6453..428ef7f1f2 100644 --- a/sdk/src/main/java/com/hiero/sdk/HbarUnit.java +++ b/sdk/src/main/java/com/hiero/sdk/HbarUnit.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java b/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java index 155770948e..79b0be8b10 100644 --- a/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java b/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java index 7160f91dc7..a8fd715e27 100644 --- a/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java b/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java index 35029fd2e6..44a7dc6263 100644 --- a/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java +++ b/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java @@ -1,33 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; -import org.bouncycastle.util.encoders.Hex; -import org.bouncycastle.util.io.pem.PemObject; -import org.bouncycastle.util.io.pem.PemWriter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.annotation.Nullable; -import javax.net.ssl.X509TrustManager; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; @@ -36,6 +10,13 @@ import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; +import javax.annotation.Nullable; +import javax.net.ssl.X509TrustManager; +import org.bouncycastle.util.encoders.Hex; +import org.bouncycastle.util.io.pem.PemObject; +import org.bouncycastle.util.io.pem.PemWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Internal class used by node. @@ -58,7 +39,8 @@ class HederaTrustManager implements X509TrustManager { HederaTrustManager(@Nullable ByteString certHash, boolean verifyCertificate) { if (certHash == null || certHash.isEmpty()) { if (verifyCertificate) { - throw new IllegalStateException("transport security and certificate verification are enabled, but no applicable address book was found"); + throw new IllegalStateException( + "transport security and certificate verification are enabled, but no applicable address book was found"); } logger.warn("skipping certificate check since no cert hash was found"); @@ -70,7 +52,8 @@ class HederaTrustManager implements X509TrustManager { @Override public void checkClientTrusted(X509Certificate[] chain, String authType) { - throw new UnsupportedOperationException("Attempted to use HederaTrustManager to verify a client, but this trust manager is for verifying server only"); + throw new UnsupportedOperationException( + "Attempted to use HederaTrustManager to verify a client, but this trust manager is for verifying server only"); } @Override @@ -82,10 +65,8 @@ public void checkServerTrusted(X509Certificate[] chain, String authType) throws for (var cert : chain) { byte[] pem; - try ( - var outputStream = new ByteArrayOutputStream(); - var pemWriter = new PemWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) - ) { + try (var outputStream = new ByteArrayOutputStream(); + var pemWriter = new PemWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))) { pemWriter.writeObject(new PemObject(CERTIFICATE, cert.getEncoded())); pemWriter.flush(); diff --git a/sdk/src/main/java/com/hiero/sdk/InstantConverter.java b/sdk/src/main/java/com/hiero/sdk/InstantConverter.java index 7d7887bbc9..561f2a258f 100644 --- a/sdk/src/main/java/com/hiero/sdk/InstantConverter.java +++ b/sdk/src/main/java/com/hiero/sdk/InstantConverter.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Timestamp; @@ -31,8 +13,7 @@ final class InstantConverter { /** * Constructor. */ - private InstantConverter() { - } + private InstantConverter() {} /** * Create an instance from a timestamp protobuf. @@ -62,16 +43,16 @@ static Instant fromProtobuf(TimestampSeconds timestampSeconds) { */ static Timestamp toProtobuf(Instant instant) { return Timestamp.newBuilder() - .setSeconds(instant.getEpochSecond()) - .setNanos(instant.getNano()) - .build(); + .setSeconds(instant.getEpochSecond()) + .setNanos(instant.getNano()) + .build(); } static Timestamp toProtobuf(Duration duration) { return Timestamp.newBuilder() - .setSeconds(duration.getSeconds()) - .setNanos(duration.getNano()) - .build(); + .setSeconds(duration.getSeconds()) + .setNanos(duration.getNano()) + .build(); } /** @@ -82,7 +63,7 @@ static Timestamp toProtobuf(Duration duration) { */ static TimestampSeconds toSecondsProtobuf(Instant instant) { return TimestampSeconds.newBuilder() - .setSeconds(instant.getEpochSecond()) - .build(); + .setSeconds(instant.getEpochSecond()) + .build(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/Key.java b/sdk/src/main/java/com/hiero/sdk/Key.java index 29b5dc7a22..a9152141b7 100644 --- a/sdk/src/main/java/com/hiero/sdk/Key.java +++ b/sdk/src/main/java/com/hiero/sdk/Key.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -38,13 +20,11 @@ public abstract class Key { static final ASN1ObjectIdentifier ID_EC_PUBLIC_KEY = new ASN1ObjectIdentifier("1.2.840.10045.2.1"); static final X9ECParameters ECDSA_SECP256K1_CURVE = SECNamedCurves.getByName("secp256k1"); - static final ECDomainParameters ECDSA_SECP256K1_DOMAIN = - new ECDomainParameters( + static final ECDomainParameters ECDSA_SECP256K1_DOMAIN = new ECDomainParameters( ECDSA_SECP256K1_CURVE.getCurve(), ECDSA_SECP256K1_CURVE.getG(), ECDSA_SECP256K1_CURVE.getN(), - ECDSA_SECP256K1_CURVE.getH() - ); + ECDSA_SECP256K1_CURVE.getH()); /** * Create a specific key type from the protobuf. @@ -61,14 +41,16 @@ static Key fromProtobufKey(com.hiero.sdk.proto.Key key) { if (key.getECDSASecp256K1().size() == 20) { return new EvmAddress(key.getECDSASecp256K1().toByteArray()); } else { - return PublicKeyECDSA.fromBytesInternal(key.getECDSASecp256K1().toByteArray()); + return PublicKeyECDSA.fromBytesInternal( + key.getECDSASecp256K1().toByteArray()); } } case KEYLIST -> { return KeyList.fromProtobuf(key.getKeyList(), null); } case THRESHOLDKEY -> { - return KeyList.fromProtobuf(key.getThresholdKey().getKeys(), key.getThresholdKey().getThreshold()); + return KeyList.fromProtobuf( + key.getThresholdKey().getKeys(), key.getThresholdKey().getThreshold()); } case CONTRACTID -> { return ContractId.fromProtobuf(key.getContractID()); diff --git a/sdk/src/main/java/com/hiero/sdk/KeyList.java b/sdk/src/main/java/com/hiero/sdk/KeyList.java index 8df42806a0..2c3fba5e89 100644 --- a/sdk/src/main/java/com/hiero/sdk/KeyList.java +++ b/sdk/src/main/java/com/hiero/sdk/KeyList.java @@ -1,34 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.hiero.sdk.proto.ThresholdKey; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * A list of keys that are required to sign in unison, with an optional threshold controlling how many keys of @@ -202,15 +183,12 @@ com.hiero.sdk.proto.Key toProtobufKey() { if (threshold != null) { return com.hiero.sdk.proto.Key.newBuilder() - .setThresholdKey(ThresholdKey.newBuilder() - .setThreshold(threshold) - .setKeys(protoKeyList)) - .build(); + .setThresholdKey( + ThresholdKey.newBuilder().setThreshold(threshold).setKeys(protoKeyList)) + .build(); } - return com.hiero.sdk.proto.Key.newBuilder() - .setKeyList(protoKeyList) - .build(); + return com.hiero.sdk.proto.Key.newBuilder().setKeyList(protoKeyList).build(); } /** @@ -231,13 +209,13 @@ com.hiero.sdk.proto.KeyList toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("threshold", threshold) - .add("keys", keys) - .toString(); + .add("threshold", threshold) + .add("keys", keys) + .toString(); } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/Keystore.java b/sdk/src/main/java/com/hiero/sdk/Keystore.java index 44a2c2f1b8..2b764be951 100644 --- a/sdk/src/main/java/com/hiero/sdk/Keystore.java +++ b/sdk/src/main/java/com/hiero/sdk/Keystore.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.gson.Gson; @@ -25,10 +7,6 @@ import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import com.google.gson.stream.JsonWriter; -import java.util.Optional; -import org.bouncycastle.crypto.params.KeyParameter; -import org.bouncycastle.util.encoders.Hex; - import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -37,6 +15,9 @@ import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.Objects; +import java.util.Optional; +import org.bouncycastle.crypto.params.KeyParameter; +import org.bouncycastle.util.encoders.Hex; /** * Internal utility class to serialize / deserialize between java object / json representation. @@ -57,8 +38,9 @@ public Keystore(PrivateKey privateKey) { public static Keystore fromStream(InputStream stream, String passphrase) throws IOException { try { - JsonObject jsonObject = jsonParser.parse(new InputStreamReader(stream, StandardCharsets.UTF_8)) - .getAsJsonObject(); + JsonObject jsonObject = jsonParser + .parse(new InputStreamReader(stream, StandardCharsets.UTF_8)) + .getAsJsonObject(); return fromJson(jsonObject, passphrase); } catch (IllegalStateException e) { throw new BadKeyException(Optional.ofNullable(e.getMessage()).orElse("failed to parse Keystore")); diff --git a/sdk/src/main/java/com/hiero/sdk/LedgerId.java b/sdk/src/main/java/com/hiero/sdk/LedgerId.java index dcaaf3529d..547a02273d 100644 --- a/sdk/src/main/java/com/hiero/sdk/LedgerId.java +++ b/sdk/src/main/java/com/hiero/sdk/LedgerId.java @@ -1,50 +1,30 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; -import org.bouncycastle.util.encoders.Hex; - -import javax.annotation.Nullable; import java.util.Arrays; +import org.bouncycastle.util.encoders.Hex; /** * Internal utility class for ledger id manipulation. */ public class LedgerId { - final private byte[] idBytes; + private final byte[] idBytes; /** * The mainnet ledger id */ - public final static LedgerId MAINNET = new LedgerId(new byte[]{0}); + public static final LedgerId MAINNET = new LedgerId(new byte[] {0}); /** * The testnet ledger id */ - public final static LedgerId TESTNET = new LedgerId(new byte[]{1}); + public static final LedgerId TESTNET = new LedgerId(new byte[] {1}); /** * The previewnet ledger id */ - public final static LedgerId PREVIEWNET = new LedgerId(new byte[]{2}); + public static final LedgerId PREVIEWNET = new LedgerId(new byte[] {2}); /** * Constructor. @@ -204,7 +184,7 @@ public NetworkName toNetworkName() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHash.java b/sdk/src/main/java/com/hiero/sdk/LiveHash.java index ff283bee1c..b262bc7510 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHash.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHash.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -78,11 +60,10 @@ private LiveHash(AccountId accountId, ByteString hash, KeyList keys, Duration du */ protected static LiveHash fromProtobuf(com.hiero.sdk.proto.LiveHash liveHash) { return new LiveHash( - AccountId.fromProtobuf(liveHash.getAccountId()), - liveHash.getHash(), - KeyList.fromProtobuf(liveHash.getKeys(), null), - DurationConverter.fromProtobuf(liveHash.getDuration()) - ); + AccountId.fromProtobuf(liveHash.getAccountId()), + liveHash.getHash(), + KeyList.fromProtobuf(liveHash.getKeys(), null), + DurationConverter.fromProtobuf(liveHash.getDuration())); } /** @@ -93,7 +74,8 @@ protected static LiveHash fromProtobuf(com.hiero.sdk.proto.LiveHash liveHash) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static LiveHash fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.LiveHash.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.LiveHash.parseFrom(bytes).toBuilder().build()); } /** @@ -108,11 +90,11 @@ protected com.hiero.sdk.proto.LiveHash toProtobuf() { } return com.hiero.sdk.proto.LiveHash.newBuilder() - .setAccountId(accountId.toProtobuf()) - .setHash(hash) - .setKeys(keyList) - .setDuration(DurationConverter.toProtobuf(duration)) - .build(); + .setAccountId(accountId.toProtobuf()) + .setHash(hash) + .setKeys(keyList) + .setDuration(DurationConverter.toProtobuf(duration)) + .build(); } /** @@ -127,10 +109,10 @@ public ByteString toBytes() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("accountId", accountId) - .add("hash", hash.toByteArray()) - .add("keys", keys) - .add("duration", duration) - .toString(); + .add("accountId", accountId) + .add("hash", hash.toByteArray()) + .add("keys", keys) + .add("duration", duration) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java b/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java index 10d1130979..5d0cbadef8 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -29,13 +11,12 @@ import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; - -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * A hash---presumably of some kind of credential or certificate---along with a list of keys, @@ -44,17 +25,19 @@ public final class LiveHashAddTransaction extends Transaction { @Nullable private AccountId accountId = null; + private byte[] hash = {}; + @Nullable private KeyList keys = null; + @Nullable private Duration duration = null; /** * Constructor. */ - public LiveHashAddTransaction() { - } + public LiveHashAddTransaction() {} /** * Constructor. @@ -63,7 +46,8 @@ public LiveHashAddTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - LiveHashAddTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + LiveHashAddTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java index 1094fda0a9..12f223d6dc 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -27,11 +9,10 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * At consensus, deletes a livehash associated to the given account. The transaction must be signed @@ -40,13 +21,13 @@ public final class LiveHashDeleteTransaction extends Transaction { @Nullable private AccountId accountId = null; + private byte[] hash = {}; /** * Constructor. */ - public LiveHashDeleteTransaction() { - } + public LiveHashDeleteTransaction() {} /** * Constructor. @@ -55,7 +36,9 @@ public LiveHashDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - LiveHashDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + LiveHashDeleteTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java b/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java index fd176e1d13..30eaf31e00 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Objects; +import javax.annotation.Nullable; /** * Requests a livehash associated to an account. @@ -37,13 +18,13 @@ public final class LiveHashQuery extends Query { @Nullable private AccountId accountId = null; + private byte[] hash = {}; /** * Constructor. */ - public LiveHashQuery() { - } + public LiveHashQuery() {} /** * Extract the account id. diff --git a/sdk/src/main/java/com/hiero/sdk/LockableList.java b/sdk/src/main/java/com/hiero/sdk/LockableList.java index 69e9644c77..5750bf47c8 100644 --- a/sdk/src/main/java/com/hiero/sdk/LockableList.java +++ b/sdk/src/main/java/com/hiero/sdk/LockableList.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.*; @@ -34,8 +16,7 @@ class LockableList implements Iterable { /** * Constructor. */ - LockableList() { - } + LockableList() {} /** * Assign a list of items to this list instance. @@ -94,7 +75,7 @@ ArrayList getList() { * @param elements the items to add * @return the updated list */ - LockableList add(T ...elements) { + LockableList add(T... elements) { requireNotLocked(); for (var e : elements) { diff --git a/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java b/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java index 5af1b08559..cd31275cd4 100644 --- a/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java +++ b/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java b/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java index e17a57c85d..f4aa8c362a 100644 --- a/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java +++ b/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** @@ -43,11 +25,8 @@ public final class MaxQueryPaymentExceededException extends RuntimeException { */ MaxQueryPaymentExceededException(Query builder, Hbar cost, Hbar maxQueryPayment) { super(String.format( - "cost for %s, of %s, without explicit payment is greater than " - + "the maximum allowed payment of %s", - builder.getClass().getSimpleName(), - cost, - maxQueryPayment)); + "cost for %s, of %s, without explicit payment is greater than " + "the maximum allowed payment of %s", + builder.getClass().getSimpleName(), cost, maxQueryPayment)); this.queryCost = cost; this.maxQueryPayment = maxQueryPayment; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java b/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java index 208ce0b163..4f1c08e2c9 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.ArrayList; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNode.java b/sdk/src/main/java/com/hiero/sdk/MirrorNode.java index ae3e995f53..d049f08ce5 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNode.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNode.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.concurrent.ExecutorService; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java index 84fb837570..de2f3894fa 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.concurrent.ExecutionException; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java index 66bbb9fd8b..361977f9f0 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.util.concurrent.ExecutionException; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java index 64efd0ef86..d633595772 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static com.hiero.sdk.EntityIdHelper.getContractAddressFromMirrorNodeAsync; @@ -268,38 +249,55 @@ protected String call(Client client) throws ExecutionException, InterruptedExcep private void fillEvmAddresses(Client client) throws ExecutionException, InterruptedException { if (this.contractEvmAddress == null) { Objects.requireNonNull(this.contractId); - this.contractEvmAddress = getContractAddressFromMirrorNodeAsync(client, this.contractId.toString()).get(); + this.contractEvmAddress = getContractAddressFromMirrorNodeAsync(client, this.contractId.toString()) + .get(); } if (this.senderEvmAddress == null && this.sender != null) { - this.senderEvmAddress = getEvmAddressFromMirrorNodeAsync(client, this.sender.num).get().toString(); + this.senderEvmAddress = getEvmAddressFromMirrorNodeAsync(client, this.sender.num) + .get() + .toString(); } } private CompletableFuture getContractCallResultFromMirrorNodeAsync(Client client, String blockNumber) { return executeMirrorNodeRequest(client, blockNumber, false) - .thenApply(MirrorNodeContractQuery::parseContractCallResult); + .thenApply(MirrorNodeContractQuery::parseContractCallResult); } private CompletableFuture getEstimateGasFromMirrorNodeAsync(Client client) { return executeMirrorNodeRequest(client, "latest", true) - .thenApply(MirrorNodeContractQuery::parseHexEstimateToLong); + .thenApply(MirrorNodeContractQuery::parseHexEstimateToLong); } private CompletableFuture executeMirrorNodeRequest(Client client, String blockNumber, boolean estimate) { String apiEndpoint = "/contracts/call"; - String jsonPayload = createJsonPayload(this.callData, this.senderEvmAddress, this.contractEvmAddress, - this.gasLimit, this.gasPrice, this.value, blockNumber, estimate); + String jsonPayload = createJsonPayload( + this.callData, + this.senderEvmAddress, + this.contractEvmAddress, + this.gasLimit, + this.gasPrice, + this.value, + blockNumber, + estimate); return performQueryToMirrorNodeAsync(client, apiEndpoint, jsonPayload, true) - .exceptionally(ex -> { - client.getLogger().error("Error while performing post request to Mirror Node: " + ex.getMessage()); - throw new CompletionException(ex); - }); + .exceptionally(ex -> { + client.getLogger().error("Error while performing post request to Mirror Node: " + ex.getMessage()); + throw new CompletionException(ex); + }); } - static String createJsonPayload(byte[] data, String senderAddress, String contractAddress, long gas, long gasPrice, - long value, String blockNumber, boolean estimate) { + static String createJsonPayload( + byte[] data, + String senderAddress, + String contractAddress, + long gas, + long gasPrice, + long value, + String blockNumber, + boolean estimate) { String hexData = Hex.toHexString(data); JsonObject jsonObject = new JsonObject(); @@ -336,16 +334,15 @@ static long parseHexEstimateToLong(String responseBody) { @Override public String toString() { - return "{" + - "contractId=" + contractId + - ", contractEvmAddress='" + contractEvmAddress + '\'' + - ", sender=" + sender + - ", senderEvmAddress='" + senderEvmAddress + '\'' + - ", callData=" + Arrays.toString(callData) + - ", value=" + value + - ", gasLimit=" + gasLimit + - ", gasPrice=" + gasPrice + - ", blockNumber=" + blockNumber + - '}'; + return "{" + "contractId=" + + contractId + ", contractEvmAddress='" + + contractEvmAddress + '\'' + ", sender=" + + sender + ", senderEvmAddress='" + + senderEvmAddress + '\'' + ", callData=" + + Arrays.toString(callData) + ", value=" + + value + ", gasLimit=" + + gasLimit + ", gasPrice=" + + gasPrice + ", blockNumber=" + + blockNumber + '}'; } } diff --git a/sdk/src/main/java/com/hiero/sdk/Mnemonic.java b/sdk/src/main/java/com/hiero/sdk/Mnemonic.java index 1d322d3b27..c4d158089f 100644 --- a/sdk/src/main/java/com/hiero/sdk/Mnemonic.java +++ b/sdk/src/main/java/com/hiero/sdk/Mnemonic.java @@ -1,32 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static java.nio.charset.StandardCharsets.UTF_8; + import com.google.common.base.Joiner; import com.hiero.sdk.utils.Bip32Utils; -import org.bouncycastle.crypto.digests.SHA256Digest; -import org.bouncycastle.crypto.digests.SHA512Digest; -import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator; -import org.bouncycastle.crypto.params.KeyParameter; - -import javax.annotation.Nullable; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -41,12 +19,15 @@ import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.function.Consumer; import java.util.function.Supplier; - -import static java.nio.charset.StandardCharsets.UTF_8; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.annotation.Nullable; +import org.bouncycastle.crypto.digests.SHA256Digest; +import org.bouncycastle.crypto.digests.SHA512Digest; +import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator; +import org.bouncycastle.crypto.params.KeyParameter; /** * BIP-39 24-word mnemonic phrases compatible with the Android and iOS mobile wallets. @@ -56,6 +37,7 @@ public final class Mnemonic { // but the implementation is meant to wait until free space is needed @Nullable private static SoftReference> bip39WordList = null; + @Nullable private static SoftReference> legacyWordList = null; @@ -205,24 +187,17 @@ private static int getWordIndex(CharSequence word, boolean isLegacy) { private static List getWordList(boolean isLegacy) { if (isLegacy) { return getSpecificWordList( - () -> legacyWordList, - () -> readWordList(true), - (newWordList) -> legacyWordList = newWordList - ); + () -> legacyWordList, () -> readWordList(true), (newWordList) -> legacyWordList = newWordList); } else { return getSpecificWordList( - () -> bip39WordList, - () -> readWordList(false), - (newWordList) -> bip39WordList = newWordList - ); + () -> bip39WordList, () -> readWordList(false), (newWordList) -> bip39WordList = newWordList); } } private static synchronized List getSpecificWordList( - Supplier>> getCurrentWordList, - Supplier> getNewWordList, - Consumer>> setCurrentWordList - ) { + Supplier>> getCurrentWordList, + Supplier> getNewWordList, + Consumer>> setCurrentWordList) { var localWordList = getCurrentWordList.get(); if (localWordList == null || localWordList.get() == null) { List words = getNewWordList.get(); @@ -237,7 +212,8 @@ private static synchronized List getSpecificWordList( private static List readWordList(boolean isLegacy) { if (isLegacy) { InputStream wordStream = Mnemonic.class.getClassLoader().getResourceAsStream("legacy-english.txt"); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(wordStream), UTF_8))) { + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(Objects.requireNonNull(wordStream), UTF_8))) { ArrayList words = new ArrayList<>(4096); for (String word = reader.readLine(); word != null; word = reader.readLine()) { @@ -249,7 +225,8 @@ private static List readWordList(boolean isLegacy) { } } else { InputStream wordStream = Mnemonic.class.getClassLoader().getResourceAsStream("bip39-english.txt"); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(wordStream), UTF_8))) { + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(Objects.requireNonNull(wordStream), UTF_8))) { ArrayList words = new ArrayList<>(2048); for (String word = reader.readLine(); word != null; word = reader.readLine()) { @@ -410,10 +387,7 @@ byte[] toSeed(String passphrase) { // BIP-39 seed generation PKCS5S2ParametersGenerator pbkdf2 = new PKCS5S2ParametersGenerator(new SHA512Digest()); - pbkdf2.init( - toString().getBytes(UTF_8), - salt.getBytes(UTF_8), - 2048); + pbkdf2.init(toString().getBytes(UTF_8), salt.getBytes(UTF_8), 2048); KeyParameter key = (KeyParameter) pbkdf2.generateDerivedParameters(512); return key.getKey(); @@ -422,8 +396,7 @@ byte[] toSeed(String passphrase) { private byte[] wordsToEntropyAndChecksum() { if (words.size() != 24 && words.size() != 12) { // should be checked in `validate()` - throw new IllegalStateException( - "(BUG) expected 24-word mnemonic, got " + words.size() + " words"); + throw new IllegalStateException("(BUG) expected 24-word mnemonic, got " + words.size() + " words"); } ByteBuffer buffer; if (words.size() == 12) { @@ -473,7 +446,7 @@ private byte[] wordsToLegacyEntropy() throws BadMnemonicException { for (var i = 0; i < data.length - 1; i += 1) { result[i] = data[i] ^ crc; } - //int to byte conversion + // int to byte conversion ByteBuffer byteBuffer = ByteBuffer.allocate(result.length * 4); IntBuffer intBuffer = byteBuffer.asIntBuffer(); intBuffer.put(result); @@ -487,7 +460,7 @@ private byte[] wordsToLegacyEntropy() throws BadMnemonicException { var i = 0; var j = 3; byte[] array2 = new byte[data.length - 1]; - //remove all the fill 0s + // remove all the fill 0s while (j < array.length) { array2[i] = array[j]; i++; @@ -550,7 +523,7 @@ public PrivateKey toStandardEd25519PrivateKey(String passphrase, int index) { var seed = this.toSeed(passphrase); PrivateKey derivedKey = PrivateKey.fromSeedED25519(seed); - for (int i : new int[]{44, 3030, 0, 0, index}) { + for (int i : new int[] {44, 3030, 0, 0, index}) { derivedKey = derivedKey.derive(i); } @@ -569,9 +542,7 @@ public PrivateKey toStandardEd25519PrivateKey(String passphrase, int index) { * e.g. "m/44'/60'/0'/0/0" * @return an array of integers designed to be used with PrivateKey#derive */ - private int[] calculateDerivationPathValues(String derivationPath) - throws IllegalArgumentException - { + private int[] calculateDerivationPathValues(String derivationPath) throws IllegalArgumentException { if (derivationPath == null || derivationPath.isEmpty()) { throw new IllegalArgumentException("Derivation path cannot be null or empty"); } @@ -642,12 +613,8 @@ private PrivateKey toStandardECDSAsecp256k1PrivateKeyImpl(String passphrase, int */ public PrivateKey toStandardECDSAsecp256k1PrivateKey(String passphrase, int index) { // Harden the first 3 indexes - final int[] derivationPathValues = new int[]{ - Bip32Utils.toHardenedIndex(44), - Bip32Utils.toHardenedIndex(3030), - Bip32Utils.toHardenedIndex(0), - 0, - index + final int[] derivationPathValues = new int[] { + Bip32Utils.toHardenedIndex(44), Bip32Utils.toHardenedIndex(3030), Bip32Utils.toHardenedIndex(0), 0, index }; return toStandardECDSAsecp256k1PrivateKeyImpl(passphrase, derivationPathValues); } diff --git a/sdk/src/main/java/com/hiero/sdk/Network.java b/sdk/src/main/java/com/hiero/sdk/Network.java index b8c97d1abd..8131d61406 100644 --- a/sdk/src/main/java/com/hiero/sdk/Network.java +++ b/sdk/src/main/java/com/hiero/sdk/Network.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.io.ByteStreams; @@ -80,8 +62,8 @@ static Network forNetwork(ExecutorService executor, Map netwo */ static Network forMainnet(ExecutorService executor) { var addressBook = getAddressBookForLedger(LedgerId.MAINNET); - HashMap network = addressBookToNetwork( - Objects.requireNonNull(addressBook).values()); + HashMap network = + addressBookToNetwork(Objects.requireNonNull(addressBook).values()); return new Network(executor, network).setLedgerIdInternal(LedgerId.MAINNET, addressBook); } @@ -93,8 +75,8 @@ static Network forMainnet(ExecutorService executor) { */ static Network forTestnet(ExecutorService executor) { var addressBook = getAddressBookForLedger(LedgerId.TESTNET); - HashMap network = addressBookToNetwork( - Objects.requireNonNull(addressBook).values()); + HashMap network = + addressBookToNetwork(Objects.requireNonNull(addressBook).values()); return new Network(executor, network).setLedgerIdInternal(LedgerId.TESTNET, addressBook); } @@ -106,8 +88,8 @@ static Network forTestnet(ExecutorService executor) { */ static Network forPreviewnet(ExecutorService executor) { var addressBook = getAddressBookForLedger(LedgerId.PREVIEWNET); - HashMap network = addressBookToNetwork( - Objects.requireNonNull(addressBook).values()); + HashMap network = + addressBookToNetwork(Objects.requireNonNull(addressBook).values()); return new Network(executor, network).setLedgerIdInternal(LedgerId.PREVIEWNET, addressBook); } @@ -141,7 +123,8 @@ synchronized Network setLedgerId(@Nullable LedgerId ledgerId) { return setLedgerIdInternal(ledgerId, getAddressBookForLedger(ledgerId)); } - private Network setLedgerIdInternal(@Nullable LedgerId ledgerId, @Nullable Map addressBook) { + private Network setLedgerIdInternal( + @Nullable LedgerId ledgerId, @Nullable Map addressBook) { super.setLedgerId(ledgerId); this.addressBook = addressBook; @@ -154,25 +137,27 @@ private Network setLedgerIdInternal(@Nullable LedgerId ledgerId, @Nullable Map newAddressBook = addressBook.getNodeAddresses().stream() - .filter(nodeAddress -> Objects.nonNull(nodeAddress.getAccountId())) - .collect(Collectors.toMap(NodeAddress::getAccountId, Function.identity(), - /* - * Here we index by AccountId ignoring any subsequent entries with the same AccountId. - * - * Currently, this seems to be needed when reloading predefined address book for testnet which contains - * multiple entries with the same AccountId. - * - * If it becomes necessary to better handle such cases, either the one-to-one mapping from AccountId to - * single NodeAddress should be abandoned or NodeAddresses with the same AccountId may need to be merged. - * */ - (a, b) -> a)); + .filter(nodeAddress -> Objects.nonNull(nodeAddress.getAccountId())) + .collect(Collectors.toMap( + NodeAddress::getAccountId, + Function.identity(), + /* + * Here we index by AccountId ignoring any subsequent entries with the same AccountId. + * + * Currently, this seems to be needed when reloading predefined address book for testnet which contains + * multiple entries with the same AccountId. + * + * If it becomes necessary to better handle such cases, either the one-to-one mapping from AccountId to + * single NodeAddress should be abandoned or NodeAddresses with the same AccountId may need to be merged. + * */ + (a, b) -> a)); /* - * Here we preserve the certificate hash in the case where one is previously defined and no new one is provided. - * - * Currently, this seems to be needed since the downloaded address book lacks the certificate hash. However, - * it is expected the certificate hash will be provided in the future in which case this workaround will no - * longer be necessary. - * */ + * Here we preserve the certificate hash in the case where one is previously defined and no new one is provided. + * + * Currently, this seems to be needed since the downloaded address book lacks the certificate hash. However, + * it is expected the certificate hash will be provided in the future in which case this workaround will no + * longer be necessary. + * */ if (null != this.addressBook) { for (Map.Entry entry : newAddressBook.entrySet()) { NodeAddress previous = this.addressBook.get(entry.getKey()); @@ -192,16 +177,16 @@ void setAddressBook(NodeAddressBook addressBook) { @Nullable private static Map getAddressBookForLedger(@Nullable LedgerId ledgerId) { - return (ledgerId == null || !ledgerId.isKnownNetwork()) ? - null : - readAddressBookResource("addressbook/" + ledgerId + ".pb"); + return (ledgerId == null || !ledgerId.isKnownNetwork()) + ? null + : readAddressBookResource("addressbook/" + ledgerId + ".pb"); } static HashMap addressBookToNetwork(Collection addressBook) { var network = new HashMap(); for (var nodeAddress : addressBook) { for (var endpoint : nodeAddress.addresses) { - network.put(endpoint.toString(), nodeAddress.accountId); + network.put(endpoint.toString(), nodeAddress.accountId); } } return network; @@ -214,7 +199,8 @@ static HashMap addressBookToNetwork(Collection a * @return the list of address book records */ static Map readAddressBookResource(String fileName) { - try (var inputStream = Objects.requireNonNull(Network.class.getResource("/" + fileName)).openStream()) { + try (var inputStream = Objects.requireNonNull(Network.class.getResource("/" + fileName)) + .openStream()) { var contents = ByteStreams.toByteArray(inputStream); var nodeAddressBook = NodeAddressBook.fromBytes(ByteString.copyFrom(contents)); var map = new HashMap(); @@ -248,8 +234,7 @@ synchronized Map getNetwork() { @Override protected Node createNodeFromNetworkEntry(Map.Entry entry) { - return new Node(entry.getValue(), entry.getKey(), executor) - .setVerifyCertificates(verifyCertificates); + return new Node(entry.getValue(), entry.getKey(), executor).setVerifyCertificates(verifyCertificates); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/NetworkName.java b/sdk/src/main/java/com/hiero/sdk/NetworkName.java index d8be9eb7e8..f6422acc4d 100644 --- a/sdk/src/main/java/com/hiero/sdk/NetworkName.java +++ b/sdk/src/main/java/com/hiero/sdk/NetworkName.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** @@ -66,7 +48,8 @@ public static NetworkName fromString(String networkName) { case "previewnet": return NetworkName.PREVIEWNET; default: - throw new IllegalArgumentException("The only supported network names are 'mainnet', 'testnet', and 'previewnet'"); + throw new IllegalArgumentException( + "The only supported network names are 'mainnet', 'testnet', and 'previewnet'"); } } diff --git a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java index 1b767001e0..5d9e73f07c 100644 --- a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -55,9 +37,8 @@ public class NetworkVersionInfo { */ protected static NetworkVersionInfo fromProtobuf(NetworkGetVersionInfoResponse proto) { return new NetworkVersionInfo( - SemanticVersion.fromProtobuf(proto.getHapiProtoVersion()), - SemanticVersion.fromProtobuf(proto.getHederaServicesVersion()) - ); + SemanticVersion.fromProtobuf(proto.getHapiProtoVersion()), + SemanticVersion.fromProtobuf(proto.getHederaServicesVersion())); } /** @@ -78,9 +59,9 @@ public static NetworkVersionInfo fromBytes(byte[] bytes) throws InvalidProtocolB */ protected NetworkGetVersionInfoResponse toProtobuf() { return NetworkGetVersionInfoResponse.newBuilder() - .setHapiProtoVersion(protobufVersion.toProtobuf()) - .setHederaServicesVersion(servicesVersion.toProtobuf()) - .build(); + .setHapiProtoVersion(protobufVersion.toProtobuf()) + .setHederaServicesVersion(servicesVersion.toProtobuf()) + .build(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java index b453e55519..ea7c12d746 100644 --- a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.NetworkGetVersionInfoQuery; @@ -33,12 +15,12 @@ public class NetworkVersionInfoQuery extends Query(nodeAddress.getServiceEndpointCount()); if (!nodeAddress.getIpAddress().isEmpty()) { - address.add( - Endpoint.fromProtobuf(ServiceEndpoint.newBuilder() + address.add(Endpoint.fromProtobuf(ServiceEndpoint.newBuilder() .setIpAddressV4(nodeAddress.getIpAddress()) .setPort(nodeAddress.getPortno()) - .build()) - ); + .build())); } for (var endpoint : nodeAddress.getServiceEndpointList()) { @@ -97,12 +75,12 @@ static NodeAddress fromProtobuf(com.hiero.sdk.proto.NodeAddress nodeAddress) { } var node = new NodeAddress() - .setPublicKey(nodeAddress.getRSAPubKey()) - .setNodeId(nodeAddress.getNodeId()) - .setCertHash(nodeAddress.getNodeCertHash()) - .setAddresses(address) - .setDescription(nodeAddress.getDescription()) - .setStake(nodeAddress.getStake()); + .setPublicKey(nodeAddress.getRSAPubKey()) + .setNodeId(nodeAddress.getNodeId()) + .setCertHash(nodeAddress.getNodeCertHash()) + .setAddresses(address) + .setDescription(nodeAddress.getDescription()) + .setStake(nodeAddress.getStake()); if (nodeAddress.hasNodeAccountId()) { node.setAccountId(AccountId.fromProtobuf(nodeAddress.getNodeAccountId())); @@ -124,7 +102,7 @@ public String getPublicKey() { /** * Assign the public key. * - * @param publicKey the public key + * @param publicKey the public key * @return {@code this} */ public NodeAddress setPublicKey(String publicKey) { @@ -156,7 +134,7 @@ public NodeAddress setAccountId(AccountId accountId) { /** * Extract the node id. * - * @return the node id + * @return the node id */ public long getNodeId() { return nodeId; @@ -270,8 +248,7 @@ public NodeAddress setStake(long stake) { * @return the protobuf representation. */ com.hiero.sdk.proto.NodeAddress toProtobuf() { - var builder = com.hiero.sdk.proto.NodeAddress.newBuilder() - .setNodeId(nodeId); + var builder = com.hiero.sdk.proto.NodeAddress.newBuilder().setNodeId(nodeId); if (certHash != null) { builder.setNodeCertHash(certHash); @@ -299,14 +276,14 @@ com.hiero.sdk.proto.NodeAddress toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("publicKey", publicKey) - .add("accountId", accountId) - .add("nodeId", nodeId) - .add("certHash", certHash != null ? new String(certHash.toByteArray(), StandardCharsets.UTF_8) : null) - .add("addresses", addresses) - .add("description", description) - .add("stake", stake) - .toString(); + .add("publicKey", publicKey) + .add("accountId", accountId) + .add("nodeId", nodeId) + .add("certHash", certHash != null ? new String(certHash.toByteArray(), StandardCharsets.UTF_8) : null) + .add("addresses", addresses) + .add("description", description) + .add("stake", stake) + .toString(); } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java b/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java index 60e3e3def4..3de2dcc304 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java @@ -1,28 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; - import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -38,8 +19,7 @@ public class NodeAddressBook { /** * Constructor. */ - NodeAddressBook() { - } + NodeAddressBook() {} /** * Extract the of node addresses. @@ -123,7 +103,7 @@ public ByteString toBytes() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("nodeAddresses", nodeAddresses) - .toString(); + .add("nodeAddresses", nodeAddresses) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java index 7de2eddb97..7dde35a9ce 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -32,7 +14,6 @@ import java.util.List; import java.util.Objects; import javax.annotation.Nullable; -import org.bouncycastle.util.Arrays; /** * A transaction to create a new node in the network address book. @@ -163,9 +144,8 @@ public NodeCreateTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - NodeCreateTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + NodeCreateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java index 50d5b57d43..c2ea1044a4 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -68,9 +50,8 @@ public NodeDeleteTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - NodeDeleteTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + NodeDeleteTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java index 8a985c1356..88c595e187 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -34,7 +16,6 @@ import java.util.List; import java.util.Objects; import javax.annotation.Nullable; -import org.bouncycastle.util.Arrays; /** * A transaction to modify address book node attributes. @@ -190,9 +171,8 @@ public NodeUpdateTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - NodeUpdateTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + NodeUpdateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/Pem.java b/sdk/src/main/java/com/hiero/sdk/Pem.java index 9db6d43d01..6284d11c4f 100644 --- a/sdk/src/main/java/com/hiero/sdk/Pem.java +++ b/sdk/src/main/java/com/hiero/sdk/Pem.java @@ -1,24 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; +import javax.annotation.Nullable; +import javax.crypto.Cipher; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; import org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo; @@ -42,12 +29,6 @@ import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemWriter; -import javax.annotation.Nullable; -import javax.crypto.Cipher; -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; - /** * Internal utility class for handling PEM objects. *
@@ -62,8 +43,7 @@ final class Pem { /** * Constructor. */ - private Pem() { - } + private Pem() {} /** * For some reason, this generates PEM encodings that we ourselves can import, but OpenSSL @@ -74,8 +54,7 @@ private Pem() { static void writeEncryptedPrivateKey(PrivateKeyInfo pkInfo, Writer out, String passphrase) throws IOException { byte[] salt = Crypto.randomBytes(Crypto.SALT_LEN); - KeyParameter derivedKey = Crypto.deriveKeySha256( - passphrase, salt, Crypto.ITERATIONS, Crypto.CBC_DK_LEN); + KeyParameter derivedKey = Crypto.deriveKeySha256(passphrase, salt, Crypto.ITERATIONS, Crypto.CBC_DK_LEN); byte[] iv = Crypto.randomBytes(Crypto.IV_LEN); @@ -88,19 +67,19 @@ static void writeEncryptedPrivateKey(PrivateKeyInfo pkInfo, Writer out, String p // So this is basically a reimplementation of that minus the excess OO PBES2Parameters parameters = new PBES2Parameters( - new KeyDerivationFunc( - PKCSObjectIdentifiers.id_PBKDF2, - new PBKDF2Params( - salt, - Crypto.ITERATIONS, - Crypto.CBC_DK_LEN, - new AlgorithmIdentifier(PKCSObjectIdentifiers.id_hmacWithSHA256))), - new EncryptionScheme(NISTObjectIdentifiers.id_aes128_CBC, - ASN1Primitive.fromByteArray(cipher.getParameters().getEncoded()))); + new KeyDerivationFunc( + PKCSObjectIdentifiers.id_PBKDF2, + new PBKDF2Params( + salt, + Crypto.ITERATIONS, + Crypto.CBC_DK_LEN, + new AlgorithmIdentifier(PKCSObjectIdentifiers.id_hmacWithSHA256))), + new EncryptionScheme( + NISTObjectIdentifiers.id_aes128_CBC, + ASN1Primitive.fromByteArray(cipher.getParameters().getEncoded()))); EncryptedPrivateKeyInfo encryptedPrivateKeyInfo = new EncryptedPrivateKeyInfo( - new AlgorithmIdentifier(PKCSObjectIdentifiers.id_PBES2, parameters), - encryptedKey); + new AlgorithmIdentifier(PKCSObjectIdentifiers.id_PBES2, parameters), encryptedKey); PemWriter writer = new PemWriter(out); writer.writeObject(new PemObject(TYPE_ENCRYPTED_PRIVATE_KEY, encryptedPrivateKeyInfo.getEncoded())); @@ -116,30 +95,31 @@ static void writeEncryptedPrivateKey(PrivateKeyInfo pkInfo, Writer out, String p * @throws IOException if IO operations fail */ static PrivateKeyInfo readPrivateKey(Reader input, @Nullable String passphrase) throws IOException { - try (final var parser = new PEMParser(input)){ + try (final var parser = new PEMParser(input)) { Object parsedObject = parser.readObject(); var password = (passphrase != null) ? passphrase.toCharArray() : "".toCharArray(); if (parsedObject == null) { throw new BadKeyException("PEM file did not contain a private key"); } else if (parsedObject instanceof PKCS8EncryptedPrivateKeyInfo) { var decryptProvider = new JceOpenSSLPKCS8DecryptorProviderBuilder() - .setProvider(new BouncyCastleProvider()) - .build(password); + .setProvider(new BouncyCastleProvider()) + .build(password); var encryptedPrivateKeyInfo = (PKCS8EncryptedPrivateKeyInfo) parsedObject; return encryptedPrivateKeyInfo.decryptPrivateKeyInfo(decryptProvider); - } else if (parsedObject instanceof PrivateKeyInfo){ + } else if (parsedObject instanceof PrivateKeyInfo) { return (PrivateKeyInfo) parsedObject; } else if (parsedObject instanceof PEMEncryptedKeyPair) { var decryptProvider = new JcePEMDecryptorProviderBuilder() - .setProvider(new BouncyCastleProvider()) - .build(password); + .setProvider(new BouncyCastleProvider()) + .build(password); var encryptedKeyPair = (PEMEncryptedKeyPair) parsedObject; return encryptedKeyPair.decryptKeyPair(decryptProvider).getPrivateKeyInfo(); } else if (parsedObject instanceof PEMKeyPair) { var keyPair = (PEMKeyPair) parsedObject; return keyPair.getPrivateKeyInfo(); } else { - throw new BadKeyException("PEM file contained something the SDK didn't know what to do with: " + parsedObject.getClass().getName()); + throw new BadKeyException("PEM file contained something the SDK didn't know what to do with: " + + parsedObject.getClass().getName()); } } catch (PKCSException e) { if (e.getMessage().contains("password empty")) { diff --git a/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java b/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java index 82a2e049de..731ffe0db6 100644 --- a/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java +++ b/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -33,8 +15,10 @@ public class PendingAirdropId { private AccountId sender; private AccountId receiver; + @Nullable private TokenId tokenId; + @Nullable private NftId nftId; @@ -92,20 +76,22 @@ public PendingAirdropId setNftId(@Nullable NftId nftId) { static PendingAirdropId fromProtobuf(com.hiero.sdk.proto.PendingAirdropId pendingAirdropId) { if (pendingAirdropId.hasFungibleTokenType()) { - return new PendingAirdropId(AccountId.fromProtobuf(pendingAirdropId.getSenderId()), - AccountId.fromProtobuf(pendingAirdropId.getReceiverId()), - TokenId.fromProtobuf(pendingAirdropId.getFungibleTokenType())); + return new PendingAirdropId( + AccountId.fromProtobuf(pendingAirdropId.getSenderId()), + AccountId.fromProtobuf(pendingAirdropId.getReceiverId()), + TokenId.fromProtobuf(pendingAirdropId.getFungibleTokenType())); } else { - return new PendingAirdropId(AccountId.fromProtobuf(pendingAirdropId.getSenderId()), - AccountId.fromProtobuf(pendingAirdropId.getReceiverId()), - NftId.fromProtobuf(pendingAirdropId.getNonFungibleToken())); + return new PendingAirdropId( + AccountId.fromProtobuf(pendingAirdropId.getSenderId()), + AccountId.fromProtobuf(pendingAirdropId.getReceiverId()), + NftId.fromProtobuf(pendingAirdropId.getNonFungibleToken())); } } com.hiero.sdk.proto.PendingAirdropId toProtobuf() { var builder = com.hiero.sdk.proto.PendingAirdropId.newBuilder() - .setSenderId(sender.toProtobuf()) - .setReceiverId(receiver.toProtobuf()); + .setSenderId(sender.toProtobuf()) + .setReceiverId(receiver.toProtobuf()); if (tokenId != null) { builder.setFungibleTokenType(tokenId.toProtobuf()); @@ -118,10 +104,10 @@ com.hiero.sdk.proto.PendingAirdropId toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("sender", sender) - .add("receiver", receiver) - .add("tokenId", tokenId) - .add("nftId", nftId) - .toString(); + .add("sender", sender) + .add("receiver", receiver) + .add("tokenId", tokenId) + .add("nftId", nftId) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java b/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java index a5583331ad..740a20cdf9 100644 --- a/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java +++ b/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -29,7 +11,6 @@ abstract class PendingAirdropLogic> extends Tra protected List pendingAirdropIds = new ArrayList<>(); - protected PendingAirdropLogic() {} /** @@ -38,9 +19,8 @@ protected PendingAirdropLogic() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - PendingAirdropLogic( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + PendingAirdropLogic(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); } diff --git a/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java b/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java index 2970b4fdb1..576e453578 100644 --- a/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java +++ b/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -41,22 +23,22 @@ public long getPendingAirdropAmount() { com.hiero.sdk.proto.PendingAirdropRecord toProtobuf() { return com.hiero.sdk.proto.PendingAirdropRecord.newBuilder() - .setPendingAirdropId(this.pendingAirdropId.toProtobuf()) - .setPendingAirdropValue(PendingAirdropValue.newBuilder().setAmount(pendingAirdropAmount)) - .build(); + .setPendingAirdropId(this.pendingAirdropId.toProtobuf()) + .setPendingAirdropValue(PendingAirdropValue.newBuilder().setAmount(pendingAirdropAmount)) + .build(); } static PendingAirdropRecord fromProtobuf(com.hiero.sdk.proto.PendingAirdropRecord pendingAirdropRecord) { return new PendingAirdropRecord( - PendingAirdropId.fromProtobuf(pendingAirdropRecord.getPendingAirdropId()), - pendingAirdropRecord.getPendingAirdropValue().getAmount()); + PendingAirdropId.fromProtobuf(pendingAirdropRecord.getPendingAirdropId()), + pendingAirdropRecord.getPendingAirdropValue().getAmount()); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("pendingAirdropId", pendingAirdropId) - .add("pendingAirdropAmount", pendingAirdropAmount) - .toString(); + .add("pendingAirdropId", pendingAirdropId) + .add("pendingAirdropAmount", pendingAirdropAmount) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java b/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java index 8ae5696493..0133f4d656 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import javax.annotation.Nullable; @@ -61,7 +43,10 @@ public String getMessage() { stringBuilder.append("Hedera transaction `").append(transactionId).append("` "); } - stringBuilder.append("failed pre-check with the status `").append(status).append("`"); + stringBuilder + .append("failed pre-check with the status `") + .append(status) + .append("`"); return stringBuilder.toString(); } diff --git a/sdk/src/main/java/com/hiero/sdk/PrivateKey.java b/sdk/src/main/java/com/hiero/sdk/PrivateKey.java index 697e68fdc4..3376dcf714 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrivateKey.java +++ b/sdk/src/main/java/com/hiero/sdk/PrivateKey.java @@ -1,24 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.util.Arrays; +import javax.annotation.Nonnegative; +import javax.annotation.Nullable; import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; import org.bouncycastle.asn1.sec.ECPrivateKey; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; @@ -26,13 +14,6 @@ import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.util.Arrays; - /** * A private key on the Hedera™ network. */ @@ -116,7 +97,7 @@ public static PrivateKey fromMnemonic(Mnemonic mnemonic, String passphrase) { // we pre-derive most of the path as the mobile wallets don't expose more than the index // https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki // https://github.com/satoshilabs/slips/blob/master/slip-0044.md - for (int index : new int[]{44, 3030, 0, 0}) { + for (int index : new int[] {44, 3030, 0, 0}) { derivedKey = derivedKey.derive(index); } @@ -187,7 +168,7 @@ public static PrivateKey fromStringECDSA(String privateKey) { */ public static PrivateKey fromBytes(byte[] privateKey) { if ((privateKey.length == Ed25519.SECRET_KEY_SIZE) - || (privateKey.length == Ed25519.SECRET_KEY_SIZE + Ed25519.PUBLIC_KEY_SIZE)) { + || (privateKey.length == Ed25519.SECRET_KEY_SIZE + Ed25519.PUBLIC_KEY_SIZE)) { // If this is a 32 or 64 byte string, assume an Ed25519 private key return new PrivateKeyED25519(Arrays.copyOfRange(privateKey, 0, Ed25519.SECRET_KEY_SIZE), null); } diff --git a/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java b/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java index f70c788c10..e71c1b7e12 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java +++ b/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java @@ -1,25 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.utils.Bip32Utils; +import java.io.IOException; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import javax.annotation.Nullable; import org.bouncycastle.asn1.*; import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; import org.bouncycastle.asn1.sec.ECPrivateKey; @@ -36,12 +23,6 @@ import org.bouncycastle.crypto.signers.HMacDSAKCalculator; import org.bouncycastle.util.Arrays; -import javax.annotation.Nullable; -import java.io.IOException; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; - /** * Encapsulate the ECDSA private key. */ @@ -276,10 +257,11 @@ private static byte[] bigIntTo32Bytes(BigInteger n) { byte[] bytes = n.toByteArray(); byte[] bytes32 = new byte[32]; System.arraycopy( - bytes, Math.max(0, bytes.length - 32), - bytes32, Math.max(0, 32 - bytes.length), - Math.min(32, bytes.length) - ); + bytes, + Math.max(0, bytes.length - 32), + bytes32, + Math.max(0, 32 - bytes.length), + Math.min(32, bytes.length)); return bytes32; } @@ -292,11 +274,11 @@ public byte[] toBytesRaw() { public byte[] toBytesDER() { try { return new ECPrivateKey( - 256, - keyData, - new DERBitString(getPublicKey().toBytesRaw()), - new X962Parameters(ID_ECDSA_SECP256K1) - ).getEncoded("DER"); + 256, + keyData, + new DERBitString(getPublicKey().toBytesRaw()), + new X962Parameters(ID_ECDSA_SECP256K1)) + .getEncoded("DER"); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java b/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java index 0d4a9a515f..bca6b70608 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java +++ b/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.utils.Bip32Utils; @@ -123,7 +105,7 @@ static PrivateKeyED25519 derivableKeyED25519(byte[] deriveData) { */ static PrivateKey fromBytesInternal(byte[] privateKey) { if ((privateKey.length == Ed25519.SECRET_KEY_SIZE) - || (privateKey.length == Ed25519.SECRET_KEY_SIZE + Ed25519.PUBLIC_KEY_SIZE)) { + || (privateKey.length == Ed25519.SECRET_KEY_SIZE + Ed25519.PUBLIC_KEY_SIZE)) { // If this is a 32 or 64 byte string, assume an Ed25519 private key return new PrivateKeyED25519(Arrays.copyOfRange(privateKey, 0, Ed25519.SECRET_KEY_SIZE), null); } @@ -151,17 +133,15 @@ static byte[] legacyDeriveChildKey(byte[] entropy, long index) { } else { Arrays.fill(seed, entropy.length, entropy.length + 4, (byte) 0); } - Arrays.fill(seed, entropy.length + 4, seed.length, Long.valueOf(index).byteValue()); + Arrays.fill( + seed, entropy.length + 4, seed.length, Long.valueOf(index).byteValue()); } System.arraycopy(entropy, 0, seed, 0, entropy.length); byte[] salt = new byte[1]; salt[0] = -1; PKCS5S2ParametersGenerator pbkdf2 = new PKCS5S2ParametersGenerator(new SHA512Digest()); - pbkdf2.init( - seed, - salt, - 2048); + pbkdf2.init(seed, salt, 2048); KeyParameter key = (KeyParameter) pbkdf2.generateDerivedParameters(256); return key.getKey(); @@ -249,10 +229,8 @@ public byte[] toBytesRaw() { @Override public byte[] toBytesDER() { try { - return new PrivateKeyInfo( - new AlgorithmIdentifier(ID_ED25519), - new DEROctetString(keyData) - ).getEncoded("DER"); + return new PrivateKeyInfo(new AlgorithmIdentifier(ID_ED25519), new DEROctetString(keyData)) + .getEncoded("DER"); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java b/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java index 7890086059..0e2b848837 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java @@ -1,28 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.*; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - import javax.annotation.Nullable; /** @@ -40,8 +21,7 @@ public class PrngTransaction extends Transaction { /** * Constructor. */ - public PrngTransaction() { - } + public PrngTransaction() {} /** * Assign the range. @@ -84,8 +64,7 @@ void onScheduled(SchedulableTransactionBody.Builder scheduled) { } @Override - void validateChecksums(Client client) throws BadEntityIdException { - } + void validateChecksums(Client client) throws BadEntityIdException {} @Override MethodDescriptor getMethodDescriptor() { diff --git a/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java b/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java index 7c30ff0cb2..91d20be6b8 100644 --- a/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java +++ b/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** @@ -56,9 +38,6 @@ static ProxyStaker fromProtobuf(com.hiero.sdk.proto.ProxyStaker proxyStaker) { @Override public String toString() { - return "ProxyStaker{" + - "accountId=" + accountId + - ", amount=" + amount + - '}'; + return "ProxyStaker{" + "accountId=" + accountId + ", amount=" + amount + '}'; } } diff --git a/sdk/src/main/java/com/hiero/sdk/PublicKey.java b/sdk/src/main/java/com/hiero/sdk/PublicKey.java index 26f8499dd0..938146346f 100644 --- a/sdk/src/main/java/com/hiero/sdk/PublicKey.java +++ b/sdk/src/main/java/com/hiero/sdk/PublicKey.java @@ -1,35 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.SignaturePair; +import javax.annotation.Nonnegative; +import javax.annotation.Nullable; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; - /** * A public key on the Hedera™ network. */ @@ -50,8 +31,7 @@ public static PublicKey fromBytes(byte[] publicKey) { } else if (publicKey.length == 65) { // compress the 65 byte form return PublicKeyECDSA.fromBytesInternal( - Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(publicKey).getEncoded(true) - ); + Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(publicKey).getEncoded(true)); } // Assume a DER-encoded private key descriptor @@ -135,7 +115,7 @@ public static PublicKey fromStringDER(String publicKey) { * @return the new key */ private static PublicKey fromSubjectKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo) { - if(subjectPublicKeyInfo.getAlgorithm().equals(new AlgorithmIdentifier(ID_ED25519))) { + if (subjectPublicKeyInfo.getAlgorithm().equals(new AlgorithmIdentifier(ID_ED25519))) { return PublicKeyED25519.fromSubjectKeyInfoInternal(subjectPublicKeyInfo); } else { // assume ECDSA @@ -202,7 +182,9 @@ public boolean verifyTransaction(Transaction transaction) { if (sigPair.getPubKeyPrefix().equals(ByteString.copyFrom(toBytesRaw()))) { found = true; - if (!verify(signedTransaction.getBodyBytes().toByteArray(), extractSignatureFromProtobuf(sigPair).toByteArray())) { + if (!verify( + signedTransaction.getBodyBytes().toByteArray(), + extractSignatureFromProtobuf(sigPair).toByteArray())) { return false; } } diff --git a/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java b/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java index b4d3e0e115..1133c5d3df 100644 --- a/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java +++ b/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static com.hiero.sdk.Crypto.calcKeccak256; @@ -60,8 +42,8 @@ static PublicKeyECDSA fromBytesInternal(byte[] publicKey) { } if (publicKey.length == 33 || publicKey.length == 65) { return new PublicKeyECDSA( - // compress and validate the key - Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(publicKey).getEncoded(true)); + // compress and validate the key + Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(publicKey).getEncoded(true)); } // Assume a DER-encoded public key descriptor @@ -88,10 +70,10 @@ public boolean verify(byte[] message, byte[] signature) { var hash = calcKeccak256(message); ECDSASigner signer = new ECDSASigner(); - signer.init(false, new ECPublicKeyParameters( - Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(keyData), - Key.ECDSA_SECP256K1_DOMAIN - )); + signer.init( + false, + new ECPublicKeyParameters( + Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(keyData), Key.ECDSA_SECP256K1_DOMAIN)); BigInteger r = new BigInteger(1, Arrays.copyOf(signature, 32)); BigInteger s = new BigInteger(1, Arrays.copyOfRange(signature, 32, 64)); @@ -102,25 +84,23 @@ public boolean verify(byte[] message, byte[] signature) { @Override com.hiero.sdk.proto.Key toProtobufKey() { return com.hiero.sdk.proto.Key.newBuilder() - .setECDSASecp256K1(ByteString.copyFrom(keyData)) - .build(); + .setECDSASecp256K1(ByteString.copyFrom(keyData)) + .build(); } @Override SignaturePair toSignaturePairProtobuf(byte[] signature) { return SignaturePair.newBuilder() - .setPubKeyPrefix(ByteString.copyFrom(keyData)) - .setECDSASecp256K1(ByteString.copyFrom(signature)) - .build(); + .setPubKeyPrefix(ByteString.copyFrom(keyData)) + .setECDSASecp256K1(ByteString.copyFrom(signature)) + .build(); } @Override public byte[] toBytesDER() { try { - return new SubjectPublicKeyInfo( - new AlgorithmIdentifier(ID_EC_PUBLIC_KEY, ID_ECDSA_SECP256K1), - keyData - ).getEncoded("DER"); + return new SubjectPublicKeyInfo(new AlgorithmIdentifier(ID_EC_PUBLIC_KEY, ID_ECDSA_SECP256K1), keyData) + .getEncoded("DER"); } catch (IOException e) { throw new RuntimeException(e); } @@ -139,8 +119,8 @@ public byte[] toBytesRaw() { @Override public EvmAddress toEvmAddress() { // Calculate the Keccak-256 hash of the uncompressed key without "04" prefix - byte[] uncompressed = Key.ECDSA_SECP256K1_CURVE - .getCurve().decodePoint(toBytesRaw()).getEncoded(false); + byte[] uncompressed = + Key.ECDSA_SECP256K1_CURVE.getCurve().decodePoint(toBytesRaw()).getEncoded(false); byte[] keccakBytes = calcKeccak256(Arrays.copyOfRange(uncompressed, 1, uncompressed.length)); // Return the last 20 bytes @@ -148,7 +128,7 @@ public EvmAddress toEvmAddress() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java b/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java index 8decf88b90..6a320a66a6 100644 --- a/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java +++ b/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java @@ -1,35 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.hiero.sdk.proto.SignaturePair; +import java.io.IOException; +import java.util.Arrays; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.crypto.params.Ed25519PublicKeyParameters; import org.bouncycastle.math.ec.rfc8032.Ed25519; -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.Arrays; - /** * Encapsulate the ED25519 public key. */ @@ -89,25 +69,22 @@ public boolean verify(byte[] message, byte[] signature) { @Override com.hiero.sdk.proto.Key toProtobufKey() { return com.hiero.sdk.proto.Key.newBuilder() - .setEd25519(ByteString.copyFrom(keyData)) - .build(); + .setEd25519(ByteString.copyFrom(keyData)) + .build(); } @Override SignaturePair toSignaturePairProtobuf(byte[] signature) { return SignaturePair.newBuilder() - .setPubKeyPrefix(ByteString.copyFrom(keyData)) - .setEd25519(ByteString.copyFrom(signature)) - .build(); + .setPubKeyPrefix(ByteString.copyFrom(keyData)) + .setEd25519(ByteString.copyFrom(signature)) + .build(); } @Override public byte[] toBytesDER() { try { - return new SubjectPublicKeyInfo( - new AlgorithmIdentifier(ID_ED25519), - keyData - ).getEncoded("DER"); + return new SubjectPublicKeyInfo(new AlgorithmIdentifier(ID_ED25519), keyData).getEncoded("DER"); } catch (IOException e) { throw new RuntimeException(e); } @@ -129,7 +106,7 @@ public EvmAddress toEvmAddress() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/Query.java b/sdk/src/main/java/com/hiero/sdk/Query.java index 8c8dcff057..66355fe9c4 100644 --- a/sdk/src/main/java/com/hiero/sdk/Query.java +++ b/sdk/src/main/java/com/hiero/sdk/Query.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -62,8 +44,10 @@ public abstract class Query> extends Executable paymentTransactions = null; + @Nullable private Client.Operator paymentOperator = null; + @Nullable private Hbar queryPayment = null; @@ -91,20 +75,16 @@ public abstract class Query> extends Executable getCostAsync(Client client) { */ public CompletableFuture getCostAsync(Client client, Duration timeout) { initWithNodeIds(client); - return getCostExecutable().setNodeAccountIds(Objects.requireNonNull(getNodeAccountIds())).executeAsync(client, timeout); + return getCostExecutable() + .setNodeAccountIds(Objects.requireNonNull(getNodeAccountIds())) + .executeAsync(client, timeout); } /** @@ -291,7 +275,7 @@ Client.Operator getOperatorFromClient(Client client) { if (operator == null) { throw new IllegalStateException( - "`client` must have an `operator` or an explicit payment transaction must be provided"); + "`client` must have an `operator` or an explicit payment transaction must be provided"); } return operator; @@ -328,27 +312,29 @@ CompletableFuture onExecuteAsync(Client client) { return CompletableFuture.completedFuture(null); } - return CompletableFuture.supplyAsync(() -> { - if (grpcCostQuery.getCost() == null) { - // No payment was specified so we need to go ask - // This is a query in its own right so we use a nested future here - return getCostAsync(client).thenCompose(cost -> { - grpcCostQuery.setCost(cost); - - if (grpcCostQuery.shouldError()) { - return CompletableFuture.failedFuture(grpcCostQuery.mapError()); - } - - return CompletableFuture.completedFuture(null); - }); - } - - return CompletableFuture.completedFuture(null); - }, client.executor) - .thenCompose(x -> x) - .thenAccept((paymentAmount) -> { - grpcCostQuery.finish(); - }); + return CompletableFuture.supplyAsync( + () -> { + if (grpcCostQuery.getCost() == null) { + // No payment was specified so we need to go ask + // This is a query in its own right so we use a nested future here + return getCostAsync(client).thenCompose(cost -> { + grpcCostQuery.setCost(cost); + + if (grpcCostQuery.shouldError()) { + return CompletableFuture.failedFuture(grpcCostQuery.mapError()); + } + + return CompletableFuture.completedFuture(null); + }); + } + + return CompletableFuture.completedFuture(null); + }, + client.executor) + .thenCompose(x -> x) + .thenAccept((paymentAmount) -> { + grpcCostQuery.finish(); + }); } private void initWithNodeIds(Client client) { @@ -386,11 +372,10 @@ Transaction getPaymentTransaction(int index) { } var newPaymentTx = makePaymentTransaction( - paymentTransactionId, - nodeAccountIds.get(index), - paymentOperator, - Objects.requireNonNull(chosenQueryPayment) - ); + paymentTransactionId, + nodeAccountIds.get(index), + paymentOperator, + Objects.requireNonNull(chosenQueryPayment)); paymentTransactions.set(index, newPaymentTx); return newPaymentTx; } @@ -405,7 +390,8 @@ final com.hiero.sdk.proto.Query makeRequest() { // Delegate to the derived class to apply the header because the common header struct is // within the nested type - onMakeRequest(builder, headerBuilder.setResponseType(ResponseType.ANSWER_ONLY).build()); + onMakeRequest( + builder, headerBuilder.setResponseType(ResponseType.ANSWER_ONLY).build()); return builder.build(); } @@ -454,7 +440,8 @@ public T setPaymentTransactionId(TransactionId paymentTransactionId) { public String toString() { var request = makeRequest(); - StringBuilder builder = new StringBuilder(request.toString().replaceAll("(?m)^# com.hiero.sdk.proto.Query.*", "")); + StringBuilder builder = + new StringBuilder(request.toString().replaceAll("(?m)^# com.hiero.sdk.proto.Query.*", "")); var queryHeader = mapRequestHeader(request); if (queryHeader.hasPayment()) { @@ -462,7 +449,10 @@ public String toString() { try { // the replaceAll() is for removing the class name from Transaction Body - builder.append(TransactionBody.parseFrom(queryHeader.getPayment().getBodyBytes()).toString().replaceAll("(?m)^# com.hiero.sdk.proto.TransactionBuilder.*", "")); + builder.append( + TransactionBody.parseFrom(queryHeader.getPayment().getBodyBytes()) + .toString() + .replaceAll("(?m)^# com.hiero.sdk.proto.TransactionBuilder.*", "")); } catch (InvalidProtocolBufferException e) { throw new RuntimeException(e); } @@ -530,8 +520,7 @@ void finish() { @SuppressWarnings("NullableDereference") private class QueryCostQuery extends Query { @Override - void validateChecksums(Client client) throws BadEntityIdException { - } + void validateChecksums(Client client) throws BadEntityIdException {} @Override void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { @@ -543,10 +532,10 @@ void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader h // now go back to sleep // without this, an error of MISSING_QUERY_HEADER is returned headerBuilder.setPayment(new TransferTransaction() - .setNodeAccountIds(Collections.singletonList(new AccountId(0))) - .setTransactionId(TransactionId.withValidStart(new AccountId(0), Instant.ofEpochSecond(0))) - .freeze() - .makeRequest()); + .setNodeAccountIds(Collections.singletonList(new AccountId(0))) + .setTransactionId(TransactionId.withValidStart(new AccountId(0), Instant.ofEpochSecond(0))) + .freeze() + .makeRequest()); Query.this.onMakeRequest(queryBuilder, headerBuilder.build()); } diff --git a/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java b/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java index 033a270b4f..6f7771fe76 100644 --- a/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java +++ b/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/RequestType.java b/sdk/src/main/java/com/hiero/sdk/RequestType.java index 277dca4b6c..6c83157a31 100644 --- a/sdk/src/main/java/com/hiero/sdk/RequestType.java +++ b/sdk/src/main/java/com/hiero/sdk/RequestType.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.HederaFunctionality; diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java index 1c9ecd9ffd..c17a1827d2 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -27,10 +9,9 @@ import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Create a scheduled transaction. @@ -40,10 +21,13 @@ public final class ScheduleCreateTransaction extends Transaction { @Nullable private AccountId payerAccountId = null; + @Nullable private SchedulableTransactionBody transactionToSchedule = null; + @Nullable private Key adminKey = null; + private String scheduleMemo = ""; @Nullable @@ -65,7 +49,9 @@ public ScheduleCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ScheduleCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ScheduleCreateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java index ae96a174f8..330b2e684a 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Delete a scheduled transaction. @@ -55,7 +36,9 @@ public ScheduleDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ScheduleDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + ScheduleDeleteTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleId.java b/sdk/src/main/java/com/hiero/sdk/ScheduleId.java index 8ab8fb944b..76473dba84 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleId.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleId.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.ScheduleID; - +import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; -import java.util.Objects; /** * The entity ID of a schedule transaction. @@ -129,10 +110,10 @@ public static ScheduleId fromBytes(byte[] bytes) throws InvalidProtocolBufferExc */ ScheduleID toProtobuf() { return ScheduleID.newBuilder() - .setShardNum(shard) - .setRealmNum(realm) - .setScheduleNum(num) - .build(); + .setShardNum(shard) + .setRealmNum(realm) + .setScheduleNum(num) + .build(); } /** @@ -195,7 +176,7 @@ public int hashCode() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java b/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java index 7a16737c58..0a236f33f8 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java @@ -1,30 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.ScheduleGetInfoResponse; import java.time.Instant; - import javax.annotation.Nullable; /** @@ -130,20 +110,19 @@ public final class ScheduleInfo { * @param waitForExpiry the wait for expiry field */ ScheduleInfo( - ScheduleId scheduleId, - AccountId creatorAccountId, - AccountId payerAccountId, - SchedulableTransactionBody transactionBody, - KeyList signers, - @Nullable Key adminKey, - @Nullable TransactionId scheduledTransactionId, - String memo, - @Nullable Instant expirationTime, - @Nullable Instant executed, - @Nullable Instant deleted, - LedgerId ledgerId, - boolean waitForExpiry - ) { + ScheduleId scheduleId, + AccountId creatorAccountId, + AccountId payerAccountId, + SchedulableTransactionBody transactionBody, + KeyList signers, + @Nullable Key adminKey, + @Nullable TransactionId scheduledTransactionId, + String memo, + @Nullable Instant expirationTime, + @Nullable Instant executed, + @Nullable Instant deleted, + LedgerId ledgerId, + boolean waitForExpiry) { this.scheduleId = scheduleId; this.creatorAccountId = creatorAccountId; this.payerAccountId = payerAccountId; @@ -170,25 +149,23 @@ static ScheduleInfo fromProtobuf(com.hiero.sdk.proto.ScheduleInfo info) { var creatorAccountId = AccountId.fromProtobuf(info.getCreatorAccountID()); var payerAccountId = AccountId.fromProtobuf(info.getPayerAccountID()); var adminKey = info.hasAdminKey() ? Key.fromProtobufKey(info.getAdminKey()) : null; - var scheduledTransactionId = info.hasScheduledTransactionID() ? - TransactionId.fromProtobuf(info.getScheduledTransactionID()) : - null; + var scheduledTransactionId = + info.hasScheduledTransactionID() ? TransactionId.fromProtobuf(info.getScheduledTransactionID()) : null; return new ScheduleInfo( - scheduleId, - creatorAccountId, - payerAccountId, - info.getScheduledTransactionBody(), - KeyList.fromProtobuf(info.getSigners(), null), - adminKey, - scheduledTransactionId, - info.getMemo(), - info.hasExpirationTime() ? InstantConverter.fromProtobuf(info.getExpirationTime()) : null, - info.hasExecutionTime() ? InstantConverter.fromProtobuf(info.getExecutionTime()) : null, - info.hasDeletionTime() ? InstantConverter.fromProtobuf(info.getDeletionTime()) : null, - LedgerId.fromByteString(info.getLedgerId()), - info.getWaitForExpiry() - ); + scheduleId, + creatorAccountId, + payerAccountId, + info.getScheduledTransactionBody(), + KeyList.fromProtobuf(info.getSigners(), null), + adminKey, + scheduledTransactionId, + info.getMemo(), + info.hasExpirationTime() ? InstantConverter.fromProtobuf(info.getExpirationTime()) : null, + info.hasExecutionTime() ? InstantConverter.fromProtobuf(info.getExecutionTime()) : null, + info.hasDeletionTime() ? InstantConverter.fromProtobuf(info.getDeletionTime()) : null, + LedgerId.fromByteString(info.getLedgerId()), + info.getWaitForExpiry()); } /** @@ -199,7 +176,8 @@ static ScheduleInfo fromProtobuf(com.hiero.sdk.proto.ScheduleInfo info) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static ScheduleInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.ScheduleInfo.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + com.hiero.sdk.proto.ScheduleInfo.parseFrom(bytes).toBuilder().build()); } /** @@ -230,16 +208,15 @@ com.hiero.sdk.proto.ScheduleInfo toProtobuf() { info.setDeletionTime(InstantConverter.toProtobuf(deletedAt)); } - return info - .setScheduleID(scheduleId.toProtobuf()) - .setCreatorAccountID(creatorAccountId.toProtobuf()) - .setScheduledTransactionBody(transactionBody) - .setPayerAccountID(payerAccountId.toProtobuf()) - .setSigners(signatories.toProtobuf()) - .setMemo(memo) - .setLedgerId(ledgerId.toByteString()) - .setWaitForExpiry(waitForExpiry) - .build(); + return info.setScheduleID(scheduleId.toProtobuf()) + .setCreatorAccountID(creatorAccountId.toProtobuf()) + .setScheduledTransactionBody(transactionBody) + .setPayerAccountID(payerAccountId.toProtobuf()) + .setSigners(signatories.toProtobuf()) + .setMemo(memo) + .setLedgerId(ledgerId.toByteString()) + .setWaitForExpiry(waitForExpiry) + .build(); } /** @@ -254,19 +231,19 @@ public Transaction getScheduledTransaction() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("scheduleId", scheduleId) - .add("scheduledTransactionId", scheduledTransactionId) - .add("creatorAccountId", creatorAccountId) - .add("payerAccountId", payerAccountId) - .add("signatories", signatories) - .add("adminKey", adminKey) - .add("expirationTime", expirationTime) - .add("memo", memo) - .add("executedAt", executedAt) - .add("deletedAt", deletedAt) - .add("ledgerId", ledgerId) - .add("waitForExpiry", waitForExpiry) - .toString(); + .add("scheduleId", scheduleId) + .add("scheduledTransactionId", scheduledTransactionId) + .add("creatorAccountId", creatorAccountId) + .add("payerAccountId", payerAccountId) + .add("signatories", signatories) + .add("adminKey", adminKey) + .add("expirationTime", expirationTime) + .add("memo", memo) + .add("executedAt", executedAt) + .add("deletedAt", deletedAt) + .add("ledgerId", ledgerId) + .add("waitForExpiry", waitForExpiry) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java index 1a5c8d27dc..9d684eb48b 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Query; @@ -43,8 +25,7 @@ public class ScheduleInfoQuery extends com.hiero.sdk.Query> txs) throws InvalidProtocolBufferException { + ScheduleSignTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java b/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java index 3f64f071ac..7d2c5b47af 100644 --- a/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java +++ b/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -63,11 +45,7 @@ public class SemanticVersion { * @return the new semantic version */ protected static SemanticVersion fromProtobuf(com.hiero.sdk.proto.SemanticVersion version) { - return new SemanticVersion( - version.getMajor(), - version.getMinor(), - version.getPatch() - ); + return new SemanticVersion(version.getMajor(), version.getMinor(), version.getPatch()); } /** @@ -88,10 +66,10 @@ public static SemanticVersion fromBytes(byte[] bytes) throws InvalidProtocolBuff */ protected com.hiero.sdk.proto.SemanticVersion toProtobuf() { return com.hiero.sdk.proto.SemanticVersion.newBuilder() - .setMajor(major) - .setMinor(minor) - .setPatch(patch) - .build(); + .setMajor(major) + .setMinor(minor) + .setPatch(patch) + .build(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/StakingInfo.java b/sdk/src/main/java/com/hiero/sdk/StakingInfo.java index a436b65d36..dee352347c 100644 --- a/sdk/src/main/java/com/hiero/sdk/StakingInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/StakingInfo.java @@ -1,28 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import java.time.Instant; - import javax.annotation.Nullable; /** @@ -70,7 +51,13 @@ public class StakingInfo { * @param stakedAccountId the account to which this account or contract is staking * @param stakedNodeId the ID of the node this account or contract is staked to */ - public StakingInfo(boolean declineStakingReward, Instant stakePeriodStart, Hbar pendingReward, Hbar stakedToMe, @Nullable AccountId stakedAccountId, @Nullable Long stakedNodeId) { + public StakingInfo( + boolean declineStakingReward, + Instant stakePeriodStart, + Hbar pendingReward, + Hbar stakedToMe, + @Nullable AccountId stakedAccountId, + @Nullable Long stakedNodeId) { this.declineStakingReward = declineStakingReward; this.stakePeriodStart = stakePeriodStart; this.pendingReward = pendingReward; @@ -81,13 +68,12 @@ public StakingInfo(boolean declineStakingReward, Instant stakePeriodStart, Hbar static StakingInfo fromProtobuf(com.hiero.sdk.proto.StakingInfo info) { return new StakingInfo( - info.getDeclineReward(), - InstantConverter.fromProtobuf(info.getStakePeriodStart()), - Hbar.fromTinybars(info.getPendingReward()), - Hbar.fromTinybars(info.getStakedToMe()), - info.hasStakedAccountId() ? AccountId.fromProtobuf(info.getStakedAccountId()) : null, - info.hasStakedNodeId() ? info.getStakedNodeId() : null - ); + info.getDeclineReward(), + InstantConverter.fromProtobuf(info.getStakePeriodStart()), + Hbar.fromTinybars(info.getPendingReward()), + Hbar.fromTinybars(info.getStakedToMe()), + info.hasStakedAccountId() ? AccountId.fromProtobuf(info.getStakedAccountId()) : null, + info.hasStakedNodeId() ? info.getStakedNodeId() : null); } /** @@ -103,10 +89,10 @@ public static StakingInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferEx com.hiero.sdk.proto.StakingInfo toProtobuf() { var builder = com.hiero.sdk.proto.StakingInfo.newBuilder() - .setDeclineReward(declineStakingReward) - .setStakePeriodStart(InstantConverter.toProtobuf(stakePeriodStart)) - .setPendingReward(pendingReward.toTinybars()) - .setStakedToMe(stakedToMe.toTinybars()); + .setDeclineReward(declineStakingReward) + .setStakePeriodStart(InstantConverter.toProtobuf(stakePeriodStart)) + .setPendingReward(pendingReward.toTinybars()) + .setStakedToMe(stakedToMe.toTinybars()); if (stakedAccountId != null) { builder.setStakedAccountId(stakedAccountId.toProtobuf()); @@ -130,12 +116,12 @@ public byte[] toBytes() { public String toString() { return MoreObjects.toStringHelper(this) - .add("declineStakingReward", declineStakingReward) - .add("stakePeriodStart", stakePeriodStart) - .add("pendingReward", pendingReward) - .add("stakedToMe", stakedToMe) - .add("stakedAccountId", stakedAccountId) - .add("stakedNodeId", stakedNodeId) - .toString(); + .add("declineStakingReward", declineStakingReward) + .add("stakePeriodStart", stakePeriodStart) + .add("pendingReward", pendingReward) + .add("stakedToMe", stakedToMe) + .add("stakedAccountId", stakedAccountId) + .add("stakedNodeId", stakedNodeId) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/Status.java b/sdk/src/main/java/com/hiero/sdk/Status.java index 46fbb5f538..7978e2cccd 100644 --- a/sdk/src/main/java/com/hiero/sdk/Status.java +++ b/sdk/src/main/java/com/hiero/sdk/Status.java @@ -1,26 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.ResponseCodeEnum; - import java.util.Objects; /** @@ -1072,7 +1053,8 @@ public enum Status { /** * Only tokens of type FUNGIBLE_COMMON can have fractional fees */ - CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON(ResponseCodeEnum.CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON), + CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON( + ResponseCodeEnum.CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON), /** * The provided custom fee schedule key was invalid @@ -1112,7 +1094,8 @@ public enum Status { /** * An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON */ - ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON(ResponseCodeEnum.ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON), + ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON( + ResponseCodeEnum.ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON), /** * All the NFTs allowed in the current price regime have already been minted @@ -1137,7 +1120,8 @@ public enum Status { /** * The sender account in the token transfer transaction could not afford a custom fee */ - INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE(ResponseCodeEnum.INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE), + INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE( + ResponseCodeEnum.INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE), /** * Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type @@ -1147,7 +1131,8 @@ public enum Status { /** * Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees */ - CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE(ResponseCodeEnum.CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE), + CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE( + ResponseCodeEnum.CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE), /** * The account has reached the limit on the automatic associations count. @@ -1157,13 +1142,15 @@ public enum Status { /** * Already existing automatic associations are more than the new maximum automatic associations. */ - EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT(ResponseCodeEnum.EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT), + EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT( + ResponseCodeEnum.EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT), /** * Cannot set the number of automatic associations for an account more than the maximum allowed * token associations tokens.maxPerAccount. */ - REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT(ResponseCodeEnum.REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT), + REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT( + ResponseCodeEnum.REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT), /** * Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. @@ -1393,7 +1380,8 @@ public enum Status { /** * The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. */ - SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME(ResponseCodeEnum.SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME), + SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME( + ResponseCodeEnum.SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME), /** * The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. @@ -2109,8 +2097,8 @@ static Status valueOf(ResponseCodeEnum code) { case INVALID_GRPC_CERTIFICATE_HASH -> INVALID_GRPC_CERTIFICATE_HASH; case MISSING_EXPIRY_TIME -> MISSING_EXPIRY_TIME; case UNRECOGNIZED -> - // NOTE: Protobuf deserialization will not give us the code on the wire - throw new IllegalArgumentException( + // NOTE: Protobuf deserialization will not give us the code on the wire + throw new IllegalArgumentException( "network returned unrecognized response code; your SDK may be out of date"); }; } diff --git a/sdk/src/main/java/com/hiero/sdk/StorageChange.java b/sdk/src/main/java/com/hiero/sdk/StorageChange.java index 741bb45056..bad930b3fa 100644 --- a/sdk/src/main/java/com/hiero/sdk/StorageChange.java +++ b/sdk/src/main/java/com/hiero/sdk/StorageChange.java @@ -1,30 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.google.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.InvalidProtocolBufferException; - -import javax.annotation.Nullable; import java.math.BigInteger; +import javax.annotation.Nullable; /** * @deprecated - User mirror nodes for contract traceability instead @@ -108,7 +86,8 @@ public class StorageChange { // if (valueWritten.equals(BigInteger.ZERO)) { // builder.setValueWritten(BytesValue.newBuilder().setValue(ByteString.EMPTY).build()); // } else { - // builder.setValueWritten(BytesValue.newBuilder().setValue(ByteString.copyFrom(valueWritten.toByteArray())).build()); + // + // builder.setValueWritten(BytesValue.newBuilder().setValue(ByteString.copyFrom(valueWritten.toByteArray())).build()); // } // } // return builder.build(); diff --git a/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java b/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java index 8c8f6832e3..a41905dd3d 100644 --- a/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java +++ b/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import javax.annotation.Nullable; @@ -35,8 +17,7 @@ public final class SubscriptionHandle { /** * Constructor. */ - SubscriptionHandle() { - } + SubscriptionHandle() {} /** * Assign the callback method. diff --git a/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java index 8b0730622e..6250f3a076 100644 --- a/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -47,16 +29,17 @@ public final class SystemDeleteTransaction extends Transaction { @Nullable private FileId fileId = null; + @Nullable private ContractId contractId = null; + @Nullable private Instant expirationTime = null; /** * Constructor. */ - public SystemDeleteTransaction() { - } + public SystemDeleteTransaction() {} /** * Constructor. @@ -65,7 +48,8 @@ public SystemDeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - SystemDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + SystemDeleteTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -209,7 +193,8 @@ void validateChecksums(Client client) throws BadEntityIdException { CompletableFuture onExecuteAsync(Client client) { int modesEnabled = (fileId != null ? 1 : 0) + (contractId != null ? 1 : 0); if (modesEnabled != 1) { - throw new IllegalStateException("SystemDeleteTransaction must have exactly 1 of the following fields set: contractId, fileId"); + throw new IllegalStateException( + "SystemDeleteTransaction must have exactly 1 of the following fields set: contractId, fileId"); } return super.onExecuteAsync(client); } diff --git a/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java index 9bb4c50a2a..ba2978bbff 100644 --- a/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -40,14 +22,14 @@ public final class SystemUndeleteTransaction extends Transaction { @Nullable private FileId fileId; + @Nullable private ContractId contractId; /** * Constructor. */ - public SystemUndeleteTransaction() { - } + public SystemUndeleteTransaction() {} /** * Constructor. @@ -56,7 +38,9 @@ public SystemUndeleteTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - SystemUndeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + SystemUndeleteTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -166,12 +150,12 @@ void validateChecksums(Client client) throws BadEntityIdException { CompletableFuture onExecuteAsync(Client client) { int modesEnabled = (fileId != null ? 1 : 0) + (contractId != null ? 1 : 0); if (modesEnabled != 1) { - throw new IllegalStateException("SystemDeleteTransaction must have exactly 1 of the following fields set: contractId, fileId"); + throw new IllegalStateException( + "SystemDeleteTransaction must have exactly 1 of the following fields set: contractId, fileId"); } return super.onExecuteAsync(client); } - @Override MethodDescriptor getMethodDescriptor() { if (fileId != null) { diff --git a/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java b/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java index ae237dd15d..86b78943d7 100644 --- a/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java +++ b/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.security.SecureRandom; @@ -26,19 +8,17 @@ */ final class ThreadLocalSecureRandom { @SuppressWarnings("AnonymousHasLambdaAlternative") - private static final ThreadLocal secureRandom = - new ThreadLocal() { - @Override - protected SecureRandom initialValue() { - return new SecureRandom(); - } - }; + private static final ThreadLocal secureRandom = new ThreadLocal() { + @Override + protected SecureRandom initialValue() { + return new SecureRandom(); + } + }; /** * Constructor. */ - private ThreadLocalSecureRandom() { - } + private ThreadLocalSecureRandom() {} /** * Extract seme randomness. diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java index 25776331d7..816ff16054 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -50,7 +32,8 @@ public TokenAirdropTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenAirdropTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenAirdropTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -108,22 +91,22 @@ void initFromTransactionBody() { for (var transfer : tokenTransferList.getTransfersList()) { tokenTransfers.add(new TokenTransfer( - token, - AccountId.fromProtobuf(transfer.getAccountID()), - transfer.getAmount(), - tokenTransferList.hasExpectedDecimals() ? tokenTransferList.getExpectedDecimals().getValue() : null, - transfer.getIsApproval() - )); + token, + AccountId.fromProtobuf(transfer.getAccountID()), + transfer.getAmount(), + tokenTransferList.hasExpectedDecimals() + ? tokenTransferList.getExpectedDecimals().getValue() + : null, + transfer.getIsApproval())); } for (var transfer : tokenTransferList.getNftTransfersList()) { nftTransfers.add(new TokenNftTransfer( - token, - AccountId.fromProtobuf(transfer.getSenderAccountID()), - AccountId.fromProtobuf(transfer.getReceiverAccountID()), - transfer.getSerialNumber(), - transfer.getIsApproval() - )); + token, + AccountId.fromProtobuf(transfer.getSenderAccountID()), + AccountId.fromProtobuf(transfer.getReceiverAccountID()), + transfer.getSerialNumber(), + transfer.getIsApproval())); } } } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java b/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java index bff655d3f9..41d5e41a58 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.GrantedTokenAllowance; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * An approved allowance of token transfers for a spender. @@ -61,11 +42,10 @@ public class TokenAllowance { * @param amount the token allowance */ TokenAllowance( - @Nullable TokenId tokenId, - @Nullable AccountId ownerAccountId, - @Nullable AccountId spenderAccountId, - long amount - ) { + @Nullable TokenId tokenId, + @Nullable AccountId ownerAccountId, + @Nullable AccountId spenderAccountId, + long amount) { this.tokenId = tokenId; this.ownerAccountId = ownerAccountId; this.spenderAccountId = spenderAccountId; @@ -80,11 +60,10 @@ public class TokenAllowance { */ static TokenAllowance fromProtobuf(com.hiero.sdk.proto.TokenAllowance allowanceProto) { return new TokenAllowance( - allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, - allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, - allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, - allowanceProto.getAmount() - ); + allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, + allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, + allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, + allowanceProto.getAmount()); } /** @@ -95,11 +74,10 @@ static TokenAllowance fromProtobuf(com.hiero.sdk.proto.TokenAllowance allowanceP */ static TokenAllowance fromProtobuf(GrantedTokenAllowance allowanceProto) { return new TokenAllowance( - allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, - null, - allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, - allowanceProto.getAmount() - ); + allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, + null, + allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, + allowanceProto.getAmount()); } /** @@ -137,8 +115,7 @@ void validateChecksums(Client client) throws BadEntityIdException { * @return the protobuf representation */ com.hiero.sdk.proto.TokenAllowance toProtobuf() { - var builder = com.hiero.sdk.proto.TokenAllowance.newBuilder() - .setAmount(amount); + var builder = com.hiero.sdk.proto.TokenAllowance.newBuilder().setAmount(amount); if (tokenId != null) { builder.setTokenId(tokenId.toProtobuf()); } @@ -157,8 +134,7 @@ com.hiero.sdk.proto.TokenAllowance toProtobuf() { * @return the protobuf representation */ GrantedTokenAllowance toGrantedProtobuf() { - var builder = GrantedTokenAllowance.newBuilder() - .setAmount(amount); + var builder = GrantedTokenAllowance.newBuilder().setAmount(amount); if (tokenId != null) { builder.setTokenId(tokenId.toProtobuf()); } @@ -180,10 +156,10 @@ public byte[] toBytes() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("tokenId", tokenId) - .add("ownerAccountId", ownerAccountId) - .add("spenderAccountId", spenderAccountId) - .add("amount", amount) - .toString(); + .add("tokenId", tokenId) + .add("ownerAccountId", ownerAccountId) + .add("spenderAccountId", spenderAccountId) + .add("amount", amount) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java index 3b18c98ffd..9c2bea98bb 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,12 +8,11 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * The transaction that will associate accounts to a token id. @@ -39,6 +20,7 @@ public class TokenAssociateTransaction extends Transaction { @Nullable private AccountId accountId = null; + private List tokenIds = new ArrayList<>(); /** @@ -55,7 +37,9 @@ public TokenAssociateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenAssociateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenAssociateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java b/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java index 02d06ae259..ea231bfff9 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -63,9 +45,12 @@ public class TokenAssociation { */ static TokenAssociation fromProtobuf(com.hiero.sdk.proto.TokenAssociation tokenAssociation) { return new TokenAssociation( - tokenAssociation.hasTokenId() ? TokenId.fromProtobuf(tokenAssociation.getTokenId()) : new TokenId(0, 0, 0), - tokenAssociation.hasAccountId() ? AccountId.fromProtobuf(tokenAssociation.getAccountId()) : new AccountId(0, 0, 0) - ); + tokenAssociation.hasTokenId() + ? TokenId.fromProtobuf(tokenAssociation.getTokenId()) + : new TokenId(0, 0, 0), + tokenAssociation.hasAccountId() + ? AccountId.fromProtobuf(tokenAssociation.getAccountId()) + : new AccountId(0, 0, 0)); } /** @@ -86,17 +71,17 @@ public static TokenAssociation fromBytes(byte[] bytes) throws InvalidProtocolBuf */ com.hiero.sdk.proto.TokenAssociation toProtobuf() { return com.hiero.sdk.proto.TokenAssociation.newBuilder() - .setTokenId(tokenId.toProtobuf()) - .setAccountId(accountId.toProtobuf()) - .build(); + .setTokenId(tokenId.toProtobuf()) + .setAccountId(accountId.toProtobuf()) + .build(); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("tokenId", tokenId) - .add("accountId", accountId) - .toString(); + .add("tokenId", tokenId) + .add("accountId", accountId) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java index 490f4f2c92..e07152e3df 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -27,13 +9,12 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; +import javax.annotation.Nonnegative; +import javax.annotation.Nullable; /** * Burns fungible and non-fungible tokens owned by the Treasury Account. @@ -60,8 +41,7 @@ public class TokenBurnTransaction extends com.hiero.sdk.Transaction> txs) throws InvalidProtocolBufferException { + TokenBurnTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java index 6583cde3f6..593238ccc4 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -44,8 +26,8 @@ public TokenCancelAirdropTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenCancelAirdropTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -60,7 +42,6 @@ public TokenCancelAirdropTransaction() { initFromTransactionBody(); } - /** * Build the transaction body. * diff --git a/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java index 465df2c1cd..f775bbc33b 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -44,8 +26,8 @@ public TokenClaimAirdropTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenClaimAirdropTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java index 19477302f1..d022b225d9 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -29,13 +11,12 @@ import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; +import javax.annotation.Nonnegative; +import javax.annotation.Nullable; /** * Create a new fungible or non-fungible token (NFT) on the Hedera network. @@ -161,6 +142,7 @@ public class TokenCreateTransaction extends Transaction */ @Nullable private Instant expirationTime = null; + private Duration expirationTimeDuration = null; /** * The interval at which the auto-renew account will be charged to @@ -210,7 +192,8 @@ public TokenCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenCreateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -487,7 +470,7 @@ public Key getPauseKey() { /** * Assign the pause key. * - * @param key the pause key + * @param key the pause key * @return {@code this} */ public TokenCreateTransaction setPauseKey(Key key) { @@ -699,7 +682,7 @@ public TokenSupplyType getSupplyType() { /** * Assign the supply type. * - * @param supplyType the supply type + * @param supplyType the supply type * @return {@code this} */ public TokenCreateTransaction setSupplyType(TokenSupplyType supplyType) { @@ -753,12 +736,10 @@ public TokenCreateTransaction setTokenMetadata(byte[] tokenMetadata) { @Override public TokenCreateTransaction freezeWith(@Nullable Client client) { - if ( - autoRenewPeriod != null && - autoRenewAccountId == null && - client != null && - client.getOperatorAccountId() != null - ) { + if (autoRenewPeriod != null + && autoRenewAccountId == null + && client != null + && client.getOperatorAccountId() != null) { autoRenewAccountId = client.getOperatorAccountId(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java index 496ea3d661..0b4ceb61dd 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -27,10 +9,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Deleting a token marks a token as deleted, though it will remain in the @@ -49,8 +30,7 @@ public class TokenDeleteTransaction extends com.hiero.sdk.Transaction> txs) throws InvalidProtocolBufferException { + TokenDeleteTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java index a7896e2e19..6800b9ad5b 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,12 +8,11 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Disassociates the provided Hedera account from the provided Hedera tokens. @@ -45,6 +26,7 @@ public class TokenDissociateTransaction extends com.hiero.sdk.Transaction { @Nullable private AccountId accountId = null; + private List tokenIds = new ArrayList<>(); /** @@ -61,7 +43,9 @@ public TokenDissociateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenDissociateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenDissociateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java index 60dc1f30fb..aaeea4bfd4 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,12 +8,11 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Update the custom fees for a given token. If the token does not have a @@ -46,13 +27,13 @@ public class TokenFeeScheduleUpdateTransaction extends Transaction { @Nullable private TokenId tokenId = null; + private List customFees = new ArrayList<>(); /** * Constructor. */ - public TokenFeeScheduleUpdateTransaction() { - } + public TokenFeeScheduleUpdateTransaction() {} /** * Constructor. @@ -61,7 +42,9 @@ public TokenFeeScheduleUpdateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenFeeScheduleUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenFeeScheduleUpdateTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -111,7 +94,7 @@ public List getCustomFees() { /** * Assign the list of custom fees. * - * @param customFees the list of custom fees + * @param customFees the list of custom fees * @return {@code this} */ public TokenFeeScheduleUpdateTransaction setCustomFees(List customFees) { diff --git a/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java index b71876711e..1519b6b740 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Freezes transfers of the specified token for the account. @@ -41,14 +22,14 @@ public class TokenFreezeTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; + @Nullable private AccountId accountId = null; /** * Constructor. */ - public TokenFreezeTransaction() { - } + public TokenFreezeTransaction() {} /** * Constructor. @@ -57,7 +38,8 @@ public TokenFreezeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenFreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenFreezeTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java index 5717fac489..a00502b574 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Grants KYC to the Hedera accounts for the given Hedera token. @@ -41,14 +22,14 @@ public class TokenGrantKycTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; + @Nullable private AccountId accountId = null; /** * Configure. */ - public TokenGrantKycTransaction() { - } + public TokenGrantKycTransaction() {} /** * Constructor. @@ -57,7 +38,9 @@ public TokenGrantKycTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenGrantKycTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenGrantKycTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenId.java b/sdk/src/main/java/com/hiero/sdk/TokenId.java index e968a7dd0d..162b8878c3 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenId.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenId.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.TokenID; - +import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; -import java.util.Objects; /** * Constructs a TokenId. @@ -145,7 +126,7 @@ public NftId nft(@Nonnegative long serial) { /** * Extract the solidity address as a string. * - * @return the solidity address as a string + * @return the solidity address as a string */ public String toSolidityAddress() { return EntityIdHelper.toSolidityAddress(shard, realm, num); @@ -158,10 +139,10 @@ public String toSolidityAddress() { */ TokenID toProtobuf() { return TokenID.newBuilder() - .setShardNum(shard) - .setRealmNum(realm) - .setTokenNum(num) - .build(); + .setShardNum(shard) + .setRealmNum(realm) + .setTokenNum(num) + .build(); } /** @@ -224,7 +205,7 @@ public int hashCode() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenInfo.java b/sdk/src/main/java/com/hiero/sdk/TokenInfo.java index 80fb3bab7c..0aa5f8be41 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenInfo.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -28,10 +10,9 @@ import com.hiero.sdk.proto.TokenPauseStatus; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; /** * Gets information about a fungible or non-fungible token instance. @@ -197,35 +178,34 @@ public class TokenInfo { public final LedgerId ledgerId; TokenInfo( - TokenId tokenId, - String name, - String symbol, - int decimals, - long totalSupply, - AccountId treasuryAccountId, - @Nullable Key adminKey, - @Nullable Key kycKey, - @Nullable Key freezeKey, - @Nullable Key wipeKey, - @Nullable Key supplyKey, - @Nullable Key feeScheduleKey, - @Nullable Boolean defaultFreezeStatus, - @Nullable Boolean defaultKycStatus, - boolean isDeleted, - @Nullable AccountId autoRenewAccount, - @Nullable Duration autoRenewPeriod, - @Nullable Instant expirationTime, - String tokenMemo, - List customFees, - TokenType tokenType, - TokenSupplyType supplyType, - long maxSupply, - @Nullable Key pauseKey, - @Nullable Boolean pauseStatus, - byte[] metadata, - @Nullable Key metadataKey, - LedgerId ledgerId - ) { + TokenId tokenId, + String name, + String symbol, + int decimals, + long totalSupply, + AccountId treasuryAccountId, + @Nullable Key adminKey, + @Nullable Key kycKey, + @Nullable Key freezeKey, + @Nullable Key wipeKey, + @Nullable Key supplyKey, + @Nullable Key feeScheduleKey, + @Nullable Boolean defaultFreezeStatus, + @Nullable Boolean defaultKycStatus, + boolean isDeleted, + @Nullable AccountId autoRenewAccount, + @Nullable Duration autoRenewPeriod, + @Nullable Instant expirationTime, + String tokenMemo, + List customFees, + TokenType tokenType, + TokenSupplyType supplyType, + long maxSupply, + @Nullable Key pauseKey, + @Nullable Boolean pauseStatus, + byte[] metadata, + @Nullable Key metadataKey, + LedgerId ledgerId) { this.tokenId = tokenId; this.name = name; this.symbol = symbol; @@ -299,35 +279,34 @@ static TokenInfo fromProtobuf(TokenGetInfoResponse response) { var info = response.getTokenInfo(); return new TokenInfo( - TokenId.fromProtobuf(info.getTokenId()), - info.getName(), - info.getSymbol(), - info.getDecimals(), - info.getTotalSupply(), - AccountId.fromProtobuf(info.getTreasury()), - info.hasAdminKey() ? Key.fromProtobufKey(info.getAdminKey()) : null, - info.hasKycKey() ? Key.fromProtobufKey(info.getKycKey()) : null, - info.hasFreezeKey() ? Key.fromProtobufKey(info.getFreezeKey()) : null, - info.hasWipeKey() ? Key.fromProtobufKey(info.getWipeKey()) : null, - info.hasSupplyKey() ? Key.fromProtobufKey(info.getSupplyKey()) : null, - info.hasFeeScheduleKey() ? Key.fromProtobufKey(info.getFeeScheduleKey()) : null, - freezeStatusFromProtobuf(info.getDefaultFreezeStatus()), - kycStatusFromProtobuf(info.getDefaultKycStatus()), - info.getDeleted(), - info.hasAutoRenewAccount() ? AccountId.fromProtobuf(info.getAutoRenewAccount()) : null, - info.hasAutoRenewPeriod() ? DurationConverter.fromProtobuf(info.getAutoRenewPeriod()) : null, - info.hasExpiry() ? InstantConverter.fromProtobuf(info.getExpiry()) : null, - info.getMemo(), - customFeesFromProto(info), - TokenType.valueOf(info.getTokenType()), - TokenSupplyType.valueOf(info.getSupplyType()), - info.getMaxSupply(), - info.hasPauseKey() ? Key.fromProtobufKey(info.getPauseKey()) : null, - pauseStatusFromProtobuf(info.getPauseStatus()), - info.getMetadata().toByteArray(), - info.hasMetadataKey() ? Key.fromProtobufKey(info.getMetadataKey()) : null, - LedgerId.fromByteString(info.getLedgerId()) - ); + TokenId.fromProtobuf(info.getTokenId()), + info.getName(), + info.getSymbol(), + info.getDecimals(), + info.getTotalSupply(), + AccountId.fromProtobuf(info.getTreasury()), + info.hasAdminKey() ? Key.fromProtobufKey(info.getAdminKey()) : null, + info.hasKycKey() ? Key.fromProtobufKey(info.getKycKey()) : null, + info.hasFreezeKey() ? Key.fromProtobufKey(info.getFreezeKey()) : null, + info.hasWipeKey() ? Key.fromProtobufKey(info.getWipeKey()) : null, + info.hasSupplyKey() ? Key.fromProtobufKey(info.getSupplyKey()) : null, + info.hasFeeScheduleKey() ? Key.fromProtobufKey(info.getFeeScheduleKey()) : null, + freezeStatusFromProtobuf(info.getDefaultFreezeStatus()), + kycStatusFromProtobuf(info.getDefaultKycStatus()), + info.getDeleted(), + info.hasAutoRenewAccount() ? AccountId.fromProtobuf(info.getAutoRenewAccount()) : null, + info.hasAutoRenewPeriod() ? DurationConverter.fromProtobuf(info.getAutoRenewPeriod()) : null, + info.hasExpiry() ? InstantConverter.fromProtobuf(info.getExpiry()) : null, + info.getMemo(), + customFeesFromProto(info), + TokenType.valueOf(info.getTokenType()), + TokenSupplyType.valueOf(info.getSupplyType()), + info.getMaxSupply(), + info.hasPauseKey() ? Key.fromProtobufKey(info.getPauseKey()) : null, + pauseStatusFromProtobuf(info.getPauseStatus()), + info.getMetadata().toByteArray(), + info.hasMetadataKey() ? Key.fromProtobufKey(info.getMetadataKey()) : null, + LedgerId.fromByteString(info.getLedgerId())); } /** @@ -362,7 +341,9 @@ private static List customFeesFromProto(com.hiero.sdk.proto.TokenInfo * @return the protobuf */ static TokenFreezeStatus freezeStatusToProtobuf(@Nullable Boolean freezeStatus) { - return freezeStatus == null ? TokenFreezeStatus.FreezeNotApplicable : freezeStatus ? TokenFreezeStatus.Frozen : TokenFreezeStatus.Unfrozen; + return freezeStatus == null + ? TokenFreezeStatus.FreezeNotApplicable + : freezeStatus ? TokenFreezeStatus.Frozen : TokenFreezeStatus.Unfrozen; } /** @@ -372,7 +353,9 @@ static TokenFreezeStatus freezeStatusToProtobuf(@Nullable Boolean freezeStatus) * @return the protobuf */ static TokenKycStatus kycStatusToProtobuf(@Nullable Boolean kycStatus) { - return kycStatus == null ? TokenKycStatus.KycNotApplicable : kycStatus ? TokenKycStatus.Granted : TokenKycStatus.Revoked; + return kycStatus == null + ? TokenKycStatus.KycNotApplicable + : kycStatus ? TokenKycStatus.Granted : TokenKycStatus.Revoked; } /** @@ -382,7 +365,9 @@ static TokenKycStatus kycStatusToProtobuf(@Nullable Boolean kycStatus) { * @return the protobuf */ static TokenPauseStatus pauseStatusToProtobuf(@Nullable Boolean pauseStatus) { - return pauseStatus == null ? TokenPauseStatus.PauseNotApplicable : pauseStatus ? TokenPauseStatus.Paused : TokenPauseStatus.Unpaused; + return pauseStatus == null + ? TokenPauseStatus.PauseNotApplicable + : pauseStatus ? TokenPauseStatus.Paused : TokenPauseStatus.Unpaused; } /** @@ -392,21 +377,21 @@ static TokenPauseStatus pauseStatusToProtobuf(@Nullable Boolean pauseStatus) { */ TokenGetInfoResponse toProtobuf() { var tokenInfoBuilder = com.hiero.sdk.proto.TokenInfo.newBuilder() - .setTokenId(tokenId.toProtobuf()) - .setName(name) - .setSymbol(symbol) - .setDecimals(decimals) - .setTotalSupply(totalSupply) - .setTreasury(treasuryAccountId.toProtobuf()) - .setDefaultFreezeStatus(freezeStatusToProtobuf(defaultFreezeStatus)) - .setDefaultKycStatus(kycStatusToProtobuf(defaultKycStatus)) - .setDeleted(isDeleted) - .setMemo(tokenMemo) - .setTokenType(tokenType.code) - .setSupplyType(supplyType.code) - .setMaxSupply(maxSupply) - .setPauseStatus(pauseStatusToProtobuf(pauseStatus)) - .setLedgerId(ledgerId.toByteString()); + .setTokenId(tokenId.toProtobuf()) + .setName(name) + .setSymbol(symbol) + .setDecimals(decimals) + .setTotalSupply(totalSupply) + .setTreasury(treasuryAccountId.toProtobuf()) + .setDefaultFreezeStatus(freezeStatusToProtobuf(defaultFreezeStatus)) + .setDefaultKycStatus(kycStatusToProtobuf(defaultKycStatus)) + .setDeleted(isDeleted) + .setMemo(tokenMemo) + .setTokenType(tokenType.code) + .setSupplyType(supplyType.code) + .setMaxSupply(maxSupply) + .setPauseStatus(pauseStatusToProtobuf(pauseStatus)) + .setLedgerId(ledgerId.toByteString()); if (adminKey != null) { tokenInfoBuilder.setAdminKey(adminKey.toProtobufKey()); } @@ -452,35 +437,35 @@ TokenGetInfoResponse toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("tokenId", tokenId) - .add("name", name) - .add("symbol", symbol) - .add("decimals", decimals) - .add("totalSupply", totalSupply) - .add("treasuryAccountId", treasuryAccountId) - .add("adminKey", adminKey) - .add("kycKey", kycKey) - .add("freezeKey", freezeKey) - .add("wipeKey", wipeKey) - .add("supplyKey", supplyKey) - .add("feeScheduleKey", feeScheduleKey) - .add("defaultFreezeStatus", defaultFreezeStatus) - .add("defaultKycStatus", defaultKycStatus) - .add("isDeleted", isDeleted) - .add("autoRenewAccount", autoRenewAccount) - .add("autoRenewPeriod", autoRenewPeriod) - .add("expirationTime", expirationTime) - .add("tokenMemo", tokenMemo) - .add("customFees", customFees) - .add("tokenType", tokenType) - .add("supplyType", supplyType) - .add("maxSupply", maxSupply) - .add("pauseKey", pauseKey) - .add("pauseStatus", pauseStatus) - .add("metadata", metadata) - .add("metadataKey", metadataKey) - .add("ledgerId", ledgerId) - .toString(); + .add("tokenId", tokenId) + .add("name", name) + .add("symbol", symbol) + .add("decimals", decimals) + .add("totalSupply", totalSupply) + .add("treasuryAccountId", treasuryAccountId) + .add("adminKey", adminKey) + .add("kycKey", kycKey) + .add("freezeKey", freezeKey) + .add("wipeKey", wipeKey) + .add("supplyKey", supplyKey) + .add("feeScheduleKey", feeScheduleKey) + .add("defaultFreezeStatus", defaultFreezeStatus) + .add("defaultKycStatus", defaultKycStatus) + .add("isDeleted", isDeleted) + .add("autoRenewAccount", autoRenewAccount) + .add("autoRenewPeriod", autoRenewPeriod) + .add("expirationTime", expirationTime) + .add("tokenMemo", tokenMemo) + .add("customFees", customFees) + .add("tokenType", tokenType) + .add("supplyType", supplyType) + .add("maxSupply", maxSupply) + .add("pauseKey", pauseKey) + .add("pauseStatus", pauseStatus) + .add("metadata", metadata) + .add("metadataKey", metadataKey) + .add("ledgerId", ledgerId) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java index 660f40dcd7..33ad2a1938 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Query; @@ -40,8 +22,7 @@ public class TokenInfoQuery extends com.hiero.sdk.Query> txs) throws InvalidProtocolBufferException { + TokenMintTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java b/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java index d3efa9b2cc..9d85a648a6 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java @@ -1,37 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.BoolValue; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.GrantedNftAllowance; import com.hiero.sdk.proto.NftAllowance; import com.hiero.sdk.proto.NftRemoveAllowance; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Class to encapsulate the nft methods for token allowance's. @@ -60,7 +39,8 @@ public class TokenNftAllowance { * The account ID of the spender who is granted approvedForAll allowance and granting * approval on an NFT serial to another spender. */ - @Nullable AccountId delegatingSpender; + @Nullable + AccountId delegatingSpender; /** * The list of serial numbers that the spender is permitted to transfer. @@ -85,13 +65,12 @@ public class TokenNftAllowance { * @param allSerials grant for all serial's */ TokenNftAllowance( - @Nullable TokenId tokenId, - @Nullable AccountId ownerAccountId, - @Nullable AccountId spenderAccountId, - @Nullable AccountId delegatingSpender, - Collection serialNumbers, - @Nullable Boolean allSerials - ) { + @Nullable TokenId tokenId, + @Nullable AccountId ownerAccountId, + @Nullable AccountId spenderAccountId, + @Nullable AccountId delegatingSpender, + Collection serialNumbers, + @Nullable Boolean allSerials) { this.tokenId = tokenId; this.ownerAccountId = ownerAccountId; this.spenderAccountId = spenderAccountId; @@ -108,13 +87,12 @@ public class TokenNftAllowance { */ static TokenNftAllowance copyFrom(TokenNftAllowance allowance) { return new TokenNftAllowance( - allowance.tokenId, - allowance.ownerAccountId, - allowance.spenderAccountId, - allowance.delegatingSpender, - allowance.serialNumbers, - allowance.allSerials - ); + allowance.tokenId, + allowance.ownerAccountId, + allowance.spenderAccountId, + allowance.delegatingSpender, + allowance.serialNumbers, + allowance.allSerials); } /** @@ -125,13 +103,16 @@ static TokenNftAllowance copyFrom(TokenNftAllowance allowance) { */ static TokenNftAllowance fromProtobuf(NftAllowance allowanceProto) { return new TokenNftAllowance( - allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, - allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, - allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, - allowanceProto.hasDelegatingSpender() ? AccountId.fromProtobuf(allowanceProto.getDelegatingSpender()) : null, - allowanceProto.getSerialNumbersList(), - allowanceProto.hasApprovedForAll() ? allowanceProto.getApprovedForAll().getValue() : null - ); + allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, + allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, + allowanceProto.hasSpender() ? AccountId.fromProtobuf(allowanceProto.getSpender()) : null, + allowanceProto.hasDelegatingSpender() + ? AccountId.fromProtobuf(allowanceProto.getDelegatingSpender()) + : null, + allowanceProto.getSerialNumbersList(), + allowanceProto.hasApprovedForAll() + ? allowanceProto.getApprovedForAll().getValue() + : null); } /** @@ -187,7 +168,8 @@ NftAllowance toProtobuf() { } builder.addAllSerialNumbers(serialNumbers); if (allSerials != null) { - builder.setApprovedForAll(BoolValue.newBuilder().setValue(allSerials).build()); + builder.setApprovedForAll( + BoolValue.newBuilder().setValue(allSerials).build()); } return builder.build(); } @@ -221,10 +203,10 @@ public byte[] toBytes() { @Override public String toString() { var stringHelper = MoreObjects.toStringHelper(this) - .add("tokenId", tokenId) - .add("ownerAccountId", ownerAccountId) - .add("spenderAccountId", spenderAccountId) - .add("delegatingSpender", delegatingSpender); + .add("tokenId", tokenId) + .add("ownerAccountId", ownerAccountId) + .add("spenderAccountId", spenderAccountId) + .add("delegatingSpender", delegatingSpender); if (allSerials != null) { stringHelper.add("allSerials", allSerials); } else { diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java b/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java index b7da692334..ebea6ebc2f 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java @@ -1,31 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * @@ -75,13 +56,12 @@ public class TokenNftInfo { * @param spenderId the spender of the allowance (null if not an allowance) */ TokenNftInfo( - NftId nftId, - AccountId accountId, - Instant creationTime, - byte[] metadata, - LedgerId ledgerId, - @Nullable AccountId spenderId - ) { + NftId nftId, + AccountId accountId, + Instant creationTime, + byte[] metadata, + LedgerId ledgerId, + @Nullable AccountId spenderId) { this.nftId = nftId; this.accountId = accountId; this.creationTime = Objects.requireNonNull(creationTime); @@ -98,13 +78,12 @@ public class TokenNftInfo { */ static TokenNftInfo fromProtobuf(com.hiero.sdk.proto.TokenNftInfo info) { return new TokenNftInfo( - NftId.fromProtobuf(info.getNftID()), - AccountId.fromProtobuf(info.getAccountID()), - InstantConverter.fromProtobuf(info.getCreationTime()), - info.getMetadata().toByteArray(), - LedgerId.fromByteString(info.getLedgerId()), - info.hasSpenderId() ? AccountId.fromProtobuf(info.getSpenderId()) : null - ); + NftId.fromProtobuf(info.getNftID()), + AccountId.fromProtobuf(info.getAccountID()), + InstantConverter.fromProtobuf(info.getCreationTime()), + info.getMetadata().toByteArray(), + LedgerId.fromByteString(info.getLedgerId()), + info.hasSpenderId() ? AccountId.fromProtobuf(info.getSpenderId()) : null); } /** @@ -125,11 +104,11 @@ public static TokenNftInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferE */ com.hiero.sdk.proto.TokenNftInfo toProtobuf() { var builder = com.hiero.sdk.proto.TokenNftInfo.newBuilder() - .setNftID(nftId.toProtobuf()) - .setAccountID(accountId.toProtobuf()) - .setCreationTime(InstantConverter.toProtobuf(creationTime)) - .setMetadata(ByteString.copyFrom(metadata)) - .setLedgerId(ledgerId.toByteString()); + .setNftID(nftId.toProtobuf()) + .setAccountID(accountId.toProtobuf()) + .setCreationTime(InstantConverter.toProtobuf(creationTime)) + .setMetadata(ByteString.copyFrom(metadata)) + .setLedgerId(ledgerId.toByteString()); if (spenderId != null) { builder.setSpenderId(spenderId.toProtobuf()); } @@ -139,13 +118,13 @@ com.hiero.sdk.proto.TokenNftInfo toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("nftId", nftId) - .add("accountId", accountId) - .add("creationTime", creationTime) - .add("metadata", metadata) - .add("ledgerId", ledgerId) - .add("spenderId", spenderId) - .toString(); + .add("nftId", nftId) + .add("accountId", accountId) + .add("creationTime", creationTime) + .add("metadata", metadata) + .add("ledgerId", ledgerId) + .add("spenderId", spenderId) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java index 01edb436e4..26d6b072b3 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Query; @@ -46,6 +28,7 @@ public class TokenNftInfoQuery extends com.hiero.sdk.Query, T */ @Nullable private NftId nftId = null; + @Nullable private TokenId tokenId = null; /** @@ -53,14 +36,14 @@ public class TokenNftInfoQuery extends com.hiero.sdk.Query, T */ @Nullable private AccountId accountId = null; + private long start = 0; private long end = 0; /** * Constructor. */ - public TokenNftInfoQuery() { - } + public TokenNftInfoQuery() {} /** * Sets the NFT ID for which information is requested. @@ -203,9 +186,11 @@ void validateChecksums(Client client) throws BadEntityIdException { CompletableFuture onExecuteAsync(Client client) { int modesEnabled = (nftId != null ? 1 : 0) + (tokenId != null ? 1 : 0) + (accountId != null ? 1 : 0); if (modesEnabled > 1) { - throw new IllegalStateException("TokenNftInfoQuery must be one of byNftId, byTokenId, or byAccountId, but multiple of these modes have been selected"); + throw new IllegalStateException( + "TokenNftInfoQuery must be one of byNftId, byTokenId, or byAccountId, but multiple of these modes have been selected"); } else if (modesEnabled == 0) { - throw new IllegalStateException("TokenNftInfoQuery must be one of byNftId, byTokenId, or byAccountId, but none of these modes have been selected"); + throw new IllegalStateException( + "TokenNftInfoQuery must be one of byNftId, byTokenId, or byAccountId, but none of these modes have been selected"); } return super.onExecuteAsync(client); } @@ -213,7 +198,7 @@ CompletableFuture onExecuteAsync(Client client) { @Override void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TokenGetNftInfoQuery.newBuilder(); - if(nftId != null) { + if (nftId != null) { builder.setNftID(nftId.toProtobuf()); } queryBuilder.setTokenGetNftInfo(builder.setHeader(header)); @@ -231,7 +216,8 @@ QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { @Override List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { - return Collections.singletonList(TokenNftInfo.fromProtobuf(response.getTokenGetNftInfo().getNft())); + return Collections.singletonList( + TokenNftInfo.fromProtobuf(response.getTokenGetNftInfo().getNft())); } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java b/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java index 2c78c9cc22..b57b9aab08 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -85,12 +67,11 @@ static ArrayList fromProtobuf(List tokenTra for (var transfer : tokenTransfer.getNftTransfersList()) { transfers.add(new TokenNftTransfer( - tokenId, - AccountId.fromProtobuf(transfer.getSenderAccountID()), - AccountId.fromProtobuf(transfer.getReceiverAccountID()), - transfer.getSerialNumber(), - transfer.getIsApproval() - )); + tokenId, + AccountId.fromProtobuf(transfer.getSenderAccountID()), + AccountId.fromProtobuf(transfer.getReceiverAccountID()), + transfer.getSerialNumber(), + transfer.getIsApproval())); } } @@ -106,14 +87,11 @@ static ArrayList fromProtobuf(List tokenTra */ @Deprecated public static TokenNftTransfer fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf( - List.of( - TokenTransferList.newBuilder() - .setToken(TokenID.newBuilder().build()) - .addNftTransfers(NftTransfer.parseFrom(bytes)) - .build() - ) - ).get(0); + return fromProtobuf(List.of(TokenTransferList.newBuilder() + .setToken(TokenID.newBuilder().build()) + .addNftTransfers(NftTransfer.parseFrom(bytes)) + .build())) + .get(0); } /** @@ -123,22 +101,22 @@ public static TokenNftTransfer fromBytes(byte[] bytes) throws InvalidProtocolBuf */ NftTransfer toProtobuf() { return NftTransfer.newBuilder() - .setSenderAccountID(sender.toProtobuf()) - .setReceiverAccountID(receiver.toProtobuf()) - .setSerialNumber(serial) - .setIsApproval(isApproved) - .build(); + .setSenderAccountID(sender.toProtobuf()) + .setReceiverAccountID(receiver.toProtobuf()) + .setSerialNumber(serial) + .setIsApproval(isApproved) + .build(); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("tokenId", tokenId) - .add("sender", sender) - .add("receiver", receiver) - .add("serial", serial) - .add("isApproved", isApproved) - .toString(); + .add("tokenId", tokenId) + .add("sender", sender) + .add("receiver", receiver) + .add("serial", serial) + .add("isApproved", isApproved) + .toString(); } /** @@ -173,13 +151,15 @@ public boolean equals(Object o) { return false; } TokenNftTransfer that = (TokenNftTransfer) o; - return serial == that.serial && isApproved == that.isApproved && tokenId.equals(that.tokenId) && sender.equals( - that.sender) && receiver.equals(that.receiver); + return serial == that.serial + && isApproved == that.isApproved + && tokenId.equals(that.tokenId) + && sender.equals(that.sender) + && receiver.equals(that.receiver); } @Override public int hashCode() { return Objects.hash(tokenId, sender, receiver, serial, isApproved); } - } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java index 2f1a7b6168..a207a9e7ff 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * A token pause transaction prevents the token from being involved in any @@ -41,15 +22,14 @@ * * See
Hedera Documentation */ -public class TokenPauseTransaction extends Transaction{ +public class TokenPauseTransaction extends Transaction { @Nullable private TokenId tokenId = null; /** * Constructor. */ - public TokenPauseTransaction() { - } + public TokenPauseTransaction() {} /** * Constructor. @@ -58,7 +38,8 @@ public TokenPauseTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenPauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenPauseTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java b/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java index dea356237b..5e9e7a4744 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java @@ -1,27 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import java.time.Duration; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -46,12 +27,12 @@ public class TokenRejectFlow { /** * A list of one or more token rejections (a fungible/common token type). */ - private List tokenIds = new ArrayList<>(); + private List tokenIds = new ArrayList<>(); /** * A list of one or more token rejections (a single specific serialized non-fungible/unique token). */ - private List nftIds = new ArrayList<>(); + private List nftIds = new ArrayList<>(); @Nullable private List nodeAccountIds = null; @@ -215,7 +196,6 @@ public TokenRejectFlow signWithOperator(Client client) { return this; } - private void fillOutTransaction(final Transaction transaction) { if (nodeAccountIds != null) { transaction.setNodeAccountIds(nodeAccountIds); @@ -232,9 +212,9 @@ private void fillOutTransaction(final Transaction transaction) { private TokenRejectTransaction createTokenRejectTransaction() { var tokenRejectTransaction = new TokenRejectTransaction() - .setOwnerId(ownerId) - .setTokenIds(tokenIds) - .setNftIds(nftIds); + .setOwnerId(ownerId) + .setTokenIds(tokenIds) + .setNftIds(nftIds); fillOutTransaction(tokenRejectTransaction); @@ -242,13 +222,13 @@ private TokenRejectTransaction createTokenRejectTransaction() { } private TokenDissociateTransaction createTokenDissociateTransaction() { - List tokenIdsToReject = Stream.concat(tokenIds.stream(), nftIds.stream().map(nftId -> nftId.tokenId)) - .distinct() - .collect(Collectors.toList()); + List tokenIdsToReject = Stream.concat( + tokenIds.stream(), nftIds.stream().map(nftId -> nftId.tokenId)) + .distinct() + .collect(Collectors.toList()); - var tokenDissociateTransaction = new TokenDissociateTransaction() - .setAccountId(ownerId) - .setTokenIds(tokenIdsToReject); + var tokenDissociateTransaction = + new TokenDissociateTransaction().setAccountId(ownerId).setTokenIds(tokenIdsToReject); fillOutTransaction(tokenDissociateTransaction); @@ -277,7 +257,7 @@ public TransactionResponse execute(Client client) throws PrecheckStatusException * @throws TimeoutException when the transaction times out */ public TransactionResponse execute(Client client, Duration timeoutPerTransaction) - throws PrecheckStatusException, TimeoutException { + throws PrecheckStatusException, TimeoutException { try { var tokenRejectTxResponse = createTokenRejectTransaction().execute(client, timeoutPerTransaction); tokenRejectTxResponse.getReceipt(client, timeoutPerTransaction); @@ -309,9 +289,11 @@ public CompletableFuture executeAsync(Client client) { * @return the response */ public CompletableFuture executeAsync(Client client, Duration timeoutPerTransaction) { - return createTokenRejectTransaction().executeAsync(client, timeoutPerTransaction) - .thenCompose(tokenRejectResponse -> tokenRejectResponse.getReceiptQuery().executeAsync(client, timeoutPerTransaction)) - .thenCompose(receipt -> createTokenDissociateTransaction().executeAsync(client, timeoutPerTransaction)); + return createTokenRejectTransaction() + .executeAsync(client, timeoutPerTransaction) + .thenCompose(tokenRejectResponse -> + tokenRejectResponse.getReceiptQuery().executeAsync(client, timeoutPerTransaction)) + .thenCompose(receipt -> createTokenDissociateTransaction().executeAsync(client, timeoutPerTransaction)); } /** @@ -331,8 +313,8 @@ public void executeAsync(Client client, BiConsumer callback) { + public void executeAsync( + Client client, Duration timeoutPerTransaction, BiConsumer callback) { ConsumerHelper.biConsumer(executeAsync(client, timeoutPerTransaction), callback); } @@ -355,8 +337,11 @@ public void executeAsync(Client client, Consumer onSuccess, * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void executeAsync(Client client, Duration timeoutPerTransaction, Consumer onSuccess, - Consumer onFailure) { + public void executeAsync( + Client client, + Duration timeoutPerTransaction, + Consumer onSuccess, + Consumer onFailure) { ConsumerHelper.twoConsumers(executeAsync(client, timeoutPerTransaction), onSuccess, onFailure); } } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java index c1e9a000e2..9a9843eebe 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -49,12 +31,12 @@ public class TokenRejectTransaction extends Transaction /** * A list of one or more token rejections (a fungible/common token type). */ - private List tokenIds = new ArrayList<>(); + private List tokenIds = new ArrayList<>(); /** * A list of one or more token rejections (a single specific serialized non-fungible/unique token). */ - private List nftIds = new ArrayList<>(); + private List nftIds = new ArrayList<>(); /** * Constructor @@ -67,9 +49,8 @@ public TokenRejectTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenRejectTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + TokenRejectTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -180,11 +161,14 @@ TokenRejectTransactionBody.Builder build() { } for (TokenId tokenId : tokenIds) { - builder.addRejections(TokenReference.newBuilder().setFungibleToken(tokenId.toProtobuf()).build()); + builder.addRejections(TokenReference.newBuilder() + .setFungibleToken(tokenId.toProtobuf()) + .build()); } for (NftId nftId : nftIds) { - builder.addRejections(TokenReference.newBuilder().setNft(nftId.toProtobuf()).build()); + builder.addRejections( + TokenReference.newBuilder().setNft(nftId.toProtobuf()).build()); } return builder; diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java b/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java index 28bc2e2568..fa33af8641 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java @@ -1,29 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.TokenFreezeStatus; import com.hiero.sdk.proto.TokenKycStatus; - import javax.annotation.Nullable; /** @@ -74,14 +55,13 @@ public class TokenRelationship { public final boolean automaticAssociation; TokenRelationship( - TokenId tokenId, - String symbol, - long balance, - @Nullable Boolean kycStatus, - @Nullable Boolean freezeStatus, - int decimals, - boolean automaticAssociation - ) { + TokenId tokenId, + String symbol, + long balance, + @Nullable Boolean kycStatus, + @Nullable Boolean freezeStatus, + int decimals, + boolean automaticAssociation) { this.tokenId = tokenId; this.symbol = symbol; this.balance = balance; @@ -121,14 +101,13 @@ static Boolean kycStatusFromProtobuf(TokenKycStatus kycStatus) { */ static TokenRelationship fromProtobuf(com.hiero.sdk.proto.TokenRelationship tokenRelationship) { return new TokenRelationship( - TokenId.fromProtobuf(tokenRelationship.getTokenId()), - tokenRelationship.getSymbol(), - tokenRelationship.getBalance(), - kycStatusFromProtobuf(tokenRelationship.getKycStatus()), - freezeStatusFromProtobuf(tokenRelationship.getFreezeStatus()), - tokenRelationship.getDecimals(), - tokenRelationship.getAutomaticAssociation() - ); + TokenId.fromProtobuf(tokenRelationship.getTokenId()), + tokenRelationship.getSymbol(), + tokenRelationship.getBalance(), + kycStatusFromProtobuf(tokenRelationship.getKycStatus()), + freezeStatusFromProtobuf(tokenRelationship.getFreezeStatus()), + tokenRelationship.getDecimals(), + tokenRelationship.getAutomaticAssociation()); } /** @@ -139,7 +118,8 @@ static TokenRelationship fromProtobuf(com.hiero.sdk.proto.TokenRelationship toke * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenRelationship fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TokenRelationship.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TokenRelationship.parseFrom(bytes).toBuilder() + .build()); } /** @@ -149,7 +129,9 @@ public static TokenRelationship fromBytes(byte[] bytes) throws InvalidProtocolBu * @return the freeze status */ static TokenFreezeStatus freezeStatusToProtobuf(@Nullable Boolean freezeStatus) { - return freezeStatus == null ? TokenFreezeStatus.FreezeNotApplicable : freezeStatus ? TokenFreezeStatus.Frozen : TokenFreezeStatus.Unfrozen; + return freezeStatus == null + ? TokenFreezeStatus.FreezeNotApplicable + : freezeStatus ? TokenFreezeStatus.Frozen : TokenFreezeStatus.Unfrozen; } /** @@ -159,7 +141,9 @@ static TokenFreezeStatus freezeStatusToProtobuf(@Nullable Boolean freezeStatus) * @return the kyc status */ static TokenKycStatus kycStatusToProtobuf(@Nullable Boolean kycStatus) { - return kycStatus == null ? TokenKycStatus.KycNotApplicable : kycStatus ? TokenKycStatus.Granted : TokenKycStatus.Revoked; + return kycStatus == null + ? TokenKycStatus.KycNotApplicable + : kycStatus ? TokenKycStatus.Granted : TokenKycStatus.Revoked; } /** @@ -169,27 +153,27 @@ static TokenKycStatus kycStatusToProtobuf(@Nullable Boolean kycStatus) { */ com.hiero.sdk.proto.TokenRelationship toProtobuf() { return com.hiero.sdk.proto.TokenRelationship.newBuilder() - .setTokenId(tokenId.toProtobuf()) - .setSymbol(symbol) - .setBalance(balance) - .setKycStatus(kycStatusToProtobuf(kycStatus)) - .setFreezeStatus(freezeStatusToProtobuf(freezeStatus)) - .setDecimals(decimals) - .setAutomaticAssociation(automaticAssociation) - .build(); + .setTokenId(tokenId.toProtobuf()) + .setSymbol(symbol) + .setBalance(balance) + .setKycStatus(kycStatusToProtobuf(kycStatus)) + .setFreezeStatus(freezeStatusToProtobuf(freezeStatus)) + .setDecimals(decimals) + .setAutomaticAssociation(automaticAssociation) + .build(); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("tokenId", tokenId) - .add("symbol", symbol) - .add("balance", balance) - .add("kycStatus", kycStatus) - .add("freezeStatus", freezeStatus) - .add("decimals", decimals) - .add("automaticAssociation", automaticAssociation) - .toString(); + .add("tokenId", tokenId) + .add("symbol", symbol) + .add("balance", balance) + .add("kycStatus", kycStatus) + .add("freezeStatus", freezeStatus) + .add("decimals", decimals) + .add("automaticAssociation", automaticAssociation) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java index 5693c94e0f..830b625ed5 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Revokes the KYC flag to the Hedera account for the given Hedera token. @@ -54,8 +35,7 @@ public class TokenRevokeKycTransaction extends com.hiero.sdk.Transaction> txs) throws InvalidProtocolBufferException { + TokenRevokeKycTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java b/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java index ee7f0317f1..ad7d7fe3d7 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java b/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java index c29d82620b..99c571b1d2 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.hiero.sdk.proto.AccountAmount; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; /** * A token transfer record. @@ -37,6 +18,7 @@ public class TokenTransfer { @Nullable Integer expectedDecimals; + long amount; boolean isApproved; @@ -62,7 +44,8 @@ public class TokenTransfer { * @param expectedDecimals the expected decimals * @param isApproved is it approved */ - TokenTransfer(TokenId tokenId, AccountId accountId, long amount, @Nullable Integer expectedDecimals, boolean isApproved) { + TokenTransfer( + TokenId tokenId, AccountId accountId, long amount, @Nullable Integer expectedDecimals, boolean isApproved) { this.tokenId = tokenId; this.accountId = accountId; this.amount = amount; @@ -84,12 +67,13 @@ static List fromProtobuf(List fromProtobuf(List transfers = new ArrayList<>(); List nftTransfers = new ArrayList<>(); - TokenTransferList(TokenId tokenId, @Nullable Integer expectDecimals, @Nullable TokenTransfer transfer, - @Nullable TokenNftTransfer nftTransfer) { + TokenTransferList( + TokenId tokenId, + @Nullable Integer expectDecimals, + @Nullable TokenTransfer transfer, + @Nullable TokenNftTransfer nftTransfer) { this.tokenId = tokenId; this.expectDecimals = expectDecimals; @@ -60,12 +47,13 @@ com.hiero.sdk.proto.TokenTransferList toProtobuf() { } var builder = com.hiero.sdk.proto.TokenTransferList.newBuilder() - .setToken(tokenId.toProtobuf()) - .addAllTransfers(transfers) - .addAllNftTransfers(nftTransfers); + .setToken(tokenId.toProtobuf()) + .addAllTransfers(transfers) + .addAllNftTransfers(nftTransfers); if (expectDecimals != null) { - builder.setExpectedDecimals(UInt32Value.newBuilder().setValue(expectDecimals).build()); + builder.setExpectedDecimals( + UInt32Value.newBuilder().setValue(expectDecimals).build()); } return builder.build(); diff --git a/sdk/src/main/java/com/hiero/sdk/TokenType.java b/sdk/src/main/java/com/hiero/sdk/TokenType.java index 853800cd6f..135803374b 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenType.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenType.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; /** diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java index a5a8e11c52..765f0e206e 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Unfreezes transfers of the specified token for the account. @@ -41,14 +22,14 @@ public class TokenUnfreezeTransaction extends com.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; + @Nullable private AccountId accountId = null; /** * Constructor. */ - public TokenUnfreezeTransaction() { - } + public TokenUnfreezeTransaction() {} /** * Constructor. @@ -57,7 +38,9 @@ public TokenUnfreezeTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUnfreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenUnfreezeTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java index 9b1fbd7abf..939a39e49c 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * A token unpause transaction is a transaction that unpauses the token @@ -39,15 +20,14 @@ * * See Hedera Documentation */ -public class TokenUnpauseTransaction extends Transaction{ +public class TokenUnpauseTransaction extends Transaction { @Nullable private TokenId tokenId = null; /** * Constructor */ - public TokenUnpauseTransaction() { - } + public TokenUnpauseTransaction() {} /** * Constructor. @@ -56,7 +36,8 @@ public TokenUnpauseTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUnpauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenUnpauseTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java index 298319ea0c..7566389a2a 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -56,8 +38,7 @@ public class TokenUpdateNftsTransaction extends Transaction> txs) - throws InvalidProtocolBufferException { + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java index 036e479c98..7df4f765f0 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -31,10 +13,9 @@ import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * A transaction that updates the properties of an existing token. The admin @@ -142,6 +123,7 @@ public class TokenUpdateTransaction extends Transaction */ @Nullable private Instant expirationTime = null; + private Duration expirationTimeDuration = null; /** @@ -170,8 +152,7 @@ public class TokenUpdateTransaction extends Transaction /** * Constructor. */ - public TokenUpdateTransaction() { - } + public TokenUpdateTransaction() {} /** * Constructor. @@ -180,7 +161,8 @@ public TokenUpdateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TokenUpdateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java b/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java index 750fa5a67a..182da854ea 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,13 +8,12 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nonnegative; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; +import javax.annotation.Nonnegative; +import javax.annotation.Nullable; /** * Wipes the provided amount of fungible or non-fungible tokens from the @@ -70,8 +51,7 @@ public class TokenWipeTransaction extends com.hiero.sdk.Transaction> txs) throws InvalidProtocolBufferException { + TokenWipeTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -261,4 +242,3 @@ void onScheduled(SchedulableTransactionBody.Builder scheduled) { scheduled.setTokenWipe(build()); } } - diff --git a/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java index 04705b62d0..1fa5795da8 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -27,10 +9,9 @@ import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Create a topic to be used for consensus. @@ -107,7 +88,8 @@ public TopicCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { + TopicCreateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java index 94077f8c0f..9ee23019d7 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -26,10 +8,9 @@ import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Delete a topic. @@ -46,8 +27,7 @@ public final class TopicDeleteTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + TopicDeleteTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicId.java b/sdk/src/main/java/com/hiero/sdk/TopicId.java index 3dc5a91573..b3fcec1761 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicId.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicId.java @@ -1,30 +1,11 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.hiero.sdk.proto.TopicID; - +import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; -import java.util.Objects; /** * Unique identifier for a topic (used by the consensus service). @@ -147,10 +128,10 @@ public String toSolidityAddress() { */ TopicID toProtobuf() { return TopicID.newBuilder() - .setShardNum(shard) - .setRealmNum(realm) - .setTopicNum(num) - .build(); + .setShardNum(shard) + .setRealmNum(realm) + .setTopicNum(num) + .build(); } /** @@ -213,7 +194,7 @@ public int hashCode() { } @Override - public boolean equals( Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicInfo.java b/sdk/src/main/java/com/hiero/sdk/TopicInfo.java index 2fb6165e5d..7dbe271a8d 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicInfo.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicInfo.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -26,7 +8,6 @@ import com.hiero.sdk.proto.ConsensusTopicInfo; import java.time.Duration; import java.time.Instant; - import javax.annotation.Nullable; /** @@ -89,17 +70,16 @@ public final class TopicInfo { public final LedgerId ledgerId; private TopicInfo( - TopicId topicId, - String topicMemo, - ByteString runningHash, - long sequenceNumber, - Instant expirationTime, - @Nullable Key adminKey, - @Nullable Key submitKey, - Duration autoRenewPeriod, - @Nullable AccountId autoRenewAccountId, - LedgerId ledgerId - ) { + TopicId topicId, + String topicMemo, + ByteString runningHash, + long sequenceNumber, + Instant expirationTime, + @Nullable Key adminKey, + @Nullable Key submitKey, + Duration autoRenewPeriod, + @Nullable AccountId autoRenewAccountId, + LedgerId ledgerId) { this.topicId = topicId; this.topicMemo = topicMemo; this.runningHash = runningHash; @@ -121,30 +101,24 @@ private TopicInfo( static TopicInfo fromProtobuf(ConsensusGetTopicInfoResponse topicInfoResponse) { var topicInfo = topicInfoResponse.getTopicInfo(); - var adminKey = topicInfo.hasAdminKey() - ? Key.fromProtobufKey(topicInfo.getAdminKey()) - : null; + var adminKey = topicInfo.hasAdminKey() ? Key.fromProtobufKey(topicInfo.getAdminKey()) : null; - var submitKey = topicInfo.hasSubmitKey() - ? Key.fromProtobufKey(topicInfo.getSubmitKey()) - : null; + var submitKey = topicInfo.hasSubmitKey() ? Key.fromProtobufKey(topicInfo.getSubmitKey()) : null; - var autoRenewAccountId = topicInfo.hasAutoRenewAccount() - ? AccountId.fromProtobuf(topicInfo.getAutoRenewAccount()) - : null; + var autoRenewAccountId = + topicInfo.hasAutoRenewAccount() ? AccountId.fromProtobuf(topicInfo.getAutoRenewAccount()) : null; return new TopicInfo( - TopicId.fromProtobuf(topicInfoResponse.getTopicID()), - topicInfo.getMemo(), - topicInfo.getRunningHash(), - topicInfo.getSequenceNumber(), - InstantConverter.fromProtobuf(topicInfo.getExpirationTime()), - adminKey, - submitKey, - DurationConverter.fromProtobuf(topicInfo.getAutoRenewPeriod()), - autoRenewAccountId, - LedgerId.fromByteString(topicInfo.getLedgerId()) - ); + TopicId.fromProtobuf(topicInfoResponse.getTopicID()), + topicInfo.getMemo(), + topicInfo.getRunningHash(), + topicInfo.getSequenceNumber(), + InstantConverter.fromProtobuf(topicInfo.getExpirationTime()), + adminKey, + submitKey, + DurationConverter.fromProtobuf(topicInfo.getAutoRenewPeriod()), + autoRenewAccountId, + LedgerId.fromByteString(topicInfo.getLedgerId())); } /** @@ -155,7 +129,8 @@ static TopicInfo fromProtobuf(ConsensusGetTopicInfoResponse topicInfoResponse) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TopicInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(ConsensusGetTopicInfoResponse.parseFrom(bytes).toBuilder().build()); + return fromProtobuf( + ConsensusGetTopicInfoResponse.parseFrom(bytes).toBuilder().build()); } /** @@ -164,16 +139,16 @@ public static TopicInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferExce * @return the protobuf representation */ ConsensusGetTopicInfoResponse toProtobuf() { - var topicInfoResponseBuilder = ConsensusGetTopicInfoResponse.newBuilder() - .setTopicID(topicId.toProtobuf()); + var topicInfoResponseBuilder = + ConsensusGetTopicInfoResponse.newBuilder().setTopicID(topicId.toProtobuf()); var topicInfoBuilder = ConsensusTopicInfo.newBuilder() - .setMemo(topicMemo) - .setRunningHash(runningHash) - .setSequenceNumber(sequenceNumber) - .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) - .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) - .setLedgerId(ledgerId.toByteString()); + .setMemo(topicMemo) + .setRunningHash(runningHash) + .setSequenceNumber(sequenceNumber) + .setExpirationTime(InstantConverter.toProtobuf(expirationTime)) + .setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod)) + .setLedgerId(ledgerId.toByteString()); if (adminKey != null) { topicInfoBuilder.setAdminKey(adminKey.toProtobufKey()); @@ -193,17 +168,17 @@ ConsensusGetTopicInfoResponse toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("topicId", topicId) - .add("topicMemo", topicMemo) - .add("runningHash", runningHash.toByteArray()) - .add("sequenceNumber", sequenceNumber) - .add("expirationTime", expirationTime) - .add("adminKey", adminKey) - .add("submitKey", submitKey) - .add("autoRenewPeriod", autoRenewPeriod) - .add("autoRenewAccountId", autoRenewAccountId) - .add("ledgerId", ledgerId) - .toString(); + .add("topicId", topicId) + .add("topicMemo", topicMemo) + .add("runningHash", runningHash.toByteArray()) + .add("sequenceNumber", sequenceNumber) + .add("expirationTime", expirationTime) + .add("adminKey", adminKey) + .add("submitKey", submitKey) + .add("autoRenewPeriod", autoRenewPeriod) + .add("autoRenewAccountId", autoRenewAccountId) + .add("ledgerId", ledgerId) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java b/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java index 6407ea4e42..acdc95df52 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.ConsensusGetTopicInfoQuery; @@ -25,9 +7,8 @@ import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.Objects; +import javax.annotation.Nullable; /** * Retrieve the latest state of a topic. @@ -41,8 +22,7 @@ public final class TopicInfoQuery extends Query { /** * Constructor. */ - public TopicInfoQuery() { - } + public TopicInfoQuery() {} /** * Extract the topic id. diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessage.java b/sdk/src/main/java/com/hiero/sdk/TopicMessage.java index cf90fd046a..797481ce2c 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessage.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessage.java @@ -1,33 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; -import java.time.Instant; - -import javax.annotation.Nullable; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.List; +import javax.annotation.Nullable; /** * Topic message records. @@ -72,13 +53,12 @@ public final class TopicMessage { * @param transactionId the transaction id */ TopicMessage( - Instant lastConsensusTimestamp, - byte[] message, - byte[] lastRunningHash, - long lastSequenceNumber, - @Nullable TopicMessageChunk[] chunks, - @Nullable TransactionId transactionId - ) { + Instant lastConsensusTimestamp, + byte[] message, + byte[] lastRunningHash, + long lastSequenceNumber, + @Nullable TopicMessageChunk[] chunks, + @Nullable TransactionId transactionId) { this.consensusTimestamp = lastConsensusTimestamp; this.contents = message; this.runningHash = lastRunningHash; @@ -95,15 +75,14 @@ public final class TopicMessage { */ static TopicMessage ofSingle(ConsensusTopicResponse response) { return new TopicMessage( - InstantConverter.fromProtobuf(response.getConsensusTimestamp()), - response.getMessage().toByteArray(), - response.getRunningHash().toByteArray(), - response.getSequenceNumber(), - new TopicMessageChunk[]{new TopicMessageChunk(response)}, - response.hasChunkInfo() && response.getChunkInfo().hasInitialTransactionID() ? - TransactionId.fromProtobuf(response.getChunkInfo().getInitialTransactionID()) : - null - ); + InstantConverter.fromProtobuf(response.getConsensusTimestamp()), + response.getMessage().toByteArray(), + response.getRunningHash().toByteArray(), + response.getSequenceNumber(), + new TopicMessageChunk[] {new TopicMessageChunk(response)}, + response.hasChunkInfo() && response.getChunkInfo().hasInitialTransactionID() + ? TransactionId.fromProtobuf(response.getChunkInfo().getInitialTransactionID()) + : null); } /** @@ -140,22 +119,21 @@ static TopicMessage ofMany(List responses) { var lastReceived = responses.get(responses.size() - 1); return new TopicMessage( - InstantConverter.fromProtobuf(lastReceived.getConsensusTimestamp()), - wholeMessage.array(), - lastReceived.getRunningHash().toByteArray(), - lastReceived.getSequenceNumber(), - chunks, - transactionId - ); + InstantConverter.fromProtobuf(lastReceived.getConsensusTimestamp()), + wholeMessage.array(), + lastReceived.getRunningHash().toByteArray(), + lastReceived.getSequenceNumber(), + chunks, + transactionId); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("consensusTimestamp", consensusTimestamp) - .add("contents", new String(contents, StandardCharsets.UTF_8)) - .add("runningHash", runningHash) - .add("sequenceNumber", sequenceNumber) - .toString(); + .add("consensusTimestamp", consensusTimestamp) + .add("contents", new String(contents, StandardCharsets.UTF_8)) + .add("runningHash", runningHash) + .add("sequenceNumber", sequenceNumber) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java b/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java index 299d3f78ac..090ce65a2f 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; @@ -43,4 +25,3 @@ final class TopicMessageChunk { sequenceNumber = response.getSequenceNumber(); } } - diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java b/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java index 178096cf89..9860add697 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Timestamp; @@ -184,8 +166,8 @@ private void onComplete() { private void onError(Throwable throwable, TopicMessage topicMessage) { var topicId = TopicId.fromProtobuf(builder.getTopicID()); - if (throwable instanceof StatusRuntimeException sre && sre.getStatus().getCode() - .equals(Status.Code.CANCELLED)) { + if (throwable instanceof StatusRuntimeException sre + && sre.getStatus().getCode().equals(Status.Code.CANCELLED)) { LOGGER.warn("Call is cancelled for topic {}.", topicId); } else { LOGGER.error("Error attempting to subscribe to topic {}:", topicId, throwable); @@ -215,11 +197,12 @@ private boolean shouldRetry(Throwable throwable) { var code = statusRuntimeException.getStatus().getCode(); var description = statusRuntimeException.getStatus().getDescription(); - return (code == Status.Code.NOT_FOUND) || - (code == Status.Code.UNAVAILABLE) || - (code == Status.Code.RESOURCE_EXHAUSTED) || - (code == Status.Code.INTERNAL && description != null && Executable.RST_STREAM.matcher(description) - .matches()); + return (code == Status.Code.NOT_FOUND) + || (code == Status.Code.UNAVAILABLE) + || (code == Status.Code.RESOURCE_EXHAUSTED) + || (code == Status.Code.INTERNAL + && description != null + && Executable.RST_STREAM.matcher(description).matches()); } return false; @@ -238,8 +221,8 @@ public SubscriptionHandle subscribe(Client client, Consumer onNext HashMap> pendingMessages = new HashMap<>(); try { - makeStreamingCall(client, subscriptionHandle, onNext, 0, new AtomicLong(), new AtomicReference<>(), - pendingMessages); + makeStreamingCall( + client, subscriptionHandle, onNext, 0, new AtomicLong(), new AtomicReference<>(), pendingMessages); } catch (InterruptedException e) { throw new RuntimeException(e); } @@ -248,17 +231,18 @@ public SubscriptionHandle subscribe(Client client, Consumer onNext } private void makeStreamingCall( - Client client, - SubscriptionHandle subscriptionHandle, - Consumer onNext, - int attempt, - AtomicLong counter, - AtomicReference lastMessage, - HashMap> pendingMessages - ) throws InterruptedException { + Client client, + SubscriptionHandle subscriptionHandle, + Consumer onNext, + int attempt, + AtomicLong counter, + AtomicReference lastMessage, + HashMap> pendingMessages) + throws InterruptedException { // TODO: check status of channel before using it? - ClientCall call = - client.mirrorNetwork.getNextMirrorNode().getChannel() + ClientCall call = client.mirrorNetwork + .getNextMirrorNode() + .getChannel() .newCall(ConsensusServiceGrpc.getSubscribeTopicMethod(), CallOptions.DEFAULT); subscriptionHandle.setOnUnsubscribe(() -> { @@ -291,7 +275,8 @@ public void onNext(ConsensusTopicResponse consensusTopicResponse) { lastMessage.set(consensusTopicResponse); // Short circuit for no chunks or 1/1 chunks - if (!consensusTopicResponse.hasChunkInfo() || consensusTopicResponse.getChunkInfo().getTotal() == 1) { + if (!consensusTopicResponse.hasChunkInfo() + || consensusTopicResponse.getChunkInfo().getTotal() == 1) { var message = TopicMessage.ofSingle(consensusTopicResponse); try { @@ -338,8 +323,12 @@ public void onError(Throwable t) { var delay = Math.min(500 * (long) Math.pow(2, attempt), maxBackoff.toMillis()); var topicId = TopicId.fromProtobuf(builder.getTopicID()); - LOGGER.warn("Error subscribing to topic {} during attempt #{}. Waiting {} ms before next attempt: {}", - topicId, attempt, delay, t.getMessage()); + LOGGER.warn( + "Error subscribing to topic {} during attempt #{}. Waiting {} ms before next attempt: {}", + topicId, + attempt, + delay, + t.getMessage()); call.cancel("unsubscribed", null); // Cannot use `CompletableFuture` here since this future is never polled @@ -350,8 +339,8 @@ public void onError(Throwable t) { } try { - makeStreamingCall(client, subscriptionHandle, onNext, attempt + 1, counter, lastMessage, - pendingMessages); + makeStreamingCall( + client, subscriptionHandle, onNext, attempt + 1, counter, lastMessage, pendingMessages); } catch (InterruptedException e) { throw new RuntimeException(e); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java index 618c569ced..ccdc000fa5 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -29,10 +11,9 @@ import com.hiero.sdk.proto.TransactionID; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Submit a message for consensus. @@ -52,8 +33,7 @@ public final class TopicMessageSubmitTransaction extends ChunkedTransaction> txs) throws InvalidProtocolBufferException { + TopicMessageSubmitTransaction( + LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -150,12 +132,13 @@ void initFromTransactionBody() { if (!innerSignedTransactions.isEmpty()) { try { - for (var i = 0; i < innerSignedTransactions.size(); - i += nodeAccountIds.isEmpty() ? 1 : nodeAccountIds.size()) { - data = data.concat( - TransactionBody.parseFrom(innerSignedTransactions.get(i).getBodyBytes()) - .getConsensusSubmitMessage().getMessage() - ); + for (var i = 0; + i < innerSignedTransactions.size(); + i += nodeAccountIds.isEmpty() ? 1 : nodeAccountIds.size()) { + data = data.concat(TransactionBody.parseFrom( + innerSignedTransactions.get(i).getBodyBytes()) + .getConsensusSubmitMessage() + .getMessage()); } } catch (InvalidProtocolBufferException exc) { throw new IllegalArgumentException(exc.getMessage()); @@ -199,19 +182,22 @@ void onFreeze(TransactionBody.Builder bodyBuilder) { } @Override - void onFreezeChunk(TransactionBody.Builder body, @Nullable TransactionID initialTransactionId, int startIndex, int endIndex, int chunk, int total) { + void onFreezeChunk( + TransactionBody.Builder body, + @Nullable TransactionID initialTransactionId, + int startIndex, + int endIndex, + int chunk, + int total) { if (total == 1) { body.setConsensusSubmitMessage(build().setMessage(data.substring(startIndex, endIndex))); } else { body.setConsensusSubmitMessage(build().setMessage(data.substring(startIndex, endIndex)) - .setChunkInfo(ConsensusMessageChunkInfo.newBuilder() - .setInitialTransactionID(Objects.requireNonNull(initialTransactionId)) - .setNumber(chunk + 1) - .setTotal(total) - ) - ); + .setChunkInfo(ConsensusMessageChunkInfo.newBuilder() + .setInitialTransactionID(Objects.requireNonNull(initialTransactionId)) + .setNumber(chunk + 1) + .setTotal(total))); } - } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java b/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java index 2c9737ebca..a84e039526 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -29,10 +11,9 @@ import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.LinkedHashMap; import java.util.Objects; +import javax.annotation.Nullable; /** * Update a topic. @@ -87,8 +68,7 @@ public final class TopicUpdateTransaction extends Transaction> txs) throws InvalidProtocolBufferException { + TopicUpdateTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -395,9 +376,7 @@ void validateChecksums(Client client) throws BadEntityIdException { topicId.validateChecksum(client); } - if ((autoRenewAccountId != null) && - !autoRenewAccountId.equals(new AccountId(0)) - ) { + if ((autoRenewAccountId != null) && !autoRenewAccountId.equals(new AccountId(0))) { autoRenewAccountId.validateChecksum(client); } } diff --git a/sdk/src/main/java/com/hiero/sdk/Transaction.java b/sdk/src/main/java/com/hiero/sdk/Transaction.java index 3544724704..8a444a1501 100644 --- a/sdk/src/main/java/com/hiero/sdk/Transaction.java +++ b/sdk/src/main/java/com/hiero/sdk/Transaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; @@ -51,8 +33,8 @@ * @param The type of the transaction. Used to enable chaining. */ public abstract class Transaction> - extends - Executable { + extends Executable< + T, com.hiero.sdk.proto.Transaction, com.hiero.sdk.proto.TransactionResponse, TransactionResponse> { /** * Default auto renew duration for accounts, contracts, topics, and files (entities) @@ -67,7 +49,8 @@ public abstract class Transaction> /** * Dummy transaction ID used to assist in deserializing incomplete Transactions. */ - protected static final TransactionId DUMMY_TRANSACTION_ID = TransactionId.withValidStart(DUMMY_ACCOUNT_ID, Instant.EPOCH); + protected static final TransactionId DUMMY_TRANSACTION_ID = + TransactionId.withValidStart(DUMMY_ACCOUNT_ID, Instant.EPOCH); /** * Default transaction duration @@ -133,9 +116,12 @@ public abstract class Transaction> * Should the transaction id be regenerated */ protected Boolean regenerateTransactionId = null; + private Duration transactionValidDuration; + @Nullable private Hbar maxTransactionFee = null; + private String memo = ""; /** @@ -171,11 +157,14 @@ public abstract class Transaction> * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ Transaction(LinkedHashMap> txs) - throws InvalidProtocolBufferException { - LinkedHashMap transactionMap = txs.values().iterator().next(); - if (!transactionMap.isEmpty() && transactionMap.keySet().iterator().next().equals(DUMMY_ACCOUNT_ID)) { + throws InvalidProtocolBufferException { + LinkedHashMap transactionMap = + txs.values().iterator().next(); + if (!transactionMap.isEmpty() + && transactionMap.keySet().iterator().next().equals(DUMMY_ACCOUNT_ID)) { // If the first account ID is a dummy account ID, then only the source TransactionBody needs to be copied. - var signedTransaction = SignedTransaction.parseFrom(transactionMap.values().iterator().next().getSignedTransactionBytes()); + var signedTransaction = SignedTransaction.parseFrom( + transactionMap.values().iterator().next().getSignedTransactionBytes()); sourceTransactionBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); } else { var txCount = txs.keySet().size(); @@ -196,14 +185,16 @@ public abstract class Transaction> nodeAccountIds.add(nodeEntry.getKey()); } - var transaction = SignedTransaction.parseFrom(nodeEntry.getValue().getSignedTransactionBytes()); + var transaction = + SignedTransaction.parseFrom(nodeEntry.getValue().getSignedTransactionBytes()); outerTransactions.add(nodeEntry.getValue()); sigPairLists.add(transaction.getSigMap().toBuilder()); innerSignedTransactions.add(transaction.toBuilder()); if (publicKeys.isEmpty()) { for (var sigPair : transaction.getSigMap().getSigPairList()) { - publicKeys.add(PublicKey.fromBytes(sigPair.getPubKeyPrefix().toByteArray())); + publicKeys.add(PublicKey.fromBytes( + sigPair.getPubKeyPrefix().toByteArray())); signers.add(null); } } @@ -217,24 +208,22 @@ public abstract class Transaction> TransactionBody firstTxBody = null; for (int j = 0; j < nodeCount; j++) { int k = i * nodeCount + j; - var txBody = TransactionBody.parseFrom(innerSignedTransactions.get(k).getBodyBytes()); + var txBody = TransactionBody.parseFrom( + innerSignedTransactions.get(k).getBodyBytes()); if (firstTxBody == null) { firstTxBody = txBody; } else { requireProtoMatches( - firstTxBody, - txBody, - new HashSet<>(List.of("NodeAccountID")), - "TransactionBody" - ); + firstTxBody, txBody, new HashSet<>(List.of("NodeAccountID")), "TransactionBody"); } } } - sourceTransactionBody = TransactionBody.parseFrom(innerSignedTransactions.get(0).getBodyBytes()); + sourceTransactionBody = + TransactionBody.parseFrom(innerSignedTransactions.get(0).getBodyBytes()); } setTransactionValidDuration( - DurationConverter.fromProtobuf(sourceTransactionBody.getTransactionValidDuration())); + DurationConverter.fromProtobuf(sourceTransactionBody.getTransactionValidDuration())); setMaxTransactionFee(Hbar.fromTinybars(sourceTransactionBody.getTransactionFee())); setTransactionMemo(sourceTransactionBody.getMemo()); @@ -264,13 +253,14 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe if (transaction.getSignedTransactionBytes().isEmpty()) { txBody = TransactionBody.parseFrom(transaction.getBodyBytes()); - transaction.setSignedTransactionBytes(SignedTransaction.newBuilder() - .setBodyBytes(transaction.getBodyBytes()) - .setSigMap(transaction.getSigMap()) - .build() - .toByteString()) - .clearBodyBytes() - .clearSigMap(); + transaction + .setSignedTransactionBytes(SignedTransaction.newBuilder() + .setBodyBytes(transaction.getBodyBytes()) + .setSigMap(transaction.getSigMap()) + .build() + .toByteString()) + .clearBodyBytes() + .clearSigMap(); } else { var signedTransaction = SignedTransaction.parseFrom(transaction.getSignedTransactionBytes()); txBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); @@ -278,10 +268,11 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe dataCase = txBody.getDataCase(); - var account = txBody.hasNodeAccountID() ? AccountId.fromProtobuf(txBody.getNodeAccountID()) - : DUMMY_ACCOUNT_ID; - var transactionId = txBody.hasTransactionID() ? TransactionId.fromProtobuf(txBody.getTransactionID()) - : DUMMY_TRANSACTION_ID; + var account = + txBody.hasNodeAccountID() ? AccountId.fromProtobuf(txBody.getNodeAccountID()) : DUMMY_ACCOUNT_ID; + var transactionId = txBody.hasTransactionID() + ? TransactionId.fromProtobuf(txBody.getTransactionID()) + : DUMMY_TRANSACTION_ID; var linked = new LinkedHashMap(); linked.put(account, transaction.build()); @@ -295,14 +286,16 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe dataCase = txBody.getDataCase(); } - var account = txBody.hasNodeAccountID() ? AccountId.fromProtobuf(txBody.getNodeAccountID()) - : DUMMY_ACCOUNT_ID; - var transactionId = txBody.hasTransactionID() ? TransactionId.fromProtobuf(txBody.getTransactionID()) - : DUMMY_TRANSACTION_ID; + var account = txBody.hasNodeAccountID() + ? AccountId.fromProtobuf(txBody.getNodeAccountID()) + : DUMMY_ACCOUNT_ID; + var transactionId = txBody.hasTransactionID() + ? TransactionId.fromProtobuf(txBody.getTransactionID()) + : DUMMY_TRANSACTION_ID; - var linked = txs.containsKey(transactionId) ? - Objects.requireNonNull(txs.get(transactionId)) : - new LinkedHashMap(); + var linked = txs.containsKey(transactionId) + ? Objects.requireNonNull(txs.get(transactionId)) + : new LinkedHashMap(); linked.put(account, transaction); @@ -371,94 +364,125 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe * @param scheduled the scheduled transaction * @return the new transaction */ - public static Transaction fromScheduledTransaction( - com.hiero.sdk.proto.SchedulableTransactionBody scheduled) { + public static Transaction fromScheduledTransaction(com.hiero.sdk.proto.SchedulableTransactionBody scheduled) { var body = TransactionBody.newBuilder() - .setMemo(scheduled.getMemo()) - .setTransactionFee(scheduled.getTransactionFee()); + .setMemo(scheduled.getMemo()) + .setTransactionFee(scheduled.getTransactionFee()); return switch (scheduled.getDataCase()) { - case CONTRACTCALL -> - new ContractExecuteTransaction(body.setContractCall(scheduled.getContractCall()).build()); + case CONTRACTCALL -> new ContractExecuteTransaction( + body.setContractCall(scheduled.getContractCall()).build()); case CONTRACTCREATEINSTANCE -> new ContractCreateTransaction( - body.setContractCreateInstance(scheduled.getContractCreateInstance()).build()); + body.setContractCreateInstance(scheduled.getContractCreateInstance()) + .build()); case CONTRACTUPDATEINSTANCE -> new ContractUpdateTransaction( - body.setContractUpdateInstance(scheduled.getContractUpdateInstance()).build()); + body.setContractUpdateInstance(scheduled.getContractUpdateInstance()) + .build()); case CONTRACTDELETEINSTANCE -> new ContractDeleteTransaction( - body.setContractDeleteInstance(scheduled.getContractDeleteInstance()).build()); + body.setContractDeleteInstance(scheduled.getContractDeleteInstance()) + .build()); case CRYPTOAPPROVEALLOWANCE -> new AccountAllowanceApproveTransaction( - body.setCryptoApproveAllowance(scheduled.getCryptoApproveAllowance()).build()); + body.setCryptoApproveAllowance(scheduled.getCryptoApproveAllowance()) + .build()); case CRYPTODELETEALLOWANCE -> new AccountAllowanceDeleteTransaction( - body.setCryptoDeleteAllowance(scheduled.getCryptoDeleteAllowance()).build()); + body.setCryptoDeleteAllowance(scheduled.getCryptoDeleteAllowance()) + .build()); case CRYPTOCREATEACCOUNT -> new AccountCreateTransaction( - body.setCryptoCreateAccount(scheduled.getCryptoCreateAccount()).build()); - case CRYPTODELETE -> - new AccountDeleteTransaction(body.setCryptoDelete(scheduled.getCryptoDelete()).build()); - case CRYPTOTRANSFER -> - new TransferTransaction(body.setCryptoTransfer(scheduled.getCryptoTransfer()).build()); + body.setCryptoCreateAccount(scheduled.getCryptoCreateAccount()) + .build()); + case CRYPTODELETE -> new AccountDeleteTransaction( + body.setCryptoDelete(scheduled.getCryptoDelete()).build()); + case CRYPTOTRANSFER -> new TransferTransaction( + body.setCryptoTransfer(scheduled.getCryptoTransfer()).build()); case CRYPTOUPDATEACCOUNT -> new AccountUpdateTransaction( - body.setCryptoUpdateAccount(scheduled.getCryptoUpdateAccount()).build()); - case FILEAPPEND -> new FileAppendTransaction(body.setFileAppend(scheduled.getFileAppend()).build()); - case FILECREATE -> new FileCreateTransaction(body.setFileCreate(scheduled.getFileCreate()).build()); - case FILEDELETE -> new FileDeleteTransaction(body.setFileDelete(scheduled.getFileDelete()).build()); - case FILEUPDATE -> new FileUpdateTransaction(body.setFileUpdate(scheduled.getFileUpdate()).build()); - case NODECREATE -> new NodeCreateTransaction(body.setNodeCreate(scheduled.getNodeCreate()).build()); - case NODEUPDATE -> new NodeUpdateTransaction(body.setNodeUpdate(scheduled.getNodeUpdate()).build()); - case NODEDELETE -> new NodeDeleteTransaction(body.setNodeDelete(scheduled.getNodeDelete()).build()); - case SYSTEMDELETE -> new SystemDeleteTransaction(body.setSystemDelete(scheduled.getSystemDelete()).build()); - case SYSTEMUNDELETE -> - new SystemUndeleteTransaction(body.setSystemUndelete(scheduled.getSystemUndelete()).build()); - case FREEZE -> new FreezeTransaction(body.setFreeze(scheduled.getFreeze()).build()); + body.setCryptoUpdateAccount(scheduled.getCryptoUpdateAccount()) + .build()); + case FILEAPPEND -> new FileAppendTransaction( + body.setFileAppend(scheduled.getFileAppend()).build()); + case FILECREATE -> new FileCreateTransaction( + body.setFileCreate(scheduled.getFileCreate()).build()); + case FILEDELETE -> new FileDeleteTransaction( + body.setFileDelete(scheduled.getFileDelete()).build()); + case FILEUPDATE -> new FileUpdateTransaction( + body.setFileUpdate(scheduled.getFileUpdate()).build()); + case NODECREATE -> new NodeCreateTransaction( + body.setNodeCreate(scheduled.getNodeCreate()).build()); + case NODEUPDATE -> new NodeUpdateTransaction( + body.setNodeUpdate(scheduled.getNodeUpdate()).build()); + case NODEDELETE -> new NodeDeleteTransaction( + body.setNodeDelete(scheduled.getNodeDelete()).build()); + case SYSTEMDELETE -> new SystemDeleteTransaction( + body.setSystemDelete(scheduled.getSystemDelete()).build()); + case SYSTEMUNDELETE -> new SystemUndeleteTransaction( + body.setSystemUndelete(scheduled.getSystemUndelete()).build()); + case FREEZE -> new FreezeTransaction( + body.setFreeze(scheduled.getFreeze()).build()); case CONSENSUSCREATETOPIC -> new TopicCreateTransaction( - body.setConsensusCreateTopic(scheduled.getConsensusCreateTopic()).build()); + body.setConsensusCreateTopic(scheduled.getConsensusCreateTopic()) + .build()); case CONSENSUSUPDATETOPIC -> new TopicUpdateTransaction( - body.setConsensusUpdateTopic(scheduled.getConsensusUpdateTopic()).build()); + body.setConsensusUpdateTopic(scheduled.getConsensusUpdateTopic()) + .build()); case CONSENSUSDELETETOPIC -> new TopicDeleteTransaction( - body.setConsensusDeleteTopic(scheduled.getConsensusDeleteTopic()).build()); + body.setConsensusDeleteTopic(scheduled.getConsensusDeleteTopic()) + .build()); case CONSENSUSSUBMITMESSAGE -> new TopicMessageSubmitTransaction( - body.setConsensusSubmitMessage(scheduled.getConsensusSubmitMessage()).build()); - case TOKENCREATION -> - new TokenCreateTransaction(body.setTokenCreation(scheduled.getTokenCreation()).build()); - case TOKENFREEZE -> new TokenFreezeTransaction(body.setTokenFreeze(scheduled.getTokenFreeze()).build()); - case TOKENUNFREEZE -> - new TokenUnfreezeTransaction(body.setTokenUnfreeze(scheduled.getTokenUnfreeze()).build()); - case TOKENGRANTKYC -> - new TokenGrantKycTransaction(body.setTokenGrantKyc(scheduled.getTokenGrantKyc()).build()); - case TOKENREVOKEKYC -> - new TokenRevokeKycTransaction(body.setTokenRevokeKyc(scheduled.getTokenRevokeKyc()).build()); - case TOKENDELETION -> - new TokenDeleteTransaction(body.setTokenDeletion(scheduled.getTokenDeletion()).build()); - case TOKENUPDATE -> new TokenUpdateTransaction(body.setTokenUpdate(scheduled.getTokenUpdate()).build()); - case TOKEN_UPDATE_NFTS -> new TokenUpdateNftsTransaction(body.setTokenUpdateNfts(scheduled.getTokenUpdateNfts()).build()); - case TOKENMINT -> new TokenMintTransaction(body.setTokenMint(scheduled.getTokenMint()).build()); - case TOKENBURN -> new TokenBurnTransaction(body.setTokenBurn(scheduled.getTokenBurn()).build()); - case TOKENWIPE -> new TokenWipeTransaction(body.setTokenWipe(scheduled.getTokenWipe()).build()); - case TOKENASSOCIATE -> - new TokenAssociateTransaction(body.setTokenAssociate(scheduled.getTokenAssociate()).build()); - case TOKENDISSOCIATE -> - new TokenDissociateTransaction(body.setTokenDissociate(scheduled.getTokenDissociate()).build()); + body.setConsensusSubmitMessage(scheduled.getConsensusSubmitMessage()) + .build()); + case TOKENCREATION -> new TokenCreateTransaction( + body.setTokenCreation(scheduled.getTokenCreation()).build()); + case TOKENFREEZE -> new TokenFreezeTransaction( + body.setTokenFreeze(scheduled.getTokenFreeze()).build()); + case TOKENUNFREEZE -> new TokenUnfreezeTransaction( + body.setTokenUnfreeze(scheduled.getTokenUnfreeze()).build()); + case TOKENGRANTKYC -> new TokenGrantKycTransaction( + body.setTokenGrantKyc(scheduled.getTokenGrantKyc()).build()); + case TOKENREVOKEKYC -> new TokenRevokeKycTransaction( + body.setTokenRevokeKyc(scheduled.getTokenRevokeKyc()).build()); + case TOKENDELETION -> new TokenDeleteTransaction( + body.setTokenDeletion(scheduled.getTokenDeletion()).build()); + case TOKENUPDATE -> new TokenUpdateTransaction( + body.setTokenUpdate(scheduled.getTokenUpdate()).build()); + case TOKEN_UPDATE_NFTS -> new TokenUpdateNftsTransaction( + body.setTokenUpdateNfts(scheduled.getTokenUpdateNfts()).build()); + case TOKENMINT -> new TokenMintTransaction( + body.setTokenMint(scheduled.getTokenMint()).build()); + case TOKENBURN -> new TokenBurnTransaction( + body.setTokenBurn(scheduled.getTokenBurn()).build()); + case TOKENWIPE -> new TokenWipeTransaction( + body.setTokenWipe(scheduled.getTokenWipe()).build()); + case TOKENASSOCIATE -> new TokenAssociateTransaction( + body.setTokenAssociate(scheduled.getTokenAssociate()).build()); + case TOKENDISSOCIATE -> new TokenDissociateTransaction( + body.setTokenDissociate(scheduled.getTokenDissociate()).build()); case TOKEN_FEE_SCHEDULE_UPDATE -> new TokenFeeScheduleUpdateTransaction( - body.setTokenFeeScheduleUpdate(scheduled.getTokenFeeScheduleUpdate()).build()); - case TOKEN_PAUSE -> new TokenPauseTransaction(body.setTokenPause(scheduled.getTokenPause()).build()); - case TOKEN_UNPAUSE -> - new TokenUnpauseTransaction(body.setTokenUnpause(scheduled.getTokenUnpause()).build()); - case TOKENREJECT -> - new TokenRejectTransaction(body.setTokenReject(scheduled.getTokenReject()).build()); - case TOKENAIRDROP -> new TokenAirdropTransaction(body.setTokenAirdrop(scheduled.getTokenAirdrop()).build()); - case TOKENCANCELAIRDROP -> new TokenCancelAirdropTransaction(body.setTokenCancelAirdrop(scheduled.getTokenCancelAirdrop()).build()); - case TOKENCLAIMAIRDROP -> new TokenClaimAirdropTransaction(body.setTokenCancelAirdrop(scheduled.getTokenCancelAirdrop()).build()); - case SCHEDULEDELETE -> - new ScheduleDeleteTransaction(body.setScheduleDelete(scheduled.getScheduleDelete()).build()); + body.setTokenFeeScheduleUpdate(scheduled.getTokenFeeScheduleUpdate()) + .build()); + case TOKEN_PAUSE -> new TokenPauseTransaction( + body.setTokenPause(scheduled.getTokenPause()).build()); + case TOKEN_UNPAUSE -> new TokenUnpauseTransaction( + body.setTokenUnpause(scheduled.getTokenUnpause()).build()); + case TOKENREJECT -> new TokenRejectTransaction( + body.setTokenReject(scheduled.getTokenReject()).build()); + case TOKENAIRDROP -> new TokenAirdropTransaction( + body.setTokenAirdrop(scheduled.getTokenAirdrop()).build()); + case TOKENCANCELAIRDROP -> new TokenCancelAirdropTransaction( + body.setTokenCancelAirdrop(scheduled.getTokenCancelAirdrop()) + .build()); + case TOKENCLAIMAIRDROP -> new TokenClaimAirdropTransaction( + body.setTokenCancelAirdrop(scheduled.getTokenCancelAirdrop()) + .build()); + case SCHEDULEDELETE -> new ScheduleDeleteTransaction( + body.setScheduleDelete(scheduled.getScheduleDelete()).build()); default -> throw new IllegalStateException("schedulable transaction did not have a transaction set"); }; } private static void throwProtoMatchException(String fieldName, String aWas, String bWas) { - throw new IllegalArgumentException( - "fromBytes() failed because " + fieldName + - " fields in TransactionBody protobuf messages in the TransactionList did not match: A was " + - aWas + ", B was " + bWas - ); + throw new IllegalArgumentException("fromBytes() failed because " + fieldName + + " fields in TransactionBody protobuf messages in the TransactionList did not match: A was " + + aWas + + ", B was " + bWas); } private static void requireProtoMatches(Object protoA, Object protoB, Set ignoreSet, String thisFieldName) { @@ -475,14 +499,13 @@ private static void requireProtoMatches(Object protoA, Object protoB, Set getTransactionHashPerNode() { if (!this.isFrozen()) { throw new IllegalStateException( - "transaction must have been frozen before calculating the hash will be stable, try calling `freeze`"); + "transaction must have been frozen before calculating the hash will be stable, try calling `freeze`"); } buildAllTransactions(); @@ -806,7 +827,9 @@ public Map getTransactionHashPerNode() { var hashes = new HashMap(); for (var i = 0; i < outerTransactions.size(); i++) { - hashes.put(nodeAccountIds.get(i), hash(outerTransactions.get(i).getSignedTransactionBytes().toByteArray())); + hashes.put( + nodeAccountIds.get(i), + hash(outerTransactions.get(i).getSignedTransactionBytes().toByteArray())); } return hashes; @@ -824,7 +847,8 @@ final TransactionId getTransactionIdInternal() { */ public final TransactionId getTransactionId() { if (transactionIds.isEmpty() || !this.isFrozen()) { - throw new IllegalStateException("No transaction ID generated yet. Try freezing the transaction or manually setting the transaction ID."); + throw new IllegalStateException( + "No transaction ID generated yet. Try freezing the transaction or manually setting the transaction ID."); } return transactionIds.setLocked(true).getCurrent(); @@ -922,8 +946,7 @@ public T signWithOperator(Client client) { var operator = client.getOperator(); if (operator == null) { - throw new IllegalStateException( - "`client` must have an `operator` to sign with the operator"); + throw new IllegalStateException("`client` must have an `operator` to sign with the operator"); } if (!isFrozen()) { @@ -982,16 +1005,15 @@ protected Map> getSignaturesAtOffset(int offse var sigMap = sigPairLists.get(i + offset); var nodeAccountId = nodeAccountIds.get(i); - var keyMap = map.containsKey(nodeAccountId) ? - Objects.requireNonNull(map.get(nodeAccountId)) : - new HashMap(sigMap.getSigPairCount()); + var keyMap = map.containsKey(nodeAccountId) + ? Objects.requireNonNull(map.get(nodeAccountId)) + : new HashMap(sigMap.getSigPairCount()); map.put(nodeAccountId, keyMap); for (var sigPair : sigMap.getSigPairList()) { keyMap.put( - PublicKey.fromBytes(sigPair.getPubKeyPrefix().toByteArray()), - sigPair.getEd25519().toByteArray() - ); + PublicKey.fromBytes(sigPair.getPubKeyPrefix().toByteArray()), + sigPair.getEd25519().toByteArray()); } } @@ -1032,7 +1054,7 @@ protected boolean isFrozen() { protected void requireNotFrozen() { if (isFrozen()) { throw new IllegalStateException( - "transaction is immutable; it has at least one signature or has been explicitly frozen"); + "transaction is immutable; it has at least one signature or has been explicitly frozen"); } } @@ -1053,9 +1075,9 @@ protected TransactionBody.Builder spawnBodyBuilder(@Nullable Client client) { var feeHbars = maxTransactionFee != null ? maxTransactionFee : defaultFee; return TransactionBody.newBuilder() - .setTransactionFee(feeHbars.toTinybars()) - .setTransactionValidDuration(DurationConverter.toProtobuf(transactionValidDuration).toBuilder()) - .setMemo(memo); + .setTransactionFee(feeHbars.toTinybars()) + .setTransactionValidDuration(DurationConverter.toProtobuf(transactionValidDuration).toBuilder()) + .setMemo(memo); } /** @@ -1092,19 +1114,18 @@ public T freezeWith(@Nullable Client client) { transactionIds.setList(Collections.singletonList(TransactionId.generate(operator.accountId))); } else { // no client means there must be an explicitly set node ID and transaction ID - throw new IllegalStateException( - "`client` must have an `operator` or `transactionId` must be set"); + throw new IllegalStateException("`client` must have an `operator` or `transactionId` must be set"); } } else { throw new IllegalStateException( - "Transaction ID must be set, or operator must be provided via freezeWith()"); + "Transaction ID must be set, or operator must be provided via freezeWith()"); } } if (nodeAccountIds.isEmpty()) { if (client == null) { throw new IllegalStateException( - "`client` must be provided or both `nodeId` and `transactionId` must be set"); + "`client` must be provided or both `nodeId` and `transactionId` must be set"); } try { @@ -1114,7 +1135,8 @@ public T freezeWith(@Nullable Client client) { } } - frozenBodyBuilder = spawnBodyBuilder(client).setTransactionID(transactionIds.get(0).toProtobuf()); + frozenBodyBuilder = + spawnBodyBuilder(client).setTransactionID(transactionIds.get(0).toProtobuf()); onFreeze(frozenBodyBuilder); int requiredChunks = getRequiredChunks(); @@ -1123,7 +1145,7 @@ public T freezeWith(@Nullable Client client) { var clientDefaultRegenerateTransactionId = client != null ? client.getDefaultRegenerateTransactionId() : null; regenerateTransactionId = - regenerateTransactionId != null ? regenerateTransactionId : clientDefaultRegenerateTransactionId; + regenerateTransactionId != null ? regenerateTransactionId : clientDefaultRegenerateTransactionId; // noinspection unchecked return (T) this; @@ -1176,7 +1198,8 @@ void generateTransactionIds(TransactionId initialTransactionId, int count) { */ void wipeTransactionLists(int requiredChunks) { if (!transactionIds.isEmpty()) { - Objects.requireNonNull(frozenBodyBuilder).setTransactionID(getTransactionIdInternal().toProtobuf()); + Objects.requireNonNull(frozenBodyBuilder) + .setTransactionID(getTransactionIdInternal().toProtobuf()); } outerTransactions = new ArrayList<>(nodeAccountIds.size()); @@ -1186,11 +1209,10 @@ void wipeTransactionLists(int requiredChunks) { for (AccountId nodeId : nodeAccountIds) { sigPairLists.add(SignatureMap.newBuilder()); innerSignedTransactions.add(SignedTransaction.newBuilder() - .setBodyBytes(Objects.requireNonNull(frozenBodyBuilder) - .setNodeAccountID(nodeId.toProtobuf()) - .build() - .toByteString() - )); + .setBodyBytes(Objects.requireNonNull(frozenBodyBuilder) + .setNodeAccountID(nodeId.toProtobuf()) + .build() + .toByteString())); outerTransactions.add(null); } } @@ -1216,22 +1238,22 @@ void buildAllTransactions() { void buildTransaction(int index) { // Check if transaction is already built. // Every time a signer is added via sign() or signWith(), all outerTransactions are nullified. - if ( - outerTransactions.get(index) != null && - !outerTransactions.get(index).getSignedTransactionBytes().isEmpty() - ) { + if (outerTransactions.get(index) != null + && !outerTransactions.get(index).getSignedTransactionBytes().isEmpty()) { return; } signTransaction(index); - outerTransactions.set(index, com.hiero.sdk.proto.Transaction.newBuilder() - .setSignedTransactionBytes( - innerSignedTransactions.get(index) - .setSigMap(sigPairLists.get(index)) - .build() - .toByteString() - ).build()); + outerTransactions.set( + index, + com.hiero.sdk.proto.Transaction.newBuilder() + .setSignedTransactionBytes(innerSignedTransactions + .get(index) + .setSigMap(sigPairLists.get(index)) + .build() + .toByteString()) + .build()); } /** @@ -1254,9 +1276,7 @@ void signTransaction(int index) { var signatureBytes = signers.get(i).apply(bodyBytes); - sigPairLists - .get(index) - .addSigPair(publicKeys.get(i).toSignaturePairProtobuf(signatureBytes)); + sigPairLists.get(index).addSigPair(publicKeys.get(i).toSignaturePairProtobuf(signatureBytes)); } } @@ -1282,10 +1302,9 @@ final com.hiero.sdk.proto.Transaction makeRequest() { @Override TransactionResponse mapResponse( - com.hiero.sdk.proto.TransactionResponse transactionResponse, - AccountId nodeId, - com.hiero.sdk.proto.Transaction request - ) { + com.hiero.sdk.proto.TransactionResponse transactionResponse, + AccountId nodeId, + com.hiero.sdk.proto.Transaction request) { var transactionId = Objects.requireNonNull(getTransactionIdInternal()); var hash = hash(request.getSignedTransactionBytes().toByteArray()); transactionIds.advance(); diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java b/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java index 1f579b4bcb..4f281480c2 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java @@ -1,32 +1,13 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * The fees for a specific transaction or query based on the fee data. @@ -35,8 +16,10 @@ */ public class TransactionFeeSchedule implements Cloneable { private RequestType requestType; + @Nullable private FeeData feeData; + private List fees; /** @@ -56,8 +39,11 @@ public TransactionFeeSchedule() { */ static TransactionFeeSchedule fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule transactionFeeSchedule) { var returnFeeSchedule = new TransactionFeeSchedule() - .setRequestType(RequestType.valueOf(transactionFeeSchedule.getHederaFunctionality())) - .setFeeData(transactionFeeSchedule.hasFeeData() ? FeeData.fromProtobuf(transactionFeeSchedule.getFeeData()) : null); + .setRequestType(RequestType.valueOf(transactionFeeSchedule.getHederaFunctionality())) + .setFeeData( + transactionFeeSchedule.hasFeeData() + ? FeeData.fromProtobuf(transactionFeeSchedule.getFeeData()) + : null); for (var feeData : transactionFeeSchedule.getFeesList()) { returnFeeSchedule.addFee(FeeData.fromProtobuf(feeData)); } @@ -72,7 +58,8 @@ static TransactionFeeSchedule fromProtobuf(com.hiero.sdk.proto.TransactionFeeSch * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionFeeSchedule fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule.parseFrom(bytes).toBuilder() + .build()); } /** @@ -145,8 +132,8 @@ public TransactionFeeSchedule addFee(FeeData fee) { * com.hiero.sdk.proto.TransactionFeeSchedule} */ com.hiero.sdk.proto.TransactionFeeSchedule toProtobuf() { - var returnBuilder = com.hiero.sdk.proto.TransactionFeeSchedule.newBuilder() - .setHederaFunctionality(getRequestType().code); + var returnBuilder = + com.hiero.sdk.proto.TransactionFeeSchedule.newBuilder().setHederaFunctionality(getRequestType().code); if (feeData != null) { returnBuilder.setFeeData(feeData.toProtobuf()); } @@ -159,10 +146,10 @@ com.hiero.sdk.proto.TransactionFeeSchedule toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("requestType", getRequestType()) - .add("feeData", getFeeData()) - .add("fees", getFees()) - .toString(); + .add("requestType", getRequestType()) + .add("feeData", getFeeData()) + .add("fees", getFees()) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionId.java b/sdk/src/main/java/com/hiero/sdk/TransactionId.java index 11ceb6712c..0dc4660032 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionId.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionId.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static java.util.concurrent.CompletableFuture.completedFuture; @@ -27,7 +9,6 @@ import java.time.Duration; import java.time.Instant; import java.util.Objects; -import java.util.Random; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeoutException; @@ -72,7 +53,6 @@ public final class TransactionId implements Comparable { private static final AtomicLong monotonicTime = new AtomicLong(); - /** * No longer part of the public API. Use `Transaction.withValidStart()` instead. * @@ -117,7 +97,6 @@ public static TransactionId generate(AccountId accountId) { // between the client and the receiving node and prevented spurious INVALID_TRANSACTION_START. currentTime = System.currentTimeMillis() * NANOSECONDS_PER_MILLISECOND - NANOSECONDS_TO_REMOVE; - // Get the last recorded timestamp. lastTime = monotonicTime.get(); @@ -129,7 +108,10 @@ public static TransactionId generate(AccountId accountId) { } while (!monotonicTime.compareAndSet(lastTime, currentTime)); // NOTE: using ThreadLocalRandom because it's compatible with Android SDK version 26 - return new TransactionId(accountId, Instant.ofEpochSecond(0, currentTime + ThreadLocalRandom.current().nextLong(1_000))); + return new TransactionId( + accountId, + Instant.ofEpochSecond( + 0, currentTime + ThreadLocalRandom.current().nextLong(1_000))); } /** @@ -140,11 +122,13 @@ public static TransactionId generate(AccountId accountId) { */ static TransactionId fromProtobuf(TransactionID transactionID) { var accountId = transactionID.hasAccountID() ? AccountId.fromProtobuf(transactionID.getAccountID()) : null; - var validStart = transactionID.hasTransactionValidStart() ? InstantConverter.fromProtobuf(transactionID.getTransactionValidStart()) : null; + var validStart = transactionID.hasTransactionValidStart() + ? InstantConverter.fromProtobuf(transactionID.getTransactionValidStart()) + : null; return new TransactionId(accountId, validStart) - .setScheduled(transactionID.getScheduled()) - .setNonce((transactionID.getNonce() != 0) ? transactionID.getNonce() : null); + .setScheduled(transactionID.getScheduled()) + .setNonce((transactionID.getNonce() != 0) ? transactionID.getNonce() : null); } /** @@ -176,9 +160,9 @@ public static TransactionId fromString(String s) { throw new IllegalArgumentException("expecting {account}@{seconds}.{nanos}"); } - @Nullable Instant validStart = Instant.ofEpochSecond( - Long.parseLong(validStartParts[0]), - Long.parseLong(validStartParts[1])); + @Nullable + Instant validStart = + Instant.ofEpochSecond(Long.parseLong(validStartParts[0]), Long.parseLong(validStartParts[1])); return new TransactionId(accountId, validStart).setScheduled(scheduled).setNonce(nonce); } @@ -244,7 +228,8 @@ public TransactionId setNonce(@Nullable Integer nonce) { * @throws PrecheckStatusException when the precheck fails * @throws ReceiptStatusException when there is an issue with the receipt */ - public TransactionReceipt getReceipt(Client client) throws TimeoutException, PrecheckStatusException, ReceiptStatusException { + public TransactionReceipt getReceipt(Client client) + throws TimeoutException, PrecheckStatusException, ReceiptStatusException { return getReceipt(client, client.getRequestTimeout()); } @@ -258,10 +243,9 @@ public TransactionReceipt getReceipt(Client client) throws TimeoutException, Pre * @throws PrecheckStatusException when the precheck fails * @throws ReceiptStatusException when there is an issue with the receipt */ - public TransactionReceipt getReceipt(Client client, Duration timeout) throws TimeoutException, PrecheckStatusException, ReceiptStatusException { - var receipt = new TransactionReceiptQuery() - .setTransactionId(this) - .execute(client, timeout); + public TransactionReceipt getReceipt(Client client, Duration timeout) + throws TimeoutException, PrecheckStatusException, ReceiptStatusException { + var receipt = new TransactionReceiptQuery().setTransactionId(this).execute(client, timeout); if (receipt.status != Status.SUCCESS) { throw new ReceiptStatusException(this, receipt); @@ -289,15 +273,15 @@ public CompletableFuture getReceiptAsync(Client client) { */ public CompletableFuture getReceiptAsync(Client client, Duration timeout) { return new TransactionReceiptQuery() - .setTransactionId(this) - .executeAsync(client, timeout) - .thenCompose(receipt -> { - if (receipt.status != Status.SUCCESS) { - return failedFuture(new ReceiptStatusException(this, receipt)); - } + .setTransactionId(this) + .executeAsync(client, timeout) + .thenCompose(receipt -> { + if (receipt.status != Status.SUCCESS) { + return failedFuture(new ReceiptStatusException(this, receipt)); + } - return completedFuture(receipt); - }); + return completedFuture(receipt); + }); } /** @@ -340,7 +324,8 @@ public void getReceiptAsync(Client client, Consumer onSucces * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void getReceiptAsync(Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { + public void getReceiptAsync( + Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { ConsumerHelper.twoConsumers(getReceiptAsync(client, timeout), onSuccess, onFailure); } @@ -353,7 +338,8 @@ public void getReceiptAsync(Client client, Duration timeout, Consumer getRecordAsync(Client client) { */ public CompletableFuture getRecordAsync(Client client, Duration timeout) { // note: we get the receipt first to ensure consensus has been reached - return getReceiptAsync(client, timeout).thenCompose(receipt -> new TransactionRecordQuery() - .setTransactionId(this) - .executeAsync(client, timeout)); + return getReceiptAsync(client, timeout) + .thenCompose(receipt -> + new TransactionRecordQuery().setTransactionId(this).executeAsync(client, timeout)); } /** @@ -439,7 +424,8 @@ public void getRecordAsync(Client client, Consumer onSuccess, * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void getRecordAsync(Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { + public void getRecordAsync( + Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { ConsumerHelper.twoConsumers(getRecordAsync(client, timeout), onSuccess, onFailure); } @@ -449,9 +435,7 @@ public void getRecordAsync(Client client, Duration timeout, Consumer children; TransactionReceipt( - @Nullable TransactionId transactionId, - Status status, - ExchangeRate exchangeRate, - @Nullable AccountId accountId, - @Nullable FileId fileId, - @Nullable ContractId contractId, - @Nullable TopicId topicId, - @Nullable TokenId tokenId, - @Nullable Long topicSequenceNumber, - @Nullable ByteString topicRunningHash, - Long totalSupply, - @Nullable ScheduleId scheduleId, - @Nullable TransactionId scheduledTransactionId, - List serials, - long nodeId, - List duplicates, - List children - ) { + @Nullable TransactionId transactionId, + Status status, + ExchangeRate exchangeRate, + @Nullable AccountId accountId, + @Nullable FileId fileId, + @Nullable ContractId contractId, + @Nullable TopicId topicId, + @Nullable TokenId tokenId, + @Nullable Long topicSequenceNumber, + @Nullable ByteString topicRunningHash, + Long totalSupply, + @Nullable ScheduleId scheduleId, + @Nullable TransactionId scheduledTransactionId, + List serials, + long nodeId, + List duplicates, + List children) { this.transactionId = transactionId; this.status = status; this.exchangeRate = exchangeRate; @@ -190,60 +170,39 @@ public final class TransactionReceipt { * @return the new transaction receipt */ static TransactionReceipt fromProtobuf( - com.hiero.sdk.proto.TransactionReceipt transactionReceipt, - List duplicates, - List children, - @Nullable TransactionId transactionId - ) { + com.hiero.sdk.proto.TransactionReceipt transactionReceipt, + List duplicates, + List children, + @Nullable TransactionId transactionId) { var status = Status.valueOf(transactionReceipt.getStatus()); var rate = transactionReceipt.getExchangeRate(); var exchangeRate = ExchangeRate.fromProtobuf(rate.getCurrentRate()); var accountId = - transactionReceipt.hasAccountID() - ? AccountId.fromProtobuf(transactionReceipt.getAccountID()) - : null; + transactionReceipt.hasAccountID() ? AccountId.fromProtobuf(transactionReceipt.getAccountID()) : null; - var fileId = - transactionReceipt.hasFileID() - ? FileId.fromProtobuf(transactionReceipt.getFileID()) - : null; + var fileId = transactionReceipt.hasFileID() ? FileId.fromProtobuf(transactionReceipt.getFileID()) : null; var contractId = - transactionReceipt.hasContractID() - ? ContractId.fromProtobuf(transactionReceipt.getContractID()) - : null; + transactionReceipt.hasContractID() ? ContractId.fromProtobuf(transactionReceipt.getContractID()) : null; - var topicId = - transactionReceipt.hasTopicID() - ? TopicId.fromProtobuf(transactionReceipt.getTopicID()) - : null; + var topicId = transactionReceipt.hasTopicID() ? TopicId.fromProtobuf(transactionReceipt.getTopicID()) : null; - var tokenId = - transactionReceipt.hasTokenID() - ? TokenId.fromProtobuf(transactionReceipt.getTokenID()) - : null; + var tokenId = transactionReceipt.hasTokenID() ? TokenId.fromProtobuf(transactionReceipt.getTokenID()) : null; var topicSequenceNumber = - transactionReceipt.getTopicSequenceNumber() == 0 - ? null - : transactionReceipt.getTopicSequenceNumber(); + transactionReceipt.getTopicSequenceNumber() == 0 ? null : transactionReceipt.getTopicSequenceNumber(); var topicRunningHash = - transactionReceipt.getTopicRunningHash().isEmpty() - ? null - : transactionReceipt.getTopicRunningHash(); + transactionReceipt.getTopicRunningHash().isEmpty() ? null : transactionReceipt.getTopicRunningHash(); var totalSupply = transactionReceipt.getNewTotalSupply(); var scheduleId = - transactionReceipt.hasScheduleID() - ? ScheduleId.fromProtobuf(transactionReceipt.getScheduleID()) - : null; + transactionReceipt.hasScheduleID() ? ScheduleId.fromProtobuf(transactionReceipt.getScheduleID()) : null; - var scheduledTransactionId = - transactionReceipt.hasScheduledTransactionID() + var scheduledTransactionId = transactionReceipt.hasScheduledTransactionID() ? TransactionId.fromProtobuf(transactionReceipt.getScheduledTransactionID()) : null; @@ -252,24 +211,23 @@ static TransactionReceipt fromProtobuf( var nodeId = transactionReceipt.getNodeId(); return new TransactionReceipt( - transactionId, - status, - exchangeRate, - accountId, - fileId, - contractId, - topicId, - tokenId, - topicSequenceNumber, - topicRunningHash, - totalSupply, - scheduleId, - scheduledTransactionId, - serials, - nodeId, - duplicates, - children - ); + transactionId, + status, + exchangeRate, + accountId, + fileId, + contractId, + topicId, + tokenId, + topicSequenceNumber, + topicRunningHash, + totalSupply, + scheduleId, + scheduledTransactionId, + serials, + nodeId, + duplicates, + children); } /** @@ -283,9 +241,7 @@ public static TransactionReceipt fromProtobuf(com.hiero.sdk.proto.TransactionRec } static TransactionReceipt fromProtobuf( - com.hiero.sdk.proto.TransactionReceipt transactionReceipt, - @Nullable TransactionId transactionId - ) { + com.hiero.sdk.proto.TransactionReceipt transactionReceipt, @Nullable TransactionId transactionId) { return fromProtobuf(transactionReceipt, new ArrayList<>(), new ArrayList<>(), transactionId); } @@ -297,7 +253,8 @@ static TransactionReceipt fromProtobuf( * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionReceipt fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TransactionReceipt.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TransactionReceipt.parseFrom(bytes).toBuilder() + .build()); } /** @@ -321,17 +278,14 @@ public TransactionReceipt validateStatus(boolean shouldValidate) throws ReceiptS */ com.hiero.sdk.proto.TransactionReceipt toProtobuf() { var transactionReceiptBuilder = com.hiero.sdk.proto.TransactionReceipt.newBuilder() - .setStatus(status.code) - .setExchangeRate(ExchangeRateSet.newBuilder() - .setCurrentRate(com.hiero.sdk.proto.ExchangeRate.newBuilder() - .setHbarEquiv(exchangeRate.hbars) - .setCentEquiv(exchangeRate.cents) - .setExpirationTime(TimestampSeconds.newBuilder() - .setSeconds(exchangeRate.expirationTime.getEpochSecond()) - ) - ) - ) - .setNewTotalSupply(totalSupply); + .setStatus(status.code) + .setExchangeRate(ExchangeRateSet.newBuilder() + .setCurrentRate(com.hiero.sdk.proto.ExchangeRate.newBuilder() + .setHbarEquiv(exchangeRate.hbars) + .setCentEquiv(exchangeRate.cents) + .setExpirationTime(TimestampSeconds.newBuilder() + .setSeconds(exchangeRate.expirationTime.getEpochSecond())))) + .setNewTotalSupply(totalSupply); if (accountId != null) { transactionReceiptBuilder.setAccountID(accountId.toProtobuf()); @@ -381,24 +335,24 @@ com.hiero.sdk.proto.TransactionReceipt toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("transactionId", transactionId) - .add("status", status) - .add("exchangeRate", exchangeRate) - .add("accountId", accountId) - .add("fileId", fileId) - .add("contractId", contractId) - .add("topicId", topicId) - .add("tokenId", tokenId) - .add("topicSequenceNumber", topicSequenceNumber) - .add("topicRunningHash", topicRunningHash != null ? Hex.encode(topicRunningHash.toByteArray()) : null) - .add("totalSupply", totalSupply) - .add("scheduleId", scheduleId) - .add("scheduledTransactionId", scheduledTransactionId) - .add("serials", serials) - .add("nodeId", nodeId) - .add("duplicates", duplicates) - .add("children", children) - .toString(); + .add("transactionId", transactionId) + .add("status", status) + .add("exchangeRate", exchangeRate) + .add("accountId", accountId) + .add("fileId", fileId) + .add("contractId", contractId) + .add("topicId", topicId) + .add("tokenId", tokenId) + .add("topicSequenceNumber", topicSequenceNumber) + .add("topicRunningHash", topicRunningHash != null ? Hex.encode(topicRunningHash.toByteArray()) : null) + .add("totalSupply", totalSupply) + .add("scheduleId", scheduleId) + .add("scheduledTransactionId", scheduledTransactionId) + .add("serials", serials) + .add("nodeId", nodeId) + .add("duplicates", duplicates) + .add("children", children) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java b/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java index 5ac61055cd..17a5465cbb 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.CryptoServiceGrpc; @@ -25,11 +7,10 @@ import com.hiero.sdk.proto.ResponseHeader; import com.hiero.sdk.proto.TransactionGetReceiptQuery; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Get the receipt of a transaction, given its transaction ID. @@ -39,19 +20,18 @@ * *

This query is free. */ -public final class TransactionReceiptQuery - extends Query { +public final class TransactionReceiptQuery extends Query { @Nullable private TransactionId transactionId = null; + private boolean includeChildren = false; private boolean includeDuplicates = false; /** * Constructor. */ - public TransactionReceiptQuery() { - } + public TransactionReceiptQuery() {} /** * Extract the transaction id. @@ -136,8 +116,8 @@ void validateChecksums(Client client) throws BadEntityIdException { @Override void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TransactionGetReceiptQuery.newBuilder() - .setIncludeChildReceipts(includeChildren) - .setIncludeDuplicates(includeDuplicates); + .setIncludeChildReceipts(includeChildren) + .setIncludeDuplicates(includeDuplicates); if (transactionId != null) { builder.setTransactionID(transactionId.toProtobuf()); } @@ -157,7 +137,8 @@ TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hiero.sd var receiptResponse = response.getTransactionGetReceipt(); var duplicates = mapReceiptList(receiptResponse.getDuplicateTransactionReceiptsList()); var children = mapReceiptList(receiptResponse.getChildTransactionReceiptsList()); - return TransactionReceipt.fromProtobuf(response.getTransactionGetReceipt().getReceipt(), duplicates, children, transactionId); + return TransactionReceipt.fromProtobuf( + response.getTransactionGetReceipt().getReceipt(), duplicates, children, transactionId); } /** @@ -167,8 +148,7 @@ TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hiero.sd * @return the list of transaction receipts */ private static List mapReceiptList( - List protoReceiptList - ) { + List protoReceiptList) { List outList = new ArrayList<>(protoReceiptList.size()); for (var protoReceipt : protoReceiptList) { outList.add(TransactionReceipt.fromProtobuf(protoReceipt)); @@ -209,7 +189,7 @@ ExecutionState getExecutionState(Status status, Response response) { } var receiptStatus = - Status.valueOf(response.getTransactionGetReceipt().getReceipt().getStatus()); + Status.valueOf(response.getTransactionGetReceipt().getReceipt().getStatus()); switch (receiptStatus) { case BUSY: diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java b/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java index f632a9833d..8429d59556 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -26,16 +8,15 @@ import com.hiero.sdk.proto.NftTransfer; import com.hiero.sdk.proto.TokenTransferList; import com.hiero.sdk.proto.TransferList; -import org.bouncycastle.util.encoders.Hex; import java.time.Instant; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import javax.annotation.Nullable; +import org.bouncycastle.util.encoders.Hex; /** * The complete record for a transaction on Hedera that has reached consensus. @@ -212,31 +193,30 @@ public final class TransactionRecord { public final List pendingAirdropRecords; TransactionRecord( - TransactionReceipt transactionReceipt, - ByteString transactionHash, - Instant consensusTimestamp, - TransactionId transactionId, - String transactionMemo, - long transactionFee, - @Nullable ContractFunctionResult contractFunctionResult, - List transfers, - Map> tokenTransfers, - List tokenTransferList, - Map> tokenNftTransfers, - @Nullable ScheduleId scheduleRef, - List assessedCustomFees, - List automaticTokenAssociations, - @Nullable PublicKey aliasKey, - List children, - List duplicates, - @Nullable Instant parentConsensusTimestamp, - ByteString ethereumHash, - List paidStakingRewards, - @Nullable ByteString prngBytes, - @Nullable Integer prngNumber, - ByteString evmAddress, - List pendingAirdropRecords - ) { + TransactionReceipt transactionReceipt, + ByteString transactionHash, + Instant consensusTimestamp, + TransactionId transactionId, + String transactionMemo, + long transactionFee, + @Nullable ContractFunctionResult contractFunctionResult, + List transfers, + Map> tokenTransfers, + List tokenTransferList, + Map> tokenNftTransfers, + @Nullable ScheduleId scheduleRef, + List assessedCustomFees, + List automaticTokenAssociations, + @Nullable PublicKey aliasKey, + List children, + List duplicates, + @Nullable Instant parentConsensusTimestamp, + ByteString ethereumHash, + List paidStakingRewards, + @Nullable ByteString prngBytes, + @Nullable Integer prngNumber, + ByteString evmAddress, + List pendingAirdropRecords) { this.receipt = transactionReceipt; this.transactionHash = transactionHash; this.consensusTimestamp = consensusTimestamp; @@ -275,12 +255,12 @@ public final class TransactionRecord { * @return the new transaction record */ static TransactionRecord fromProtobuf( - com.hiero.sdk.proto.TransactionRecord transactionRecord, - List children, - List duplicates, - @Nullable TransactionId transactionId - ) { - var transfers = new ArrayList(transactionRecord.getTransferList().getAccountAmountsCount()); + com.hiero.sdk.proto.TransactionRecord transactionRecord, + List children, + List duplicates, + @Nullable TransactionId transactionId) { + var transfers = + new ArrayList(transactionRecord.getTransferList().getAccountAmountsCount()); for (var accountAmount : transactionRecord.getTransferList().getAccountAmountsList()) { transfers.add(Transfer.fromProtobuf(accountAmount)); } @@ -292,13 +272,17 @@ static TransactionRecord fromProtobuf( var nftTransfersList = TokenNftTransfer.fromProtobuf(transactionRecord.getTokenTransferListsList()); for (var transfer : tokenTransfersList) { - var current = tokenTransfers.containsKey(transfer.tokenId) ? tokenTransfers.get(transfer.tokenId) : new HashMap(); + var current = tokenTransfers.containsKey(transfer.tokenId) + ? tokenTransfers.get(transfer.tokenId) + : new HashMap(); current.put(transfer.accountId, transfer.amount); tokenTransfers.put(transfer.tokenId, current); } for (var transfer : nftTransfersList) { - var current = tokenNftTransfers.containsKey(transfer.tokenId) ? tokenNftTransfers.get(transfer.tokenId) : new ArrayList(); + var current = tokenNftTransfers.containsKey(transfer.tokenId) + ? tokenNftTransfers.get(transfer.tokenId) + : new ArrayList(); current.add(transfer); tokenNftTransfers.put(transfer.tokenId, current); } @@ -309,13 +293,14 @@ static TransactionRecord fromProtobuf( } // HACK: This is a bit bad, any takers to clean this up - var contractFunctionResult = transactionRecord.hasContractCallResult() ? - new ContractFunctionResult(transactionRecord.getContractCallResult()) : - transactionRecord.hasContractCreateResult() ? - new ContractFunctionResult(transactionRecord.getContractCreateResult()) : - null; - - var automaticTokenAssociations = new ArrayList(transactionRecord.getAutomaticTokenAssociationsCount()); + var contractFunctionResult = transactionRecord.hasContractCallResult() + ? new ContractFunctionResult(transactionRecord.getContractCallResult()) + : transactionRecord.hasContractCreateResult() + ? new ContractFunctionResult(transactionRecord.getContractCreateResult()) + : null; + + var automaticTokenAssociations = + new ArrayList(transactionRecord.getAutomaticTokenAssociationsCount()); for (var tokenAssociation : transactionRecord.getAutomaticTokenAssociationsList()) { automaticTokenAssociations.add(TokenAssociation.fromProtobuf(tokenAssociation)); } @@ -327,37 +312,37 @@ static TransactionRecord fromProtobuf( paidStakingRewards.add(Transfer.fromProtobuf(reward)); } - List pendingAirdropRecords = transactionRecord.getNewPendingAirdropsList() - .stream().map(PendingAirdropRecord::fromProtobuf) - .collect(Collectors.toList()); + List pendingAirdropRecords = transactionRecord.getNewPendingAirdropsList().stream() + .map(PendingAirdropRecord::fromProtobuf) + .collect(Collectors.toList()); return new TransactionRecord( - TransactionReceipt.fromProtobuf(transactionRecord.getReceipt(), transactionId), - transactionRecord.getTransactionHash(), - InstantConverter.fromProtobuf(transactionRecord.getConsensusTimestamp()), - TransactionId.fromProtobuf(transactionRecord.getTransactionID()), - transactionRecord.getMemo(), - transactionRecord.getTransactionFee(), - contractFunctionResult, - transfers, - tokenTransfers, - tokenTransfersList, - tokenNftTransfers, - transactionRecord.hasScheduleRef() ? ScheduleId.fromProtobuf(transactionRecord.getScheduleRef()) : null, - fees, - automaticTokenAssociations, - aliasKey, - children, - duplicates, - transactionRecord.hasParentConsensusTimestamp() ? - InstantConverter.fromProtobuf(transactionRecord.getParentConsensusTimestamp()) : null, - transactionRecord.getEthereumHash(), - paidStakingRewards, - transactionRecord.hasPrngBytes() ? transactionRecord.getPrngBytes() : null, - transactionRecord.hasPrngNumber() ? transactionRecord.getPrngNumber() : null, - transactionRecord.getEvmAddress(), - pendingAirdropRecords - ); + TransactionReceipt.fromProtobuf(transactionRecord.getReceipt(), transactionId), + transactionRecord.getTransactionHash(), + InstantConverter.fromProtobuf(transactionRecord.getConsensusTimestamp()), + TransactionId.fromProtobuf(transactionRecord.getTransactionID()), + transactionRecord.getMemo(), + transactionRecord.getTransactionFee(), + contractFunctionResult, + transfers, + tokenTransfers, + tokenTransfersList, + tokenNftTransfers, + transactionRecord.hasScheduleRef() ? ScheduleId.fromProtobuf(transactionRecord.getScheduleRef()) : null, + fees, + automaticTokenAssociations, + aliasKey, + children, + duplicates, + transactionRecord.hasParentConsensusTimestamp() + ? InstantConverter.fromProtobuf(transactionRecord.getParentConsensusTimestamp()) + : null, + transactionRecord.getEthereumHash(), + paidStakingRewards, + transactionRecord.hasPrngBytes() ? transactionRecord.getPrngBytes() : null, + transactionRecord.hasPrngNumber() ? transactionRecord.getPrngNumber() : null, + transactionRecord.getEvmAddress(), + pendingAirdropRecords); } /** @@ -378,7 +363,8 @@ static TransactionRecord fromProtobuf(com.hiero.sdk.proto.TransactionRecord tran * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionRecord fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TransactionRecord.parseFrom(bytes).toBuilder().build()); + return fromProtobuf(com.hiero.sdk.proto.TransactionRecord.parseFrom(bytes).toBuilder() + .build()); } /** @@ -405,41 +391,39 @@ com.hiero.sdk.proto.TransactionRecord toProtobuf() { } var transactionRecord = com.hiero.sdk.proto.TransactionRecord.newBuilder() - .setReceipt(receipt.toProtobuf()) - .setTransactionHash(transactionHash) - .setConsensusTimestamp(InstantConverter.toProtobuf(consensusTimestamp)) - .setTransactionID(transactionId.toProtobuf()) - .setMemo(transactionMemo) - .setTransactionFee(transactionFee.toTinybars()) - .setTransferList(transferList) - .setEthereumHash(ethereumHash) - .setEvmAddress(evmAddress); + .setReceipt(receipt.toProtobuf()) + .setTransactionHash(transactionHash) + .setConsensusTimestamp(InstantConverter.toProtobuf(consensusTimestamp)) + .setTransactionID(transactionId.toProtobuf()) + .setMemo(transactionMemo) + .setTransactionFee(transactionFee.toTinybars()) + .setTransferList(transferList) + .setEthereumHash(ethereumHash) + .setEvmAddress(evmAddress); for (var tokenEntry : tokenTransfers.entrySet()) { - var tokenTransfersList = TokenTransferList.newBuilder() - .setToken(tokenEntry.getKey().toProtobuf()); + var tokenTransfersList = + TokenTransferList.newBuilder().setToken(tokenEntry.getKey().toProtobuf()); for (var aaEntry : tokenEntry.getValue().entrySet()) { tokenTransfersList.addTransfers(AccountAmount.newBuilder() - .setAccountID(aaEntry.getKey().toProtobuf()) - .setAmount(aaEntry.getValue()).build() - ); + .setAccountID(aaEntry.getKey().toProtobuf()) + .setAmount(aaEntry.getValue()) + .build()); } transactionRecord.addTokenTransferLists(tokenTransfersList); } for (var nftEntry : tokenNftTransfers.entrySet()) { - var nftTransferList = TokenTransferList.newBuilder() - .setToken(nftEntry.getKey().toProtobuf()); + var nftTransferList = + TokenTransferList.newBuilder().setToken(nftEntry.getKey().toProtobuf()); for (var aaEntry : nftEntry.getValue()) { - nftTransferList.addNftTransfers( - NftTransfer.newBuilder() + nftTransferList.addNftTransfers(NftTransfer.newBuilder() .setSenderAccountID(aaEntry.sender.toProtobuf()) .setReceiverAccountID(aaEntry.receiver.toProtobuf()) .setSerialNumber(aaEntry.serial) .setIsApproval(aaEntry.isApproved) - .build() - ); + .build()); } transactionRecord.addTokenTransferLists(nftTransferList); @@ -483,7 +467,8 @@ com.hiero.sdk.proto.TransactionRecord toProtobuf() { if (pendingAirdropRecords != null) { for (PendingAirdropRecord pendingAirdropRecord : pendingAirdropRecords) { - transactionRecord.addNewPendingAirdrops(pendingAirdropRecords.indexOf(pendingAirdropRecord), pendingAirdropRecord.toProtobuf()); + transactionRecord.addNewPendingAirdrops( + pendingAirdropRecords.indexOf(pendingAirdropRecord), pendingAirdropRecord.toProtobuf()); } } @@ -493,30 +478,30 @@ com.hiero.sdk.proto.TransactionRecord toProtobuf() { @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("receipt", receipt) - .add("transactionHash", Hex.toHexString(transactionHash.toByteArray())) - .add("consensusTimestamp", consensusTimestamp) - .add("transactionId", transactionId) - .add("transactionMemo", transactionMemo) - .add("transactionFee", transactionFee) - .add("contractFunctionResult", contractFunctionResult) - .add("transfers", transfers) - .add("tokenTransfers", tokenTransfers) - .add("tokenNftTransfers", tokenNftTransfers) - .add("scheduleRef", scheduleRef) - .add("assessedCustomFees", assessedCustomFees) - .add("automaticTokenAssociations", automaticTokenAssociations) - .add("aliasKey", aliasKey) - .add("children", children) - .add("duplicates", duplicates) - .add("parentConsensusTimestamp", parentConsensusTimestamp) - .add("ethereumHash", Hex.toHexString(ethereumHash.toByteArray())) - .add("paidStakingRewards", paidStakingRewards) - .add("prngBytes", prngBytes != null ? Hex.toHexString(prngBytes.toByteArray()) : null) - .add("prngNumber", prngNumber) - .add("evmAddress", Hex.toHexString(evmAddress.toByteArray())) - .add("pendingAirdropRecords", pendingAirdropRecords.toString()) - .toString(); + .add("receipt", receipt) + .add("transactionHash", Hex.toHexString(transactionHash.toByteArray())) + .add("consensusTimestamp", consensusTimestamp) + .add("transactionId", transactionId) + .add("transactionMemo", transactionMemo) + .add("transactionFee", transactionFee) + .add("contractFunctionResult", contractFunctionResult) + .add("transfers", transfers) + .add("tokenTransfers", tokenTransfers) + .add("tokenNftTransfers", tokenNftTransfers) + .add("scheduleRef", scheduleRef) + .add("assessedCustomFees", assessedCustomFees) + .add("automaticTokenAssociations", automaticTokenAssociations) + .add("aliasKey", aliasKey) + .add("children", children) + .add("duplicates", duplicates) + .add("parentConsensusTimestamp", parentConsensusTimestamp) + .add("ethereumHash", Hex.toHexString(ethereumHash.toByteArray())) + .add("paidStakingRewards", paidStakingRewards) + .add("prngBytes", prngBytes != null ? Hex.toHexString(prngBytes.toByteArray()) : null) + .add("prngNumber", prngNumber) + .add("evmAddress", Hex.toHexString(evmAddress.toByteArray())) + .add("pendingAirdropRecords", pendingAirdropRecords.toString()) + .toString(); } /** diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java b/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java index 7264a90ec6..13db046c9d 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.CryptoServiceGrpc; @@ -25,11 +7,10 @@ import com.hiero.sdk.proto.ResponseHeader; import com.hiero.sdk.proto.TransactionGetRecordQuery; import io.grpc.MethodDescriptor; - -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; /** * Get the record for a transaction. @@ -44,14 +25,14 @@ public final class TransactionRecordQuery extends Query { @Nullable private TransactionId transactionId = null; + private boolean includeChildren = false; private boolean includeDuplicates = false; /** * Constructor. */ - public TransactionRecordQuery() { - } + public TransactionRecordQuery() {} /** * Extract the transaction id. @@ -131,8 +112,8 @@ void validateChecksums(Client client) throws BadEntityIdException { @Override void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TransactionGetRecordQuery.newBuilder() - .setIncludeChildRecords(includeChildren) - .setIncludeDuplicates(includeDuplicates); + .setIncludeChildRecords(includeChildren) + .setIncludeDuplicates(includeDuplicates); if (transactionId != null) { builder.setTransactionID(transactionId.toProtobuf()); } @@ -155,12 +136,11 @@ TransactionRecord mapResponse(Response response, AccountId nodeId, com.hiero.sdk var recordResponse = response.getTransactionGetRecord(); List children = mapRecordList(recordResponse.getChildTransactionRecordsList()); List duplicates = mapRecordList(recordResponse.getDuplicateTransactionRecordsList()); - return TransactionRecord.fromProtobuf(recordResponse.getTransactionRecord(), children, duplicates, transactionId); + return TransactionRecord.fromProtobuf( + recordResponse.getTransactionRecord(), children, duplicates, transactionId); } - private List mapRecordList( - List protoRecordList - ) { + private List mapRecordList(List protoRecordList) { List outList = new ArrayList<>(protoRecordList.size()); for (var protoRecord : protoRecordList) { outList.add(TransactionRecord.fromProtobuf(protoRecord)); @@ -197,8 +177,10 @@ ExecutionState getExecutionState(Status status, Response response) { return ExecutionState.REQUEST_ERROR; } - var receiptStatus = - Status.valueOf(response.getTransactionGetRecord().getTransactionRecord().getReceipt().getStatus()); + var receiptStatus = Status.valueOf(response.getTransactionGetRecord() + .getTransactionRecord() + .getReceipt() + .getStatus()); switch (receiptStatus) { case BUSY: diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java b/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java index 8c56c0a9b9..e451861a80 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java +++ b/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -73,11 +55,10 @@ public final class TransactionResponse { * @param scheduledTransactionId the scheduled transaction id */ TransactionResponse( - AccountId nodeId, - TransactionId transactionId, - byte[] transactionHash, - @Nullable TransactionId scheduledTransactionId - ) { + AccountId nodeId, + TransactionId transactionId, + byte[] transactionHash, + @Nullable TransactionId scheduledTransactionId) { this.nodeId = nodeId; this.transactionId = transactionId; this.transactionHash = transactionHash; @@ -111,7 +92,8 @@ public TransactionResponse setValidateStatus(boolean validateStatus) { * @throws PrecheckStatusException when the precheck fails * @throws ReceiptStatusException when there is an issue with the receipt */ - public TransactionReceipt getReceipt(Client client) throws TimeoutException, PrecheckStatusException, ReceiptStatusException { + public TransactionReceipt getReceipt(Client client) + throws TimeoutException, PrecheckStatusException, ReceiptStatusException { return getReceipt(client, client.getRequestTimeout()); } @@ -125,10 +107,9 @@ public TransactionReceipt getReceipt(Client client) throws TimeoutException, Pre * @throws PrecheckStatusException when the precheck fails * @throws ReceiptStatusException when there is an issue with the receipt */ - public TransactionReceipt getReceipt(Client client, Duration timeout) throws TimeoutException, PrecheckStatusException, ReceiptStatusException { - var receipt = getReceiptQuery() - .execute(client, timeout) - .validateStatus(validateStatus); + public TransactionReceipt getReceipt(Client client, Duration timeout) + throws TimeoutException, PrecheckStatusException, ReceiptStatusException { + var receipt = getReceiptQuery().execute(client, timeout).validateStatus(validateStatus); return receipt; } @@ -140,8 +121,8 @@ public TransactionReceipt getReceipt(Client client, Duration timeout) throws Tim */ public TransactionReceiptQuery getReceiptQuery() { return new TransactionReceiptQuery() - .setTransactionId(transactionId) - .setNodeAccountIds(Collections.singletonList(nodeId)); + .setTransactionId(transactionId) + .setNodeAccountIds(Collections.singletonList(nodeId)); } /** @@ -162,15 +143,13 @@ public CompletableFuture getReceiptAsync(Client client) { * @return the transaction receipt */ public CompletableFuture getReceiptAsync(Client client, Duration timeout) { - return getReceiptQuery() - .executeAsync(client, timeout) - .thenCompose(receipt -> { - try { - return CompletableFuture.completedFuture(receipt.validateStatus(validateStatus)); - } catch (ReceiptStatusException e) { - return CompletableFuture.failedFuture(e); - } - }); + return getReceiptQuery().executeAsync(client, timeout).thenCompose(receipt -> { + try { + return CompletableFuture.completedFuture(receipt.validateStatus(validateStatus)); + } catch (ReceiptStatusException e) { + return CompletableFuture.failedFuture(e); + } + }); } /** @@ -213,7 +192,8 @@ public void getReceiptAsync(Client client, Consumer onSucces * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void getReceiptAsync(Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { + public void getReceiptAsync( + Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { ConsumerHelper.twoConsumers(getReceiptAsync(client, timeout), onSuccess, onFailure); } @@ -226,7 +206,8 @@ public void getReceiptAsync(Client client, Duration timeout, Consumer getRecordAsync(Client client) { * @return future result of the transaction record */ public CompletableFuture getRecordAsync(Client client, Duration timeout) { - return getReceiptAsync(client, timeout).thenCompose((receipt) -> getRecordQuery().executeAsync(client, timeout)); + return getReceiptAsync(client, timeout) + .thenCompose((receipt) -> getRecordQuery().executeAsync(client, timeout)); } /** @@ -317,16 +300,17 @@ public void getRecordAsync(Client client, Consumer onSuccess, * @param onSuccess a Consumer which consumes the result on success. * @param onFailure a Consumer which consumes the error on failure. */ - public void getRecordAsync(Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { + public void getRecordAsync( + Client client, Duration timeout, Consumer onSuccess, Consumer onFailure) { ConsumerHelper.twoConsumers(getRecordAsync(client, timeout), onSuccess, onFailure); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("nodeId", nodeId) - .add("transactionHash", Hex.toHexString(transactionHash)) - .add("transactionId", transactionId) - .toString(); + .add("nodeId", nodeId) + .add("transactionHash", Hex.toHexString(transactionHash)) + .add("transactionId", transactionId) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/Transfer.java b/sdk/src/main/java/com/hiero/sdk/Transfer.java index 7390afd765..977a731b08 100644 --- a/sdk/src/main/java/com/hiero/sdk/Transfer.java +++ b/sdk/src/main/java/com/hiero/sdk/Transfer.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -50,7 +32,8 @@ public final class Transfer { * @return the new transfer */ static Transfer fromProtobuf(AccountAmount accountAmount) { - return new Transfer(AccountId.fromProtobuf(accountAmount.getAccountID()), Hbar.fromTinybars(accountAmount.getAmount())); + return new Transfer( + AccountId.fromProtobuf(accountAmount.getAccountID()), Hbar.fromTinybars(accountAmount.getAmount())); } /** @@ -60,16 +43,16 @@ static Transfer fromProtobuf(AccountAmount accountAmount) { */ AccountAmount toProtobuf() { return AccountAmount.newBuilder() - .setAccountID(accountId.toProtobuf()) - .setAmount(amount.toTinybars()) - .build(); + .setAccountID(accountId.toProtobuf()) + .setAmount(amount.toTinybars()) + .build(); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("accountId", accountId) - .add("amount", amount) - .toString(); + .add("accountId", accountId) + .add("amount", amount) + .toString(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java b/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java index 5fd170be7f..75bf14b74e 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java +++ b/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.common.base.MoreObjects; @@ -58,19 +40,19 @@ private static class HbarTransfer { AccountAmount toProtobuf() { return AccountAmount.newBuilder() - .setAccountID(accountId.toProtobuf()) - .setAmount(amount.toTinybars()) - .setIsApproval(isApproved) - .build(); + .setAccountID(accountId.toProtobuf()) + .setAmount(amount.toTinybars()) + .setIsApproval(isApproved) + .build(); } @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("accountId", accountId) - .add("amount", amount) - .add("isApproved", isApproved) - .toString(); + .add("accountId", accountId) + .add("amount", amount) + .add("isApproved", isApproved) + .toString(); } } @@ -87,9 +69,8 @@ public TransferTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TransferTransaction( - LinkedHashMap> txs) - throws InvalidProtocolBufferException { + TransferTransaction(LinkedHashMap> txs) + throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } @@ -197,7 +178,8 @@ CryptoTransferTransactionBody.Builder build() { var builder = CryptoTransferTransactionBody.newBuilder(); - this.hbarTransfers.sort(Comparator.comparing((HbarTransfer a) -> a.accountId).thenComparing(a -> a.isApproved)); + this.hbarTransfers.sort( + Comparator.comparing((HbarTransfer a) -> a.accountId).thenComparing(a -> a.isApproved)); var hbarTransfersList = TransferList.newBuilder(); for (var transfer : hbarTransfers) { hbarTransfersList.addAccountAmounts(transfer.toProtobuf()); @@ -242,10 +224,9 @@ void initFromTransactionBody() { for (var transfer : body.getTransfers().getAccountAmountsList()) { hbarTransfers.add(new HbarTransfer( - AccountId.fromProtobuf(transfer.getAccountID()), - Hbar.fromTinybars(transfer.getAmount()), - transfer.getIsApproval() - )); + AccountId.fromProtobuf(transfer.getAccountID()), + Hbar.fromTinybars(transfer.getAmount()), + transfer.getIsApproval())); } for (var tokenTransferList : body.getTokenTransfersList()) { @@ -253,22 +234,22 @@ void initFromTransactionBody() { for (var transfer : tokenTransferList.getTransfersList()) { tokenTransfers.add(new TokenTransfer( - token, - AccountId.fromProtobuf(transfer.getAccountID()), - transfer.getAmount(), - tokenTransferList.hasExpectedDecimals() ? tokenTransferList.getExpectedDecimals().getValue() : null, - transfer.getIsApproval() - )); + token, + AccountId.fromProtobuf(transfer.getAccountID()), + transfer.getAmount(), + tokenTransferList.hasExpectedDecimals() + ? tokenTransferList.getExpectedDecimals().getValue() + : null, + transfer.getIsApproval())); } for (var transfer : tokenTransferList.getNftTransfersList()) { nftTransfers.add(new TokenNftTransfer( - token, - AccountId.fromProtobuf(transfer.getSenderAccountID()), - AccountId.fromProtobuf(transfer.getReceiverAccountID()), - transfer.getSerialNumber(), - transfer.getIsApproval() - )); + token, + AccountId.fromProtobuf(transfer.getSenderAccountID()), + AccountId.fromProtobuf(transfer.getReceiverAccountID()), + transfer.getSerialNumber(), + transfer.getIsApproval())); } } } diff --git a/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java b/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java index 5e70a29dba..767149bf5b 100644 --- a/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java +++ b/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.logger; public enum LogLevel { diff --git a/sdk/src/main/java/com/hiero/sdk/logger/Logger.java b/sdk/src/main/java/com/hiero/sdk/logger/Logger.java index 6efc18ca11..31bd28f9c2 100644 --- a/sdk/src/main/java/com/hiero/sdk/logger/Logger.java +++ b/sdk/src/main/java/com/hiero/sdk/logger/Logger.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.logger; import org.slf4j.LoggerFactory; diff --git a/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java b/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java index 43aefee0e6..df072171a9 100644 --- a/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java +++ b/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.utils; /** diff --git a/sdk/src/test/java/com/hiero/logger/LoggerTest.java b/sdk/src/test/java/com/hiero/logger/LoggerTest.java index aa3293ab3f..80613988c6 100644 --- a/sdk/src/test/java/com/hiero/logger/LoggerTest.java +++ b/sdk/src/test/java/com/hiero/logger/LoggerTest.java @@ -1,15 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.logger; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import com.hiero.sdk.logger.LogLevel; +import com.hiero.sdk.logger.Logger; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + class LoggerTest { private Logger logger; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java index 95a5c7dbdd..9e66345a69 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java @@ -1,50 +1,24 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountAllowanceApproveTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - public class AccountAllowanceApproveTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("1.2.3"); private static final AccountId testOwnerAccountId = AccountId.fromString("4.5.7"); @@ -65,25 +39,25 @@ public static void afterAll() { AccountAllowanceApproveTransaction spawnTestTransaction() { var ownerId = AccountId.fromString("5.6.7"); return new AccountAllowanceApproveTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .addHbarAllowance(AccountId.fromString("1.1.1"), new Hbar(3)) - .addTokenAllowance(TokenId.fromString("2.2.2"), AccountId.fromString("3.3.3"), 6) - .addTokenNftAllowance(TokenId.fromString("4.4.4").nft(123), AccountId.fromString("5.5.5")) - .addTokenNftAllowance(TokenId.fromString("4.4.4").nft(456), AccountId.fromString("5.5.5")) - .addTokenNftAllowance(TokenId.fromString("8.8.8").nft(456), AccountId.fromString("5.5.5")) - .addTokenNftAllowance(TokenId.fromString("4.4.4").nft(789), AccountId.fromString("9.9.9")) - .addAllTokenNftAllowance(TokenId.fromString("6.6.6"), AccountId.fromString("7.7.7")) - .approveHbarAllowance(ownerId, AccountId.fromString("1.1.1"), new Hbar(3)) - .approveTokenAllowance(TokenId.fromString("2.2.2"), ownerId, AccountId.fromString("3.3.3"), 6) - .approveTokenNftAllowance(TokenId.fromString("4.4.4").nft(123), ownerId, AccountId.fromString("5.5.5")) - .approveTokenNftAllowance(TokenId.fromString("4.4.4").nft(456), ownerId, AccountId.fromString("5.5.5")) - .approveTokenNftAllowance(TokenId.fromString("8.8.8").nft(456), ownerId, AccountId.fromString("5.5.5")) - .approveTokenNftAllowance(TokenId.fromString("4.4.4").nft(789), ownerId, AccountId.fromString("9.9.9")) - .approveTokenNftAllowanceAllSerials(TokenId.fromString("6.6.6"), ownerId, AccountId.fromString("7.7.7")) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .addHbarAllowance(AccountId.fromString("1.1.1"), new Hbar(3)) + .addTokenAllowance(TokenId.fromString("2.2.2"), AccountId.fromString("3.3.3"), 6) + .addTokenNftAllowance(TokenId.fromString("4.4.4").nft(123), AccountId.fromString("5.5.5")) + .addTokenNftAllowance(TokenId.fromString("4.4.4").nft(456), AccountId.fromString("5.5.5")) + .addTokenNftAllowance(TokenId.fromString("8.8.8").nft(456), AccountId.fromString("5.5.5")) + .addTokenNftAllowance(TokenId.fromString("4.4.4").nft(789), AccountId.fromString("9.9.9")) + .addAllTokenNftAllowance(TokenId.fromString("6.6.6"), AccountId.fromString("7.7.7")) + .approveHbarAllowance(ownerId, AccountId.fromString("1.1.1"), new Hbar(3)) + .approveTokenAllowance(TokenId.fromString("2.2.2"), ownerId, AccountId.fromString("3.3.3"), 6) + .approveTokenNftAllowance(TokenId.fromString("4.4.4").nft(123), ownerId, AccountId.fromString("5.5.5")) + .approveTokenNftAllowance(TokenId.fromString("4.4.4").nft(456), ownerId, AccountId.fromString("5.5.5")) + .approveTokenNftAllowance(TokenId.fromString("8.8.8").nft(456), ownerId, AccountId.fromString("5.5.5")) + .approveTokenNftAllowance(TokenId.fromString("4.4.4").nft(789), ownerId, AccountId.fromString("9.9.9")) + .approveTokenNftAllowanceAllSerials(TokenId.fromString("6.6.6"), ownerId, AccountId.fromString("7.7.7")) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -117,12 +91,12 @@ void shouldBytesNoSetters() throws Exception { assertThat(tx2.toString()).isEqualTo(tx.toString()); } - @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setCryptoApproveAllowance(CryptoApproveAllowanceTransactionBody.newBuilder().build()) - .build(); + .setCryptoApproveAllowance( + CryptoApproveAllowanceTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -132,15 +106,21 @@ void fromScheduledTransaction() { @Test void deleteNftAllowanceAllSerials() { var accountAllowanceApproveTransaction = new AccountAllowanceApproveTransaction() - .deleteTokenNftAllowanceAllSerials(testTokenId, testOwnerAccountId, testSpenderAccountId); - - assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().size()).isEqualTo(1); - assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).tokenId).isEqualTo(testTokenId); - assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).ownerAccountId).isEqualTo( - testOwnerAccountId); - assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).spenderAccountId).isEqualTo( - testSpenderAccountId); - assertTrue(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).serialNumbers.isEmpty()); + .deleteTokenNftAllowanceAllSerials(testTokenId, testOwnerAccountId, testSpenderAccountId); + + assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().size()) + .isEqualTo(1); + assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).tokenId) + .isEqualTo(testTokenId); + assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).ownerAccountId) + .isEqualTo(testOwnerAccountId); + assertThat(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).spenderAccountId) + .isEqualTo(testSpenderAccountId); + assertTrue(accountAllowanceApproveTransaction + .getTokenNftApprovals() + .get(0) + .serialNumbers + .isEmpty()); assertFalse(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).allSerials); assertNull(accountAllowanceApproveTransaction.getTokenNftApprovals().get(0).delegatingSpender); } @@ -148,7 +128,8 @@ void deleteNftAllowanceAllSerials() { @Test void deleteNftAllowanceAllSerialsFrozen() { var tx = spawnTestTransaction(); - assertThrows(IllegalStateException.class, - () -> tx.deleteTokenNftAllowanceAllSerials(testTokenId, testOwnerAccountId, testSpenderAccountId)); + assertThrows( + IllegalStateException.class, + () -> tx.deleteTokenNftAllowanceAllSerials(testTokenId, testOwnerAccountId, testSpenderAccountId)); } } diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java index 552c2f5524..31d7511718 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountAllowanceDeleteTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class AccountAllowanceDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -57,17 +31,17 @@ public static void afterAll() { AccountAllowanceDeleteTransaction spawnTestTransaction() { var ownerId = AccountId.fromString("5.6.7"); return new AccountAllowanceDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .deleteAllHbarAllowances(ownerId) - .deleteAllTokenAllowances(TokenId.fromString("2.2.2"), ownerId) - .deleteAllTokenNftAllowances(TokenId.fromString("4.4.4").nft(123), ownerId) - .deleteAllTokenNftAllowances(TokenId.fromString("4.4.4").nft(456), ownerId) - .deleteAllTokenNftAllowances(TokenId.fromString("8.8.8").nft(456), ownerId) - .deleteAllTokenNftAllowances(TokenId.fromString("4.4.4").nft(789), ownerId) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .deleteAllHbarAllowances(ownerId) + .deleteAllTokenAllowances(TokenId.fromString("2.2.2"), ownerId) + .deleteAllTokenNftAllowances(TokenId.fromString("4.4.4").nft(123), ownerId) + .deleteAllTokenNftAllowances(TokenId.fromString("4.4.4").nft(456), ownerId) + .deleteAllTokenNftAllowances(TokenId.fromString("8.8.8").nft(456), ownerId) + .deleteAllTokenNftAllowances(TokenId.fromString("4.4.4").nft(789), ownerId) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -92,8 +66,9 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setCryptoDeleteAllowance(CryptoDeleteAllowanceTransactionBody.newBuilder().build()) - .build(); + .setCryptoDeleteAllowance( + CryptoDeleteAllowanceTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java index ae1e587893..782a128564 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractId; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -43,17 +22,19 @@ public static void afterAll() { void shouldSerializeWithAccountId() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountBalanceQuery() - .setAccountId(AccountId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setAccountId(AccountId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test void shouldSerializeWithContractId() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountBalanceQuery() - .setContractId(ContractId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setContractId(ContractId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java index 9da472ebb4..2f9bf35ea6 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java @@ -1,47 +1,21 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.EvmAddress; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.CryptoCreateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Duration; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class AccountCreateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -57,37 +31,37 @@ public static void afterAll() { AccountCreateTransaction spawnTestTransaction() { return new AccountCreateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setKey(unusedPrivateKey) - .setInitialBalance(Hbar.fromTinybars(450)) - .setProxyAccountId(AccountId.fromString("0.0.1001")) - .setAccountMemo("some dumb memo") - .setReceiverSignatureRequired(true) - .setAutoRenewPeriod(Duration.ofHours(10)) - .setStakedAccountId(AccountId.fromString("0.0.3")) - .setAlias("0x5c562e90feaf0eebd33ea75d21024f249d451417") - .setMaxAutomaticTokenAssociations(100) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setKey(unusedPrivateKey) + .setInitialBalance(Hbar.fromTinybars(450)) + .setProxyAccountId(AccountId.fromString("0.0.1001")) + .setAccountMemo("some dumb memo") + .setReceiverSignatureRequired(true) + .setAutoRenewPeriod(Duration.ofHours(10)) + .setStakedAccountId(AccountId.fromString("0.0.3")) + .setAlias("0x5c562e90feaf0eebd33ea75d21024f249d451417") + .setMaxAutomaticTokenAssociations(100) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } AccountCreateTransaction spawnTestTransaction2() { return new AccountCreateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setKey(unusedPrivateKey) - .setInitialBalance(Hbar.fromTinybars(450)) - .setProxyAccountId(AccountId.fromString("0.0.1001")) - .setAccountMemo("some dumb memo") - .setReceiverSignatureRequired(true) - .setAutoRenewPeriod(Duration.ofHours(10)) - .setStakedNodeId(4L) - .setMaxAutomaticTokenAssociations(100) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setKey(unusedPrivateKey) + .setInitialBalance(Hbar.fromTinybars(450)) + .setProxyAccountId(AccountId.fromString("0.0.1001")) + .setAccountMemo("some dumb memo") + .setReceiverSignatureRequired(true) + .setAutoRenewPeriod(Duration.ofHours(10)) + .setStakedNodeId(4L) + .setMaxAutomaticTokenAssociations(100) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -121,7 +95,6 @@ void shouldBytesNoSetters() throws Exception { assertThat(tx2.toString()).isEqualTo(tx.toString()); } - @Test void propertiesTest() { var tx = spawnTestTransaction(); @@ -142,8 +115,8 @@ void propertiesTest() { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setCryptoCreateAccount(CryptoCreateTransactionBody.newBuilder().build()) - .build(); + .setCryptoCreateAccount(CryptoCreateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java index 2ccfb051ce..cadd809f0d 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java @@ -1,45 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.CryptoDeleteTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class AccountDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -55,20 +30,18 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private AccountDeleteTransaction spawnTestTransaction() { return new AccountDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.5007")) - .setTransferAccountId(AccountId.fromString("0.0.5008")) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.5007")) + .setTransferAccountId(AccountId.fromString("0.0.5008")) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -88,10 +61,10 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setCryptoDelete( - CryptoDeleteTransactionBody.newBuilder() - .setDeleteAccountID(AccountId.fromString("6.6.6").toProtobuf()).build()) - .build(); + .setCryptoDelete(CryptoDeleteTransactionBody.newBuilder() + .setDeleteAccountID(AccountId.fromString("6.6.6").toProtobuf()) + .build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java index a2fe15db10..6dc6285451 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java @@ -1,40 +1,17 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.BadEntityIdException; -import com.hiero.sdk.Client; -import com.hiero.sdk.EvmAddress; import io.github.jsonSnapshot.SnapshotMatcher; +import java.util.concurrent.TimeoutException; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.concurrent.TimeoutException; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class AccountIdTest { static Client mainnetClient; @@ -64,17 +41,20 @@ void fromString() { @Test void fromStringWithChecksumOnMainnet() { - SnapshotMatcher.expect(AccountId.fromString("0.0.123-vfmkw").toStringWithChecksum(mainnetClient)).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromString("0.0.123-vfmkw").toStringWithChecksum(mainnetClient)) + .toMatchSnapshot(); } @Test void fromStringWithChecksumOnTestnet() { - SnapshotMatcher.expect(AccountId.fromString("0.0.123-esxsf").toStringWithChecksum(testnetClient)).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromString("0.0.123-esxsf").toStringWithChecksum(testnetClient)) + .toMatchSnapshot(); } @Test void fromStringWithChecksumOnPreviewnet() { - SnapshotMatcher.expect(AccountId.fromString("0.0.123-ogizo").toStringWithChecksum(previewnetClient)).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromString("0.0.123-ogizo").toStringWithChecksum(previewnetClient)) + .toMatchSnapshot(); } @Test @@ -123,62 +103,82 @@ void malformedIdChecksum2() { @Test void malformedAliasKey() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf777"); + AccountId.fromString( + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf777"); }); } @Test void malformedAliasKey2() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf777g"); + AccountId.fromString( + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf777g"); }); } @Test void malformedAliasKey3() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - AccountId.fromString("0.0.303a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777"); + AccountId.fromString( + "0.0.303a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777"); }); } @Test void fromStringWithAliasKey() { - SnapshotMatcher.expect(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromString( + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777") + .toString()) + .toMatchSnapshot(); } @Test void fromStringWithEvmAddress() { - SnapshotMatcher.expect(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82da").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82da") + .toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddress() { - SnapshotMatcher.expect(AccountId.fromSolidityAddress("000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromSolidityAddress("000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddressWith0x() { - SnapshotMatcher.expect(AccountId.fromSolidityAddress("0x000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromSolidityAddress("0x000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test void toBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(Hex.toHexString(new AccountId(5005).toProtobuf().toByteArray())).toMatchSnapshot(); + SnapshotMatcher.expect(Hex.toHexString(new AccountId(5005).toProtobuf().toByteArray())) + .toMatchSnapshot(); } @Test void toBytesAlias() { - SnapshotMatcher.expect(Hex.toHexString(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777").toBytes())).toMatchSnapshot(); + SnapshotMatcher.expect(Hex.toHexString(AccountId.fromString( + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777") + .toBytes())) + .toMatchSnapshot(); } @Test void toBytesEvmAddress() { - SnapshotMatcher.expect(Hex.toHexString(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82da").toBytes())).toMatchSnapshot(); + SnapshotMatcher.expect(Hex.toHexString(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82da") + .toBytes())) + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(AccountId.fromBytes(new AccountId(5005).toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect( + AccountId.fromBytes(new AccountId(5005).toBytes()).toString()) + .toMatchSnapshot(); } @Test @@ -190,26 +190,35 @@ void toFromProtobuf() { @Test void fromBytesAlias() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(AccountId.fromBytes(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777").toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromBytes(AccountId.fromString( + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777") + .toBytes()) + .toString()) + .toMatchSnapshot(); } @Test void toFromProtobufAliasKey() { - var id1 = AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777"); + var id1 = AccountId.fromString( + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777"); var id2 = AccountId.fromProtobuf(id1.toProtobuf()); assertThat(id2).isEqualTo(id1); } @Test void toFromProtobufEcdsaAliasKey() { - var id1 = AccountId.fromString("0.0.302d300706052b8104000a032200035d348292bbb8b511fdbe24e3217ec099944b4728999d337f9a025f4193324525"); + var id1 = AccountId.fromString( + "0.0.302d300706052b8104000a032200035d348292bbb8b511fdbe24e3217ec099944b4728999d337f9a025f4193324525"); var id2 = AccountId.fromProtobuf(id1.toProtobuf()); assertThat(id2).isEqualTo(id1); } @Test void fromBytesEvmAddress() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(AccountId.fromBytes(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82da").toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AccountId.fromBytes(AccountId.fromString("0.0.302a300506032b6570032100114e6abc371b82da") + .toBytes()) + .toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java index 63e03e70fc..bf0a03bc3e 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountInfoQuery; -import com.hiero.sdk.Hbar; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -43,9 +22,10 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountInfoQuery() - .setAccountId(AccountId.fromString("0.0.5005")) - .setMaxQueryPayment(Hbar.fromTinybars(100_000)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setAccountId(AccountId.fromString("0.0.5005")) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java b/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java index 8673a0c453..ecda40fc8f 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java @@ -1,68 +1,44 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountInfo; -import com.hiero.sdk.DurationConverter; -import com.hiero.sdk.InstantConverter; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.PrivateKey; import com.hiero.sdk.proto.CryptoGetInfoResponse; import com.hiero.sdk.proto.KeyList; import com.hiero.sdk.proto.LiveHash; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Duration; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Duration; -import java.time.Instant; - public class AccountInfoTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final byte[] hash = {0, 1, 2}; - private static final LiveHash liveHash = LiveHash.newBuilder().setAccountId(new AccountId(10).toProtobuf()) - .setDuration(DurationConverter.toProtobuf(Duration.ofDays(11))) - .setHash(ByteString.copyFrom(hash)) - .setKeys(KeyList.newBuilder().addKeys(privateKey.getPublicKey().toProtobufKey())) - .build(); + private static final LiveHash liveHash = LiveHash.newBuilder() + .setAccountId(new AccountId(10).toProtobuf()) + .setDuration(DurationConverter.toProtobuf(Duration.ofDays(11))) + .setHash(ByteString.copyFrom(hash)) + .setKeys(KeyList.newBuilder().addKeys(privateKey.getPublicKey().toProtobufKey())) + .build(); private static final CryptoGetInfoResponse.AccountInfo info = CryptoGetInfoResponse.AccountInfo.newBuilder() - .setAccountID(new AccountId(1).toProtobuf()) - .setDeleted(true) - .setProxyReceived(2) - .setKey(privateKey.getPublicKey().toProtobufKey()) - .setBalance(3) - .setGenerateSendRecordThreshold(4) - .setGenerateReceiveRecordThreshold(5) - .setReceiverSigRequired(true) - .setExpirationTime(InstantConverter.toProtobuf(Instant.ofEpochMilli(6))) - .setAutoRenewPeriod(DurationConverter.toProtobuf(Duration.ofDays(7))) - .setProxyAccountID(new AccountId(8).toProtobuf()) - .addLiveHashes(liveHash) - .setLedgerId(LedgerId.PREVIEWNET.toByteString()) - .setEthereumNonce(1001) - .build(); + .setAccountID(new AccountId(1).toProtobuf()) + .setDeleted(true) + .setProxyReceived(2) + .setKey(privateKey.getPublicKey().toProtobufKey()) + .setBalance(3) + .setGenerateSendRecordThreshold(4) + .setGenerateReceiveRecordThreshold(5) + .setReceiverSigRequired(true) + .setExpirationTime(InstantConverter.toProtobuf(Instant.ofEpochMilli(6))) + .setAutoRenewPeriod(DurationConverter.toProtobuf(Duration.ofDays(7))) + .setProxyAccountID(new AccountId(8).toProtobuf()) + .addLiveHashes(liveHash) + .setLedgerId(LedgerId.PREVIEWNET.toByteString()) + .setEthereumNonce(1001) + .build(); @BeforeAll public static void beforeAll() { @@ -76,25 +52,24 @@ public static void afterAll() { @Test void fromProtobufWithOtherOptions() { - SnapshotMatcher.expect(AccountInfo.fromProtobuf(info).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect(AccountInfo.fromProtobuf(info).toString()).toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(AccountInfo.fromBytes(info.toByteArray()).toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void toBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(AccountInfo.fromBytes(info.toByteArray()).toBytes()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void toProtobuf() throws InvalidProtocolBufferException { SnapshotMatcher.expect(AccountInfo.fromProtobuf(info).toProtobuf().toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java index abe4e75501..84e72b81d7 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountRecordsQuery; -import com.hiero.sdk.Hbar; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -43,9 +22,10 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountRecordsQuery() - .setAccountId(AccountId.fromString("0.0.5005")) - .setMaxQueryPayment(Hbar.fromTinybars(100_000)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setAccountId(AccountId.fromString("0.0.5005")) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java index e546222942..0df37a7e84 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountStakersQuery; -import com.hiero.sdk.Hbar; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -43,9 +22,10 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new AccountStakersQuery() - .setAccountId(AccountId.fromString("0.0.5005")) - .setMaxQueryPayment(Hbar.fromTinybars(100_000)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setAccountId(AccountId.fromString("0.0.5005")) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java index dc1ace2155..dc0b40709b 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java @@ -1,46 +1,21 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountUpdateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.CryptoUpdateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Duration; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class AccountUpdateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,38 +31,38 @@ public static void afterAll() { AccountUpdateTransaction spawnTestTransaction() { return new AccountUpdateTransaction() - .setKey(unusedPrivateKey) - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.2002")) - .setProxyAccountId(AccountId.fromString("0.0.1001")) - .setAutoRenewPeriod(Duration.ofHours(10)) - .setExpirationTime(Instant.ofEpochSecond(1554158543)) - .setReceiverSignatureRequired(false) - .setMaxAutomaticTokenAssociations(100) - .setAccountMemo("Some memo") - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setStakedAccountId(AccountId.fromString("0.0.3")) - .freeze() - .sign(unusedPrivateKey); + .setKey(unusedPrivateKey) + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.2002")) + .setProxyAccountId(AccountId.fromString("0.0.1001")) + .setAutoRenewPeriod(Duration.ofHours(10)) + .setExpirationTime(Instant.ofEpochSecond(1554158543)) + .setReceiverSignatureRequired(false) + .setMaxAutomaticTokenAssociations(100) + .setAccountMemo("Some memo") + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setStakedAccountId(AccountId.fromString("0.0.3")) + .freeze() + .sign(unusedPrivateKey); } AccountUpdateTransaction spawnTestTransaction2() { return new AccountUpdateTransaction() - .setKey(unusedPrivateKey) - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.2002")) - .setProxyAccountId(AccountId.fromString("0.0.1001")) - .setAutoRenewPeriod(Duration.ofHours(10)) - .setExpirationTime(Instant.ofEpochSecond(1554158543)) - .setReceiverSignatureRequired(false) - .setMaxAutomaticTokenAssociations(100) - .setAccountMemo("Some memo") - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setStakedNodeId(4L) - .freeze() - .sign(unusedPrivateKey); + .setKey(unusedPrivateKey) + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.2002")) + .setProxyAccountId(AccountId.fromString("0.0.1001")) + .setAutoRenewPeriod(Duration.ofHours(10)) + .setExpirationTime(Instant.ofEpochSecond(1554158543)) + .setReceiverSignatureRequired(false) + .setMaxAutomaticTokenAssociations(100) + .setAccountMemo("Some memo") + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setStakedNodeId(4L) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -124,8 +99,8 @@ void shouldBytes2() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setCryptoUpdateAccount(CryptoUpdateTransactionBody.newBuilder().build()) - .build(); + .setCryptoUpdateAccount(CryptoUpdateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java b/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java index 2b05f96310..807f44d719 100644 --- a/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java @@ -1,35 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AddressBookQuery; -import com.hiero.sdk.Client; -import com.hiero.sdk.Endpoint; -import com.hiero.sdk.FileId; +import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatException; + import com.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.Server; import io.grpc.Status; import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.StreamObserver; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - import java.time.Duration; import java.util.ArrayDeque; import java.util.Collections; import java.util.List; import java.util.Queue; - -import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; class AddressBookQueryMockTest { private Client client; - final private AddressBookQueryStub addressBookServiceStub = new AddressBookQueryStub(); + private final AddressBookQueryStub addressBookServiceStub = new AddressBookQueryStub(); private Server server; private AddressBookQuery addressBookQuery; @@ -38,10 +33,10 @@ void setup() throws Exception { client = Client.forNetwork(Collections.emptyMap()); client.setMirrorNetwork(List.of("in-process:test")); server = InProcessServerBuilder.forName("test") - .addService(addressBookServiceStub) - .directExecutor() - .build() - .start(); + .addService(addressBookServiceStub) + .directExecutor() + .build() + .start(); addressBookQuery = new AddressBookQuery(); addressBookQuery.setFileId(FileId.ADDRESS_BOOK); } @@ -61,47 +56,39 @@ void teardown() throws Exception { @ParameterizedTest(name = "[{0}] AddressBookQuery works") @CsvSource({"sync", "async"}) void addressBookQueryWorks(String executeVersion) throws Throwable { - addressBookServiceStub.requests.add( - com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .setLimit(3) - .build() - ); - addressBookServiceStub.responses.add( - new com.hiero.sdk.NodeAddress() + .build()); + addressBookServiceStub.responses.add(new com.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) - .toProtobuf() - ); + .toProtobuf()); addressBookQuery.setLimit(3); - var nodes = executeVersion.equals("sync") ? - addressBookQuery.execute(client) : - addressBookQuery.executeAsync(client).get(); + var nodes = executeVersion.equals("sync") + ? addressBookQuery.execute(client) + : addressBookQuery.executeAsync(client).get(); assertThat(nodes.nodeAddresses).hasSize(1); assertThat(nodes.nodeAddresses.get(0).accountId).isEqualTo(AccountId.fromString("0.0.3")); } Endpoint spawnEndpoint() { return new Endpoint() - .setAddress(new byte[] {0x00, 0x01, 0x02, 0x03}) - .setDomainName("unit.test.com") - .setPort(PORT_NODE_PLAIN); + .setAddress(new byte[] {0x00, 0x01, 0x02, 0x03}) + .setDomainName("unit.test.com") + .setPort(PORT_NODE_PLAIN); } @Test void networkUpdatePeriodWorks() throws Throwable { - addressBookServiceStub.requests.add( - com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) - .build() - ); - addressBookServiceStub.responses.add( - new com.hiero.sdk.NodeAddress() + .build()); + addressBookServiceStub.responses.add(new com.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .setAddresses(Collections.singletonList(spawnEndpoint())) - .toProtobuf() - ); + .toProtobuf()); client.setNetworkUpdatePeriod(Duration.ofSeconds(1)); Thread.sleep(1400); @@ -123,26 +110,21 @@ void networkUpdatePeriodWorks() throws Throwable { "async, UNAVAILABLE, " }) void addressBookQueryRetries(String executeVersion, Status.Code code, String description) throws Throwable { - addressBookServiceStub.requests.add( - com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) - .build() - ); - addressBookServiceStub.requests.add( - com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + .build()); + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) - .build() - ); - addressBookServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); + .build()); addressBookServiceStub.responses.add( - new com.hiero.sdk.NodeAddress() + code.toStatus().withDescription(description).asRuntimeException()); + addressBookServiceStub.responses.add(new com.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) - .toProtobuf() - ); + .toProtobuf()); - var nodes = executeVersion.equals("sync") ? - addressBookQuery.execute(client) : - addressBookQuery.executeAsync(client).get(); + var nodes = executeVersion.equals("sync") + ? addressBookQuery.execute(client) + : addressBookQuery.executeAsync(client).get(); assertThat(nodes.nodeAddresses).hasSize(1); assertThat(nodes.nodeAddresses.get(0).accountId).isEqualTo(AccountId.fromString("0.0.3")); } @@ -160,15 +142,15 @@ void addressBookQueryRetries(String executeVersion, Status.Code code, String des }) void addressBookQueryFails(String executeVersion, Status.Code code, String description) { addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() - .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) - .build() - ); - addressBookServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); + .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) + .build()); + addressBookServiceStub.responses.add( + code.toStatus().withDescription(description).asRuntimeException()); assertThatException().isThrownBy(() -> { - var result = executeVersion.equals("sync") ? - addressBookQuery.execute(client) : - addressBookQuery.executeAsync(client).get(); + var result = executeVersion.equals("sync") + ? addressBookQuery.execute(client) + : addressBookQuery.executeAsync(client).get(); }); } @@ -183,26 +165,25 @@ void addressBookQueryFails(String executeVersion, Status.Code code, String descr "async, RESOURCE_EXHAUSTED, ", "async, UNAVAILABLE, " }) - void addressBookQueryStopsAtMaxAttempts(String executeVersion, Status.Code code, String description) throws Throwable { + void addressBookQueryStopsAtMaxAttempts(String executeVersion, Status.Code code, String description) + throws Throwable { addressBookQuery.setMaxAttempts(2); - addressBookServiceStub.requests.add( - com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) - .build() - ); - addressBookServiceStub.requests.add( - com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + .build()); + addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) - .build() - ); - addressBookServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); - addressBookServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); + .build()); + addressBookServiceStub.responses.add( + code.toStatus().withDescription(description).asRuntimeException()); + addressBookServiceStub.responses.add( + code.toStatus().withDescription(description).asRuntimeException()); assertThatException().isThrownBy(() -> { - var result = executeVersion.equals("sync") ? - addressBookQuery.execute(client) : - addressBookQuery.executeAsync(client).get(); + var result = executeVersion.equals("sync") + ? addressBookQuery.execute(client) + : addressBookQuery.executeAsync(client).get(); }); } @@ -213,9 +194,8 @@ private static class AddressBookQueryStub extends NetworkServiceGrpc.NetworkServ @Override public void getNodes( - com.hiero.sdk.proto.mirror.AddressBookQuery addressBookQuery, - StreamObserver streamObserver - ) { + com.hiero.sdk.proto.mirror.AddressBookQuery addressBookQuery, + StreamObserver streamObserver) { var request = requests.poll(); assertThat(request).isNotNull(); assertThat(addressBookQuery).isEqualTo(request); diff --git a/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java b/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java index 9223b537fb..e32607b8e9 100644 --- a/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java @@ -1,41 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.HbarAllowance; -import com.hiero.sdk.TokenAllowance; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenNftAllowance; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.util.ArrayList; import java.util.Collections; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class AllowancesTest { @BeforeAll @@ -50,11 +25,7 @@ public static void afterAll() { TokenAllowance spawnTokenAllowance() { return new TokenAllowance( - TokenId.fromString("1.2.3"), - AccountId.fromString("4.5.6"), - AccountId.fromString("5.5.5"), - 777 - ); + TokenId.fromString("1.2.3"), AccountId.fromString("4.5.6"), AccountId.fromString("5.5.5"), 777); } TokenNftAllowance spawnNftAllowance() { @@ -62,24 +33,22 @@ TokenNftAllowance spawnNftAllowance() { serials.add(123L); serials.add(456L); return new TokenNftAllowance( - TokenId.fromString("1.1.1"), - AccountId.fromString("2.2.2"), - AccountId.fromString("3.3.3"), - null, - serials, - null - ); + TokenId.fromString("1.1.1"), + AccountId.fromString("2.2.2"), + AccountId.fromString("3.3.3"), + null, + serials, + null); } TokenNftAllowance spawnAllNftAllowance() { return new TokenNftAllowance( - TokenId.fromString("1.1.1"), - AccountId.fromString("2.2.2"), - AccountId.fromString("3.3.3"), - null, - Collections.emptyList(), - true - ); + TokenId.fromString("1.1.1"), + AccountId.fromString("2.2.2"), + AccountId.fromString("3.3.3"), + null, + Collections.emptyList(), + true); } HbarAllowance spawnHbarAllowance() { @@ -89,11 +58,11 @@ HbarAllowance spawnHbarAllowance() { @Test void shouldSerialize() { SnapshotMatcher.expect( - spawnHbarAllowance().toString(), - spawnTokenAllowance().toString(), - spawnNftAllowance().toString(), - spawnAllNftAllowance().toString() - ).toMatchSnapshot(); + spawnHbarAllowance().toString(), + spawnTokenAllowance().toString(), + spawnNftAllowance().toString(), + spawnAllNftAllowance().toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java b/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java index dcf1414973..62238f1a3e 100644 --- a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java @@ -1,34 +1,28 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AssessedCustomFee; -import com.hiero.sdk.TokenId; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.util.List; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; - public class AssessedCustomFeeTest { private static final int amount = 1; private static final TokenId tokenId = new TokenId(2, 3, 4); private static final AccountId feeCollector = new AccountId(5, 6, 7); - private static final List payerAccountIds = List.of( - new AccountId(8, 9, 10), - new AccountId(11, 12, 13), - new AccountId(14, 15, 16) - ); + private static final List payerAccountIds = + List.of(new AccountId(8, 9, 10), new AccountId(11, 12, 13), new AccountId(14, 15, 16)); - private final com.hiero.sdk.proto.AssessedCustomFee fee = - com.hiero.sdk.proto.AssessedCustomFee.newBuilder() + private final com.hiero.sdk.proto.AssessedCustomFee fee = com.hiero.sdk.proto.AssessedCustomFee.newBuilder() .setAmount(amount) .setTokenId(tokenId.toProtobuf()) .setFeeCollectorAccountId(feeCollector.toProtobuf()) - .addAllEffectivePayerAccountId(payerAccountIds.stream().map(AccountId::toProtobuf).toList()) + .addAllEffectivePayerAccountId( + payerAccountIds.stream().map(AccountId::toProtobuf).toList()) .build(); @BeforeAll @@ -43,15 +37,10 @@ public static void afterAll() { AssessedCustomFee spawnAssessedCustomFeeExample() { return new AssessedCustomFee( - 201, - TokenId.fromString("1.2.3"), - AccountId.fromString("4.5.6"), - List.of( - AccountId.fromString("0.0.1"), - AccountId.fromString("0.0.2"), - AccountId.fromString("0.0.3") - ) - ); + 201, + TokenId.fromString("1.2.3"), + AccountId.fromString("4.5.6"), + List.of(AccountId.fromString("0.0.1"), AccountId.fromString("0.0.2"), AccountId.fromString("0.0.3"))); } @Test @@ -60,8 +49,9 @@ void shouldSerialize() throws Exception { byte[] assessedCustomFeeBytes = originalAssessedCustomFee.toBytes(); var copyAssessedCustomFee = AssessedCustomFee.fromBytes(assessedCustomFeeBytes); assertThat(originalAssessedCustomFee.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(copyAssessedCustomFee.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalAssessedCustomFee.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(copyAssessedCustomFee.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalAssessedCustomFee.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test @@ -71,7 +61,8 @@ void fromProtobuf() { @Test void toProtobuf() { - SnapshotMatcher.expect(AssessedCustomFee.fromProtobuf(fee).toProtobuf().toString()).toMatchSnapshot(); + SnapshotMatcher.expect(AssessedCustomFee.fromProtobuf(fee).toProtobuf().toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java b/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java index 95c015350e..794436bc56 100644 --- a/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java +++ b/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java @@ -1,33 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.BaseNodeAddress; -import org.junit.jupiter.api.Test; - import static com.hiero.sdk.BaseNodeAddress.PORT_MIRROR_TLS; import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_TLS; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.Test; + public class BaseNodeAddressTest { @Test void fromString() { @@ -97,7 +78,9 @@ void fromString() { assertThat(mirrorNodeAddressSecure.getPort()).isEqualTo(PORT_MIRROR_TLS); assertThat(mirrorNodeAddressSecure).hasToString("mainnet-public.mirrornode.hedera.com:443"); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> BaseNodeAddress.fromString("this is a random string with spaces:443")); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> BaseNodeAddress.fromString("mainnet-public.mirrornode.hedera.com:notarealport")); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> BaseNodeAddress.fromString("this is a random string with spaces:443")); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> BaseNodeAddress.fromString("mainnet-public.mirrornode.hedera.com:notarealport")); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java b/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java index f4f99c4497..ba5bbcd1ec 100644 --- a/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -10,10 +11,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.MirrorNetwork; -import com.hiero.sdk.Network; import java.time.Duration; import java.util.Collections; import java.util.HashMap; @@ -55,7 +52,9 @@ void closeHandlesNetworkTimeout() { var mirrorNetwork = MirrorNetwork.forNetwork(executor, Collections.emptyList()); var client = new Client(executor, network, mirrorNetwork, null, true, null); - assertThatExceptionOfType(TimeoutException.class).isThrownBy(client::close).withMessage("network timeout"); + assertThatExceptionOfType(TimeoutException.class) + .isThrownBy(client::close) + .withMessage("network timeout"); assertThat(mirrorNetwork.hasShutDownNow).isTrue(); } @@ -68,7 +67,9 @@ void closeHandlesNetworkInterrupted() { var mirrorNetwork = MirrorNetwork.forNetwork(executor, Collections.emptyList()); var client = new Client(executor, network, mirrorNetwork, null, true, null); - assertThatExceptionOfType(RuntimeException.class).isThrownBy(client::close).withCause(interruptedException); + assertThatExceptionOfType(RuntimeException.class) + .isThrownBy(client::close) + .withCause(interruptedException); assertThat(mirrorNetwork.hasShutDownNow).isTrue(); } @@ -80,7 +81,9 @@ void closeHandlesMirrorNetworkTimeout() { when(mirrorNetwork.awaitClose(any(), any())).thenReturn(new TimeoutException("mirror timeout")); var client = new Client(executor, network, mirrorNetwork, null, true, null); - assertThatExceptionOfType(TimeoutException.class).isThrownBy(client::close).withMessage("mirror timeout"); + assertThatExceptionOfType(TimeoutException.class) + .isThrownBy(client::close) + .withMessage("mirror timeout"); assertThat(network.hasShutDownNow).isFalse(); } @@ -93,7 +96,9 @@ void closeHandlesMirrorNetworkInterrupted() { when(mirrorNetwork.awaitClose(any(), any())).thenReturn(interruptedException); var client = new Client(executor, network, mirrorNetwork, null, true, null); - assertThatExceptionOfType(RuntimeException.class).isThrownBy(client::close).withCause(interruptedException); + assertThatExceptionOfType(RuntimeException.class) + .isThrownBy(client::close) + .withCause(interruptedException); assertThat(network.hasShutDownNow).isFalse(); } @@ -156,7 +161,7 @@ void noHealthyNodesNetwork() { var network = Network.forNetwork(executor, Collections.emptyMap()); assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(network::getRandomNode) - .withMessage("No healthy node was found"); + .isThrownBy(network::getRandomNode) + .withMessage("No healthy node was found"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ClientTest.java b/sdk/src/test/java/com/hiero/sdk/ClientTest.java index fe244afd03..9b47dcbb49 100644 --- a/sdk/src/test/java/com/hiero/sdk/ClientTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ClientTest.java @@ -1,43 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.NodeAddress; -import com.hiero.sdk.NodeAddressBook; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; -import org.junit.jupiter.params.provider.NullSource; -import org.junit.jupiter.params.provider.ValueSource; +import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.google.protobuf.ByteString; -import javax.annotation.Nullable; import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; @@ -48,13 +17,18 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.function.Function; - -import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import javax.annotation.Nullable; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.NullSource; +import org.junit.jupiter.params.provider.ValueSource; class ClientTest { @@ -67,9 +41,13 @@ void forMainnet() throws TimeoutException { @Test @DisplayName("Can construct mainnet client with executor") void forMainnetWithExecutor() throws TimeoutException { - var executor = new ThreadPoolExecutor(2, 2, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(), new ThreadPoolExecutor.CallerRunsPolicy()); + var executor = new ThreadPoolExecutor( + 2, + 2, + 0L, + TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<>(), + new ThreadPoolExecutor.CallerRunsPolicy()); Client.forMainnet(executor).close(); } @@ -77,9 +55,13 @@ void forMainnetWithExecutor() throws TimeoutException { @Test @DisplayName("Can construct testnet client with executor") void forTestnetWithExecutor() throws TimeoutException { - var executor = new ThreadPoolExecutor(2, 2, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(), new ThreadPoolExecutor.CallerRunsPolicy()); + var executor = new ThreadPoolExecutor( + 2, + 2, + 0L, + TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<>(), + new ThreadPoolExecutor.CallerRunsPolicy()); Client.forTestnet(executor).close(); } @@ -87,9 +69,13 @@ void forTestnetWithExecutor() throws TimeoutException { @Test @DisplayName("Can construct previewnet client with executor") void forPreviewnetWithWithExecutor() throws TimeoutException { - var executor = new ThreadPoolExecutor(2, 2, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(), new ThreadPoolExecutor.CallerRunsPolicy()); + var executor = new ThreadPoolExecutor( + 2, + 2, + 0L, + TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<>(), + new ThreadPoolExecutor.CallerRunsPolicy()); Client.forPreviewnet(executor).close(); } @@ -165,35 +151,37 @@ void setMaxTransactionFeeNegative() throws TimeoutException { @Test @DisplayName("fromJsonFile() functions correctly") void fromJsonFile() throws Exception { - Client.fromConfigFile(new File("./src/test/resources/client-config.json")).close(); - Client.fromConfigFile(new File("./src/test/resources/client-config-with-operator.json")).close(); + Client.fromConfigFile(new File("./src/test/resources/client-config.json")) + .close(); + Client.fromConfigFile(new File("./src/test/resources/client-config-with-operator.json")) + .close(); Client.fromConfigFile("./src/test/resources/client-config.json").close(); - Client.fromConfigFile("./src/test/resources/client-config-with-operator.json").close(); + Client.fromConfigFile("./src/test/resources/client-config-with-operator.json") + .close(); } @Test @DisplayName("fromJson() functions correctly") void testFromJson() throws Exception { // Copied content of `client-config-with-operator.json` - var client = Client.fromConfig("{\n" + - " \"network\":\"mainnet\",\n" + - " \"operator\": {\n" + - " \"accountId\": \"0.0.36\",\n" + - " \"privateKey\": \"302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10\"\n" + - " }\n" + - "}\n"); + var client = Client.fromConfig("{\n" + " \"network\":\"mainnet\",\n" + + " \"operator\": {\n" + + " \"accountId\": \"0.0.36\",\n" + + " \"privateKey\": \"302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10\"\n" + + " }\n" + + "}\n"); // put it in a file for nicer formatting - InputStream clientConfig = ClientTest.class.getClassLoader() - .getResourceAsStream("client-config.json"); + InputStream clientConfig = ClientTest.class.getClassLoader().getResourceAsStream("client-config.json"); assertThat(clientConfig).isNotNull(); - Client.fromConfig(new InputStreamReader(clientConfig, StandardCharsets.UTF_8)).close(); + Client.fromConfig(new InputStreamReader(clientConfig, StandardCharsets.UTF_8)) + .close(); // put it in a file for nicer formatting - InputStream clientConfigWithOperator = ClientTest.class.getClassLoader() - .getResourceAsStream("client-config-with-operator.json"); + InputStream clientConfigWithOperator = + ClientTest.class.getClassLoader().getResourceAsStream("client-config-with-operator.json"); assertThat(clientConfigWithOperator).isNotNull(); @@ -205,8 +193,7 @@ void testFromJson() throws Exception { void setNetworkWorks() throws Exception { var defaultNetwork = Map.of( "0.testnet.hedera.com:50211", new AccountId(3), - "1.testnet.hedera.com:50211", new AccountId(4) - ); + "1.testnet.hedera.com:50211", new AccountId(4)); Client client = Client.forNetwork(defaultNetwork); assertThat(client.getNetwork()).containsExactlyInAnyOrderEntriesOf(defaultNetwork); @@ -217,22 +204,17 @@ void setNetworkWorks() throws Exception { var defaultNetworkWithExtraNode = Map.of( "0.testnet.hedera.com:50211", new AccountId(3), "1.testnet.hedera.com:50211", new AccountId(4), - "2.testnet.hedera.com:50211", new AccountId(5) - ); + "2.testnet.hedera.com:50211", new AccountId(5)); client.setNetwork(defaultNetworkWithExtraNode); assertThat(client.getNetwork()).containsExactlyInAnyOrderEntriesOf(defaultNetworkWithExtraNode); - var singleNodeNetwork = Map.of( - "2.testnet.hedera.com:50211", new AccountId(5) - ); + var singleNodeNetwork = Map.of("2.testnet.hedera.com:50211", new AccountId(5)); client.setNetwork(singleNodeNetwork); assertThat(client.getNetwork()).containsExactlyInAnyOrderEntriesOf(singleNodeNetwork); - var singleNodeNetworkWithDifferentAccountId = Map.of( - "2.testnet.hedera.com:50211", new AccountId(6) - ); + var singleNodeNetworkWithDifferentAccountId = Map.of("2.testnet.hedera.com:50211", new AccountId(6)); client.setNetwork(singleNodeNetworkWithDifferentAccountId); assertThat(client.getNetwork()).containsExactlyInAnyOrderEntriesOf(singleNodeNetworkWithDifferentAccountId); @@ -242,12 +224,10 @@ void setNetworkWorks() throws Exception { "34.94.106.61:50211", new AccountId(3), "50.18.132.211:50211", new AccountId(3), "138.91.142.219:50211", new AccountId(3), - "1.testnet.hedera.com:50211", new AccountId(4), "35.237.119.55:50211", new AccountId(4), "3.212.6.13:50211", new AccountId(4), - "52.168.76.241:50211", new AccountId(4) - ); + "52.168.76.241:50211", new AccountId(4)); client.setNetwork(multiAddressNetwork); assertThat(client.getNetwork()).containsExactlyInAnyOrderEntriesOf(multiAddressNetwork); @@ -266,10 +246,8 @@ void setMirrorNetworkWorks() throws Exception { client.setMirrorNetwork(defaultNetwork); assertThat(client.getMirrorNetwork()).containsExactlyInAnyOrderElementsOf(defaultNetwork); - var defaultNetworkWithExtraNode = List.of( - "testnet.mirrornode.hedera.com:443", - "testnet1.mirrornode.hedera.com:443" - ); + var defaultNetworkWithExtraNode = + List.of("testnet.mirrornode.hedera.com:443", "testnet1.mirrornode.hedera.com:443"); client.setMirrorNetwork(defaultNetworkWithExtraNode); assertThat(client.getMirrorNetwork()).containsExactlyInAnyOrderElementsOf(defaultNetworkWithExtraNode); @@ -290,10 +268,7 @@ void setMirrorNetworkWorks() throws Exception { @Test @DisplayName("setMirrorNetwork() throws exception if there is no time to remove the old nodes") void setMirrorNetworkFails() throws Exception { - var defaultNetwork = List.of( - "testnet.mirrornode.hedera.com:443", - "testnet.mirrornode2.hedera.com:443" - ); + var defaultNetwork = List.of("testnet.mirrornode.hedera.com:443", "testnet.mirrornode2.hedera.com:443"); Client client = Client.forNetwork(new HashMap<>()).setMirrorNetwork(defaultNetwork); assertThat(client.getMirrorNetwork()).containsExactlyInAnyOrderElementsOf(defaultNetwork); @@ -302,7 +277,7 @@ void setMirrorNetworkFails() throws Exception { final List updatedNetwork = List.of("testnet.mirrornode.hedera.com:443"); assertThatThrownBy(() -> client.setMirrorNetwork(updatedNetwork)) - .hasMessageEndingWith("Failed to properly shutdown all channels"); + .hasMessageEndingWith("Failed to properly shutdown all channels"); } @Test @@ -318,26 +293,22 @@ void forNameReturnsCorrectNetwork() { assertThat(previewnetClient.getLedgerId()).isEqualTo(LedgerId.PREVIEWNET); assertThatThrownBy(() -> Client.forName("unknown")) - .hasMessageEndingWith("Name must be one-of `mainnet`, `testnet`, or `previewnet`"); + .hasMessageEndingWith("Name must be one-of `mainnet`, `testnet`, or `previewnet`"); } - @ParameterizedTest - @CsvSource({ - "onClient", - "onQuery" - }) + @ParameterizedTest + @CsvSource({"onClient", "onQuery"}) void testExecuteAsyncTimeout(String timeoutSite) throws Exception { AccountId accountId = AccountId.fromString("0.0.1"); Duration timeout = Duration.ofSeconds(5); Client client = Client.forNetwork(Map.of("1.1.1.1:50211", accountId)) - .setNodeMinBackoff(Duration.ofMillis(0)) - .setNodeMaxBackoff(Duration.ofMillis(0)) - .setMinNodeReadmitTime(Duration.ofMillis(0)) - .setMaxNodeReadmitTime(Duration.ofMillis(0)); - AccountBalanceQuery query = new AccountBalanceQuery() - .setAccountId(accountId) - .setMaxAttempts(3); + .setNodeMinBackoff(Duration.ofMillis(0)) + .setNodeMaxBackoff(Duration.ofMillis(0)) + .setMinNodeReadmitTime(Duration.ofMillis(0)) + .setMaxNodeReadmitTime(Duration.ofMillis(0)); + AccountBalanceQuery query = + new AccountBalanceQuery().setAccountId(accountId).setMaxAttempts(3); Instant start = Instant.now(); try { @@ -359,10 +330,7 @@ void testExecuteAsyncTimeout(String timeoutSite) throws Exception { } @ParameterizedTest - @CsvSource({ - "onClient", - "onQuery" - }) + @CsvSource({"onClient", "onQuery"}) void testExecuteSyncTimeout(String timeoutSite) throws Exception { AccountId accountId = AccountId.fromString("0.0.1"); // Executing requests in sync mode will require at most 10 seconds to connect @@ -375,15 +343,15 @@ void testExecuteSyncTimeout(String timeoutSite) throws Exception { Duration timeout = Duration.ofSeconds(5); Client client = Client.forNetwork(Map.of("1.1.1.1:50211", accountId)) - .setNodeMinBackoff(Duration.ofMillis(0)) - .setNodeMaxBackoff(Duration.ofMillis(0)) - .setMinNodeReadmitTime(Duration.ofMillis(0)) - .setMaxNodeReadmitTime(Duration.ofMillis(0)); + .setNodeMinBackoff(Duration.ofMillis(0)) + .setNodeMaxBackoff(Duration.ofMillis(0)) + .setMinNodeReadmitTime(Duration.ofMillis(0)) + .setMaxNodeReadmitTime(Duration.ofMillis(0)); AccountBalanceQuery query = new AccountBalanceQuery() - .setAccountId(accountId) - .setMaxAttempts(3) - .setGrpcDeadline(Duration.ofSeconds(5)); + .setAccountId(accountId) + .setMaxAttempts(3) + .setGrpcDeadline(Duration.ofSeconds(5)); Instant start = Instant.now(); try { @@ -406,14 +374,14 @@ void testExecuteSyncTimeout(String timeoutSite) throws Exception { com.hiero.sdk.proto.NodeAddress nodeAddress(long accountNum, String rsaPubKeyHex, byte[] certHash, byte[] ipv4) { com.hiero.sdk.proto.NodeAddress.Builder builder = com.hiero.sdk.proto.NodeAddress.newBuilder() - .setNodeAccountId(com.hiero.sdk.proto.AccountID.newBuilder() - .setAccountNum(accountNum) - .build()) - .addServiceEndpoint(com.hiero.sdk.proto.ServiceEndpoint.newBuilder() - .setIpAddressV4(ByteString.copyFrom(ipv4)) - .setPort(PORT_NODE_PLAIN) - .build()) - .setRSAPubKey(rsaPubKeyHex); + .setNodeAccountId(com.hiero.sdk.proto.AccountID.newBuilder() + .setAccountNum(accountNum) + .build()) + .addServiceEndpoint(com.hiero.sdk.proto.ServiceEndpoint.newBuilder() + .setIpAddressV4(ByteString.copyFrom(ipv4)) + .setPort(PORT_NODE_PLAIN) + .build()) + .setRSAPubKey(rsaPubKeyHex); if (certHash != null) { builder.setNodeCertHash(ByteString.copyFrom(certHash)); } @@ -424,42 +392,46 @@ com.hiero.sdk.proto.NodeAddress nodeAddress(long accountNum, String rsaPubKeyHex @DisplayName("setNetworkFromAddressBook() updates security parameters in the client") void setNetworkFromAddressBook() throws Exception { try (Client client = Client.forNetwork(Map.of())) { - Function nodeAddress = accountNum -> client.network.network.get(new AccountId(accountNum)).get(0).getAddressBookEntry(); + Function nodeAddress = accountNum -> + client.network.network.get(new AccountId(accountNum)).get(0).getAddressBookEntry(); // reconfigure client network from addressbook (add new nodes) client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() - .addNodeAddress(nodeAddress(10001, "10001", new byte[] {1, 0, 1}, new byte[] {10, 0, 0, 1})) - .addNodeAddress(nodeAddress(10002, "10002", new byte[] {1, 0, 2}, new byte[] {10, 0, 0, 2})) - .build().toByteString())); + .addNodeAddress(nodeAddress(10001, "10001", new byte[] {1, 0, 1}, new byte[] {10, 0, 0, 1})) + .addNodeAddress(nodeAddress(10002, "10002", new byte[] {1, 0, 2}, new byte[] {10, 0, 0, 2})) + .build() + .toByteString())); // verify security parameters in client - assertThat(nodeAddress.apply(10001).certHash).isEqualTo(ByteString.copyFrom(new byte[]{1, 0, 1})); + assertThat(nodeAddress.apply(10001).certHash).isEqualTo(ByteString.copyFrom(new byte[] {1, 0, 1})); assertThat(nodeAddress.apply(10001).publicKey).isEqualTo("10001"); - assertThat(nodeAddress.apply(10002).certHash).isEqualTo(ByteString.copyFrom(new byte[]{1, 0, 2})); + assertThat(nodeAddress.apply(10002).certHash).isEqualTo(ByteString.copyFrom(new byte[] {1, 0, 2})); assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("10002"); // reconfigure client network from addressbook without `certHash` client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() - .addNodeAddress(nodeAddress(10001, "10001", null, new byte[] {10, 0, 0, 1})) - .addNodeAddress(nodeAddress(10002, "10002", null, new byte[] {10, 0, 0, 2})) - .build().toByteString())); + .addNodeAddress(nodeAddress(10001, "10001", null, new byte[] {10, 0, 0, 1})) + .addNodeAddress(nodeAddress(10002, "10002", null, new byte[] {10, 0, 0, 2})) + .build() + .toByteString())); // verify security parameters in client (unchanged) - assertThat(nodeAddress.apply(10001).certHash).isEqualTo(ByteString.copyFrom(new byte[]{1, 0, 1})); + assertThat(nodeAddress.apply(10001).certHash).isEqualTo(ByteString.copyFrom(new byte[] {1, 0, 1})); assertThat(nodeAddress.apply(10001).publicKey).isEqualTo("10001"); - assertThat(nodeAddress.apply(10002).certHash).isEqualTo(ByteString.copyFrom(new byte[]{1, 0, 2})); + assertThat(nodeAddress.apply(10002).certHash).isEqualTo(ByteString.copyFrom(new byte[] {1, 0, 2})); assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("10002"); // reconfigure client network from addressbook (update existing nodes) client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() - .addNodeAddress(nodeAddress(10001, "810001", new byte[] {8, 1, 0, 1}, new byte[] {10, 0, 0, 1})) - .addNodeAddress(nodeAddress(10002, "810002", new byte[] {8, 1, 0, 2}, new byte[] {10, 0, 0, 2})) - .build().toByteString())); + .addNodeAddress(nodeAddress(10001, "810001", new byte[] {8, 1, 0, 1}, new byte[] {10, 0, 0, 1})) + .addNodeAddress(nodeAddress(10002, "810002", new byte[] {8, 1, 0, 2}, new byte[] {10, 0, 0, 2})) + .build() + .toByteString())); // verify security parameters in client - assertThat(nodeAddress.apply(10001).certHash).isEqualTo(ByteString.copyFrom(new byte[]{8, 1, 0, 1})); + assertThat(nodeAddress.apply(10001).certHash).isEqualTo(ByteString.copyFrom(new byte[] {8, 1, 0, 1})); assertThat(nodeAddress.apply(10001).publicKey).isEqualTo("810001"); - assertThat(nodeAddress.apply(10002).certHash).isEqualTo(ByteString.copyFrom(new byte[]{8, 1, 0, 2})); + assertThat(nodeAddress.apply(10002).certHash).isEqualTo(ByteString.copyFrom(new byte[] {8, 1, 0, 2})); assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("810002"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java b/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java index ccf609808d..ba20a7659d 100644 --- a/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java @@ -1,18 +1,17 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.ConsumerHelper; -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; -import java.util.function.BiConsumer; -import java.util.function.Consumer; - import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import java.util.concurrent.CompletableFuture; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import org.junit.jupiter.api.Test; + class ConsumerHelperTest { @Test void biConsumer() { @@ -37,6 +36,7 @@ void twoConsumersWithoutError() { verify(onSuccess, times(1)).accept(value); verify(onFailure, times(0)).accept(any()); } + @Test void twoConsumersWithError() { var exception = new RuntimeException("Exception"); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java index b9dc86042d..c57de2e479 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java @@ -1,26 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.ContractByteCodeQuery; -import com.hiero.sdk.ContractId; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -42,8 +22,9 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractByteCodeQuery() - .setContractId(ContractId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setContractId(ContractId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java index e957dececc..ff58562d9f 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java @@ -1,40 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractCallQuery; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.PrivateKey; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - public class ContractCallQueryTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -52,31 +28,31 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractCallQuery() - .setContractId(ContractId.fromString("0.0.5005")) - .setGas(1541) - .setSenderAccountId(AccountId.fromString("1.2.3")) - .setFunction("foo", - new ContractFunctionParameters() - .addString("Hello") - .addString("world!")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setContractId(ContractId.fromString("0.0.5005")) + .setGas(1541) + .setSenderAccountId(AccountId.fromString("1.2.3")) + .setFunction( + "foo", + new ContractFunctionParameters().addString("Hello").addString("world!")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test void setFunctionParameters() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractCallQuery() - .setContractId(ContractId.fromString("0.0.5005")) - .setGas(1541) - .setSenderAccountId(AccountId.fromString("1.2.3")) - .setFunctionParameters( - new ContractFunctionParameters() - .addString("Hello") - .addString("world!") - .toBytes(null) - .toByteArray()) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setContractId(ContractId.fromString("0.0.5005")) + .setGas(1541) + .setSenderAccountId(AccountId.fromString("1.2.3")) + .setFunctionParameters(new ContractFunctionParameters() + .addString("Hello") + .addString("world!") + .toBytes(null) + .toByteArray()) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java index ee6d187e09..043445ad48 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java @@ -1,48 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.ContractCreateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Duration; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class ContractCreateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -58,16 +32,12 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test void shouldSerialize2() { - SnapshotMatcher.expect(spawnTestTransaction2() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction2().toString()).toMatchSnapshot(); } @Test @@ -79,38 +49,38 @@ void shouldBytesNoSetters() throws Exception { private ContractCreateTransaction spawnTestTransaction() { return new ContractCreateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setBytecodeFileId(FileId.fromString("0.0.3003")) - .setAdminKey(unusedPrivateKey) - .setGas(0) - .setInitialBalance(Hbar.fromTinybars(1000)) - .setStakedAccountId(AccountId.fromString("0.0.3")) - .setMaxAutomaticTokenAssociations(101) - .setAutoRenewPeriod(Duration.ofHours(10)) - .setConstructorParameters(new byte[]{10, 11, 12, 13, 25}) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setAutoRenewAccountId(new AccountId(30)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setBytecodeFileId(FileId.fromString("0.0.3003")) + .setAdminKey(unusedPrivateKey) + .setGas(0) + .setInitialBalance(Hbar.fromTinybars(1000)) + .setStakedAccountId(AccountId.fromString("0.0.3")) + .setMaxAutomaticTokenAssociations(101) + .setAutoRenewPeriod(Duration.ofHours(10)) + .setConstructorParameters(new byte[] {10, 11, 12, 13, 25}) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setAutoRenewAccountId(new AccountId(30)) + .freeze() + .sign(unusedPrivateKey); } private ContractCreateTransaction spawnTestTransaction2() { return new ContractCreateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setBytecode(Hex.decode("deadbeef")) - .setAdminKey(unusedPrivateKey) - .setGas(0) - .setInitialBalance(Hbar.fromTinybars(1000)) - .setStakedNodeId(4L) - .setMaxAutomaticTokenAssociations(101) - .setAutoRenewPeriod(Duration.ofHours(10)) - .setConstructorParameters(new byte[]{10, 11, 12, 13, 25}) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setAutoRenewAccountId(new AccountId(30)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setBytecode(Hex.decode("deadbeef")) + .setAdminKey(unusedPrivateKey) + .setGas(0) + .setInitialBalance(Hbar.fromTinybars(1000)) + .setStakedNodeId(4L) + .setMaxAutomaticTokenAssociations(101) + .setAutoRenewPeriod(Duration.ofHours(10)) + .setConstructorParameters(new byte[] {10, 11, 12, 13, 25}) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setAutoRenewAccountId(new AccountId(30)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -130,8 +100,9 @@ void shouldBytes2() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setContractCreateInstance(ContractCreateTransactionBody.newBuilder().build()) - .build(); + .setContractCreateInstance( + ContractCreateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java index 0f56d68546..bec57e66e6 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.ContractDeleteTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class ContractDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,21 +30,19 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private ContractDeleteTransaction spawnTestTransaction() { return new ContractDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContractId(ContractId.fromString("0.0.5007")) - .setTransferAccountId(new AccountId(9)) - .setTransferContractId(ContractId.fromString("0.0.5008")) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContractId(ContractId.fromString("0.0.5007")) + .setTransferAccountId(new AccountId(9)) + .setTransferContractId(ContractId.fromString("0.0.5008")) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -90,8 +62,9 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setContractDeleteInstance(ContractDeleteTransactionBody.newBuilder().build()) - .build(); + .setContractDeleteInstance( + ContractDeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java index 60f3bfea6d..41186f7841 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java @@ -1,47 +1,21 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractExecuteTransaction; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.ContractCallTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class ContractExecuteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -57,9 +31,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -71,15 +43,15 @@ void shouldBytesNoSetters() throws Exception { private ContractExecuteTransaction spawnTestTransaction() { return new ContractExecuteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContractId(ContractId.fromString("0.0.5007")) - .setGas(10) - .setPayableAmount(Hbar.fromTinybars(1000)) - .setFunctionParameters(ByteString.copyFrom(new byte[]{24, 43, 11})) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContractId(ContractId.fromString("0.0.5007")) + .setGas(10) + .setPayableAmount(Hbar.fromTinybars(1000)) + .setFunctionParameters(ByteString.copyFrom(new byte[] {24, 43, 11})) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -92,8 +64,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setContractCall(ContractCallTransactionBody.newBuilder().build()) - .build(); + .setContractCall(ContractCallTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java b/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java index 059d64ac2d..581c5633de 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java @@ -1,28 +1,17 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.google.protobuf.ByteString; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractFunctionSelector; import io.github.jsonSnapshot.SnapshotMatcher; +import java.lang.reflect.Array; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -33,16 +22,6 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.lang.reflect.Array; -import java.math.BigInteger; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Supplier; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class ContractFunctionParametersTest { @BeforeAll public static void beforeAll() { @@ -57,139 +36,132 @@ public static void afterAll() { @SuppressWarnings("unused") private static List int256Arguments() { return List.of( - Arguments.of(0, "0000000000000000000000000000000000000000000000000000000000000000"), - Arguments.of(2, "0000000000000000000000000000000000000000000000000000000000000002"), - Arguments.of(255, "00000000000000000000000000000000000000000000000000000000000000ff"), - Arguments.of(4095, "0000000000000000000000000000000000000000000000000000000000000fff"), - Arguments.of(127 << 24, "000000000000000000000000000000000000000000000000000000007f000000"), - Arguments.of(2047 << 20, "000000000000000000000000000000000000000000000000000000007ff00000"), - // deadbeef as an integer literal is negative - Arguments.of(0xdeadbeefL, "00000000000000000000000000000000000000000000000000000000deadbeef"), - Arguments.of(-1, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - Arguments.of(-2, "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"), - Arguments.of(-256, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00"), - Arguments.of(-4096, "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000"), - Arguments.of(255 << 24, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000"), - Arguments.of(4095 << 20, "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000"), - Arguments.of(0xdeadbeef, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeef") - ); + Arguments.of(0, "0000000000000000000000000000000000000000000000000000000000000000"), + Arguments.of(2, "0000000000000000000000000000000000000000000000000000000000000002"), + Arguments.of(255, "00000000000000000000000000000000000000000000000000000000000000ff"), + Arguments.of(4095, "0000000000000000000000000000000000000000000000000000000000000fff"), + Arguments.of(127 << 24, "000000000000000000000000000000000000000000000000000000007f000000"), + Arguments.of(2047 << 20, "000000000000000000000000000000000000000000000000000000007ff00000"), + // deadbeef as an integer literal is negative + Arguments.of(0xdeadbeefL, "00000000000000000000000000000000000000000000000000000000deadbeef"), + Arguments.of(-1, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), + Arguments.of(-2, "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"), + Arguments.of(-256, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00"), + Arguments.of(-4096, "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000"), + Arguments.of(255 << 24, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000"), + Arguments.of(4095 << 20, "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000"), + Arguments.of(0xdeadbeef, "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeef")); } @SuppressWarnings("unused") private static List uInt256Arguments() { return List.of( - Arguments.of(0, "0000000000000000000000000000000000000000000000000000000000000000", 8), - Arguments.of(2, "0000000000000000000000000000000000000000000000000000000000000002", 8), - Arguments.of(255, "00000000000000000000000000000000000000000000000000000000000000ff", 8), - Arguments.of(4095, "0000000000000000000000000000000000000000000000000000000000000fff", 32), - Arguments.of(127 << 24, "000000000000000000000000000000000000000000000000000000007f000000", 32), - Arguments.of(2047 << 20, "000000000000000000000000000000000000000000000000000000007ff00000", 32), - // deadbeef as an integer literal is negative - Arguments.of(0xdeadbeef, "00000000000000000000000000000000000000000000000000000000deadbeef", 32), - Arguments.of(-1, "000000000000000000000000000000000000000000000000ffffffffffffffff", 64), - Arguments.of(-2, "000000000000000000000000000000000000000000000000fffffffffffffffe", 64), - Arguments.of(-256, "000000000000000000000000000000000000000000000000ffffffffffffff00", 64), - Arguments.of(-4096, "000000000000000000000000000000000000000000000000fffffffffffff000", 64), - Arguments.of(255 << 24, "000000000000000000000000000000000000000000000000ffffffffff000000", 64), - Arguments.of(4095 << 20, "000000000000000000000000000000000000000000000000fffffffffff00000", 64), - Arguments.of(0xdeadbeefL, "00000000000000000000000000000000000000000000000000000000deadbeef", 64) - ); + Arguments.of(0, "0000000000000000000000000000000000000000000000000000000000000000", 8), + Arguments.of(2, "0000000000000000000000000000000000000000000000000000000000000002", 8), + Arguments.of(255, "00000000000000000000000000000000000000000000000000000000000000ff", 8), + Arguments.of(4095, "0000000000000000000000000000000000000000000000000000000000000fff", 32), + Arguments.of(127 << 24, "000000000000000000000000000000000000000000000000000000007f000000", 32), + Arguments.of(2047 << 20, "000000000000000000000000000000000000000000000000000000007ff00000", 32), + // deadbeef as an integer literal is negative + Arguments.of(0xdeadbeef, "00000000000000000000000000000000000000000000000000000000deadbeef", 32), + Arguments.of(-1, "000000000000000000000000000000000000000000000000ffffffffffffffff", 64), + Arguments.of(-2, "000000000000000000000000000000000000000000000000fffffffffffffffe", 64), + Arguments.of(-256, "000000000000000000000000000000000000000000000000ffffffffffffff00", 64), + Arguments.of(-4096, "000000000000000000000000000000000000000000000000fffffffffffff000", 64), + Arguments.of(255 << 24, "000000000000000000000000000000000000000000000000ffffffffff000000", 64), + Arguments.of(4095 << 20, "000000000000000000000000000000000000000000000000fffffffffff00000", 64), + Arguments.of(0xdeadbeefL, "00000000000000000000000000000000000000000000000000000000deadbeef", 64)); } @Test @DisplayName("encodes int types correctly") void intTypes() { ContractFunctionParameters params = new ContractFunctionParameters() - .addUint8((byte) 0x1) - .addInt8((byte) -0x2) - .addUint32(0x3) - .addInt32(-0x4) - .addUint64(0x4) - .addInt64(-0x5) - .addUint256(BigInteger.valueOf(0x6)) - .addInt256(BigInteger.valueOf(-0x7)) - .addUint8Array(new byte[]{(byte) 0x1, (byte) 0x2, (byte) 0x3, (byte) 0x4}) - .addInt8Array(new byte[]{(byte) -0x5, (byte) 0x6, (byte) 0x7, (byte) -0x8}) - .addUint32Array(new int[]{0x9, 0xA, 0xB, 0xC}) - .addInt32Array(new int[]{-0xD, 0xE, 0xF, -0x10}) - .addUint64Array(new long[]{0x11, 0x12, 0x13, 0x14}) - .addInt64Array(new long[]{-0x15, 0x16, 0x17, -0x18}) - .addUint256Array(new BigInteger[]{BigInteger.valueOf(0x19)}) - .addInt256Array(new BigInteger[]{BigInteger.valueOf(-0x1A)}); - - assertThat( - "11bcd903" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe" + - "0000000000000000000000000000000000000000000000000000000000000003" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb" + - "0000000000000000000000000000000000000000000000000000000000000006" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9" + - "0000000000000000000000000000000000000000000000000000000000000200" + - "00000000000000000000000000000000000000000000000000000000000002a0" + - "0000000000000000000000000000000000000000000000000000000000000340" + - "00000000000000000000000000000000000000000000000000000000000003e0" + - "0000000000000000000000000000000000000000000000000000000000000480" + - "0000000000000000000000000000000000000000000000000000000000000520" + - "00000000000000000000000000000000000000000000000000000000000005c0" + - "0000000000000000000000000000000000000000000000000000000000000600" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000003" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb" + - "0000000000000000000000000000000000000000000000000000000000000006" + - "0000000000000000000000000000000000000000000000000000000000000007" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "0000000000000000000000000000000000000000000000000000000000000009" + - "000000000000000000000000000000000000000000000000000000000000000a" + - "000000000000000000000000000000000000000000000000000000000000000b" + - "000000000000000000000000000000000000000000000000000000000000000c" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3" + - "000000000000000000000000000000000000000000000000000000000000000e" + - "000000000000000000000000000000000000000000000000000000000000000f" + - "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "0000000000000000000000000000000000000000000000000000000000000011" + - "0000000000000000000000000000000000000000000000000000000000000012" + - "0000000000000000000000000000000000000000000000000000000000000013" + - "0000000000000000000000000000000000000000000000000000000000000014" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeb" + - "0000000000000000000000000000000000000000000000000000000000000016" + - "0000000000000000000000000000000000000000000000000000000000000017" + - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "0000000000000000000000000000000000000000000000000000000000000019" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe6" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + .addUint8((byte) 0x1) + .addInt8((byte) -0x2) + .addUint32(0x3) + .addInt32(-0x4) + .addUint64(0x4) + .addInt64(-0x5) + .addUint256(BigInteger.valueOf(0x6)) + .addInt256(BigInteger.valueOf(-0x7)) + .addUint8Array(new byte[] {(byte) 0x1, (byte) 0x2, (byte) 0x3, (byte) 0x4}) + .addInt8Array(new byte[] {(byte) -0x5, (byte) 0x6, (byte) 0x7, (byte) -0x8}) + .addUint32Array(new int[] {0x9, 0xA, 0xB, 0xC}) + .addInt32Array(new int[] {-0xD, 0xE, 0xF, -0x10}) + .addUint64Array(new long[] {0x11, 0x12, 0x13, 0x14}) + .addInt64Array(new long[] {-0x15, 0x16, 0x17, -0x18}) + .addUint256Array(new BigInteger[] {BigInteger.valueOf(0x19)}) + .addInt256Array(new BigInteger[] {BigInteger.valueOf(-0x1A)}); + + assertThat("11bcd903" + "0000000000000000000000000000000000000000000000000000000000000001" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe" + + "0000000000000000000000000000000000000000000000000000000000000003" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb" + + "0000000000000000000000000000000000000000000000000000000000000006" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9" + + "0000000000000000000000000000000000000000000000000000000000000200" + + "00000000000000000000000000000000000000000000000000000000000002a0" + + "0000000000000000000000000000000000000000000000000000000000000340" + + "00000000000000000000000000000000000000000000000000000000000003e0" + + "0000000000000000000000000000000000000000000000000000000000000480" + + "0000000000000000000000000000000000000000000000000000000000000520" + + "00000000000000000000000000000000000000000000000000000000000005c0" + + "0000000000000000000000000000000000000000000000000000000000000600" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "0000000000000000000000000000000000000000000000000000000000000001" + + "0000000000000000000000000000000000000000000000000000000000000002" + + "0000000000000000000000000000000000000000000000000000000000000003" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb" + + "0000000000000000000000000000000000000000000000000000000000000006" + + "0000000000000000000000000000000000000000000000000000000000000007" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "0000000000000000000000000000000000000000000000000000000000000009" + + "000000000000000000000000000000000000000000000000000000000000000a" + + "000000000000000000000000000000000000000000000000000000000000000b" + + "000000000000000000000000000000000000000000000000000000000000000c" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3" + + "000000000000000000000000000000000000000000000000000000000000000e" + + "000000000000000000000000000000000000000000000000000000000000000f" + + "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "0000000000000000000000000000000000000000000000000000000000000011" + + "0000000000000000000000000000000000000000000000000000000000000012" + + "0000000000000000000000000000000000000000000000000000000000000013" + + "0000000000000000000000000000000000000000000000000000000000000014" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeb" + + "0000000000000000000000000000000000000000000000000000000000000016" + + "0000000000000000000000000000000000000000000000000000000000000017" + + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe8" + + "0000000000000000000000000000000000000000000000000000000000000001" + + "0000000000000000000000000000000000000000000000000000000000000019" + + "0000000000000000000000000000000000000000000000000000000000000001" + + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe6") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("uint256 chops off sign bit if length is 256 bits") void uint256BitLength() { var params = new ContractFunctionParameters() - .addUint256(BigInteger.valueOf(2).pow(255)); + .addUint256(BigInteger.valueOf(2).pow(255)); - assertThat( - "2fbebd38" + - "8000000000000000000000000000000000000000000000000000000000000000" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + assertThat("2fbebd38" + "8000000000000000000000000000000000000000000000000000000000000000") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("uint256 errors if less than 0") void uint256Errors() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - new ContractFunctionParameters() - .addUint256(BigInteger.valueOf(-0x1)); + new ContractFunctionParameters().addUint256(BigInteger.valueOf(-0x1)); }); /* @@ -204,27 +176,26 @@ void uint256Errors() { @DisplayName("encodes addresses correctly") void addresses() { var params = new ContractFunctionParameters() - .addAddress("1122334455667788990011223344556677889900") - .addAddress("0x1122334455667788990011223344556677889900") - .addAddressArray(new String[]{"1122334455667788990011223344556677889900", "1122334455667788990011223344556677889900"}); - - assertThat( - "7d48c86d" + - "0000000000000000000000001122334455667788990011223344556677889900" + - "0000000000000000000000001122334455667788990011223344556677889900" + - "0000000000000000000000000000000000000000000000000000000000000060" + - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000001122334455667788990011223344556677889900" + - "0000000000000000000000001122334455667788990011223344556677889900" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + .addAddress("1122334455667788990011223344556677889900") + .addAddress("0x1122334455667788990011223344556677889900") + .addAddressArray(new String[] { + "1122334455667788990011223344556677889900", "1122334455667788990011223344556677889900" + }); + + assertThat("7d48c86d" + "0000000000000000000000001122334455667788990011223344556677889900" + + "0000000000000000000000001122334455667788990011223344556677889900" + + "0000000000000000000000000000000000000000000000000000000000000060" + + "0000000000000000000000000000000000000000000000000000000000000002" + + "0000000000000000000000001122334455667788990011223344556677889900" + + "0000000000000000000000001122334455667788990011223344556677889900") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("encodes functions correctly") void addressesError() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - new ContractFunctionParameters() - .addAddress("112233445566778899001122334455667788990011"); + new ContractFunctionParameters().addAddress("112233445566778899001122334455667788990011"); }); } @@ -232,14 +203,14 @@ void addressesError() { @DisplayName("encodes functions correctly") void functions() { var params = new ContractFunctionParameters() - .addFunction("1122334455667788990011223344556677889900", new byte[]{1, 2, 3, 4}) - .addFunction("0x1122334455667788990011223344556677889900", new ContractFunctionSelector("randomFunction").addBool()); - - assertThat( - "c99c40cd" + - "1122334455667788990011223344556677889900010203040000000000000000" + - "112233445566778899001122334455667788990063441d820000000000000000" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + .addFunction("1122334455667788990011223344556677889900", new byte[] {1, 2, 3, 4}) + .addFunction( + "0x1122334455667788990011223344556677889900", + new ContractFunctionSelector("randomFunction").addBool()); + + assertThat("c99c40cd" + "1122334455667788990011223344556677889900010203040000000000000000" + + "112233445566778899001122334455667788990063441d820000000000000000") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @@ -247,43 +218,37 @@ void functions() { void functionsError() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { new ContractFunctionParameters() - .addFunction("112233445566778899001122334455667788990011", new byte[]{1, 2, 3, 4}); + .addFunction("112233445566778899001122334455667788990011", new byte[] {1, 2, 3, 4}); }); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { new ContractFunctionParameters() - .addFunction("1122334455667788990011223344556677889900", new byte[]{1, 2, 3, 4, 5}); + .addFunction("1122334455667788990011223344556677889900", new byte[] {1, 2, 3, 4, 5}); }); } @Test @DisplayName("encodes bytes4 correctly") void bytes4Encoding() { - var params = new ContractFunctionParameters() - .addBytes4(new byte[]{1, 2, 3, 4}); - assertThat( - "580526ee" + - "0102030400000000000000000000000000000000000000000000000000000000" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + var params = new ContractFunctionParameters().addBytes4(new byte[] {1, 2, 3, 4}); + assertThat("580526ee" + "0102030400000000000000000000000000000000000000000000000000000000") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("fails to encode bytes4 if length too long") void bytes4EncodingError() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - new ContractFunctionParameters().addBytes4(new byte[]{1, 2, 3, 4, 5}); + new ContractFunctionParameters().addBytes4(new byte[] {1, 2, 3, 4, 5}); }); } @Test @DisplayName("encodes UTF-8 string as bytes4 correctly") void bytes4UTF8Encoding() { - var params = new ContractFunctionParameters() - .addBytes4("ABCD".getBytes(StandardCharsets.UTF_8)); - assertThat( - "580526ee" + - "4142434400000000000000000000000000000000000000000000000000000000" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + var params = new ContractFunctionParameters().addBytes4("ABCD".getBytes(StandardCharsets.UTF_8)); + assertThat("580526ee" + "4142434400000000000000000000000000000000000000000000000000000000") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @@ -297,175 +262,162 @@ void bytes4UTF8EncodingError() { @Test @DisplayName("encodes bytes32 correctly") void bytes() { - var params = new ContractFunctionParameters() - .addBytes32(new byte[]{ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 - }); + var params = new ContractFunctionParameters().addBytes32(new byte[] { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + }); - assertThat( - "11e814c1" + - "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + assertThat("11e814c1" + "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("fails to encode bytes32 if length too long") void bytesError() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { - new ContractFunctionParameters() - .addBytes32(new byte[]{ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33 - }); - } - ); + new ContractFunctionParameters().addBytes32(new byte[] { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33 + }); + }); } @Test @DisplayName("encodes boolean correctly") void bool() { - var params = new ContractFunctionParameters() - .addBool(true) - .addBool(false); + var params = new ContractFunctionParameters().addBool(true).addBool(false); - assertThat( - "b3cedfcf" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "0000000000000000000000000000000000000000000000000000000000000000" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + assertThat("b3cedfcf" + "0000000000000000000000000000000000000000000000000000000000000001" + + "0000000000000000000000000000000000000000000000000000000000000000") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("encodes dynamic params correctly") void dynamicParamsEncoding() { - ByteString paramsStringArg = new ContractFunctionParameters() - .addString("Hello, world!") - .toBytes("set_message"); + ByteString paramsStringArg = + new ContractFunctionParameters().addString("Hello, world!").toBytes("set_message"); ByteString paramsBytesArg = new ContractFunctionParameters() - .addBytes("Hello, world!".getBytes(StandardCharsets.UTF_8)) - .toBytes("set_message"); + .addBytes("Hello, world!".getBytes(StandardCharsets.UTF_8)) + .toBytes("set_message"); String paramsStringArgHex = Hex.toHexString(paramsStringArg.toByteArray()); String paramsBytesArgHex = Hex.toHexString(paramsBytesArg.toByteArray()); - assertThat( - "2e982602" - + "0000000000000000000000000000000000000000000000000000000000000020" - + "000000000000000000000000000000000000000000000000000000000000000d" - + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000" - ).isEqualTo(paramsStringArgHex); + assertThat("2e982602" + + "0000000000000000000000000000000000000000000000000000000000000020" + + "000000000000000000000000000000000000000000000000000000000000000d" + + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000") + .isEqualTo(paramsStringArgHex); // signature should encode differently but the contents are identical - assertThat( - "010473a7" - + "0000000000000000000000000000000000000000000000000000000000000020" - + "000000000000000000000000000000000000000000000000000000000000000d" - + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000" - ).isEqualTo(paramsBytesArgHex); + assertThat("010473a7" + + "0000000000000000000000000000000000000000000000000000000000000020" + + "000000000000000000000000000000000000000000000000000000000000000d" + + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000") + .isEqualTo(paramsBytesArgHex); } @Test @DisplayName("encodes static params correctly") void staticParamsEncoding() { ContractFunctionParameters params = new ContractFunctionParameters() - .addInt32(0x11223344) - .addInt32(-65536) - .addUint64(-65536) - .addAddress("00112233445566778899aabbccddeeff00112233"); + .addInt32(0x11223344) + .addInt32(-65536) + .addUint64(-65536) + .addAddress("00112233445566778899aabbccddeeff00112233"); String paramsHex = Hex.toHexString(params.toBytes(null).toByteArray()); - assertThat( - "0000000000000000000000000000000000000000000000000000000011223344" - // sign-extended - + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000" - // zero-padded - + "000000000000000000000000000000000000000000000000ffffffffffff0000" - + "00000000000000000000000000112233445566778899aabbccddeeff00112233" - ).isEqualTo(paramsHex); + assertThat("0000000000000000000000000000000000000000000000000000000011223344" + // sign-extended + + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000" + // zero-padded + + "000000000000000000000000000000000000000000000000ffffffffffff0000" + + "00000000000000000000000000112233445566778899aabbccddeeff00112233") + .isEqualTo(paramsHex); } @Test @DisplayName("encodes mixed static and dynamic params correctly") void mixedParamsEncoding() { ContractFunctionParameters params = new ContractFunctionParameters() - .addInt256(BigInteger.valueOf(0xdeadbeef).shiftLeft(8)) - .addString("Hello, world!") - .addBytes(new byte[]{-1, -18, 63, 127}) - .addBool(true) - .addUint8Array(new byte[]{-1, 127}); + .addInt256(BigInteger.valueOf(0xdeadbeef).shiftLeft(8)) + .addString("Hello, world!") + .addBytes(new byte[] {-1, -18, 63, 127}) + .addBool(true) + .addUint8Array(new byte[] {-1, 127}); String paramsHex = Hex.toHexString(params.toBytes("foo").toByteArray()); - assertThat( - "6a5bb8f2" - + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeef00" - + "00000000000000000000000000000000000000000000000000000000000000a0" - + "00000000000000000000000000000000000000000000000000000000000000e0" - + "0000000000000000000000000000000000000000000000000000000000000001" - + "0000000000000000000000000000000000000000000000000000000000000120" - + "000000000000000000000000000000000000000000000000000000000000000d" - + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000" - + "0000000000000000000000000000000000000000000000000000000000000004" - + "ffee3f7f00000000000000000000000000000000000000000000000000000000" - + "0000000000000000000000000000000000000000000000000000000000000002" - + "00000000000000000000000000000000000000000000000000000000000000ff" - + "000000000000000000000000000000000000000000000000000000000000007f" - ).isEqualTo(paramsHex); + assertThat("6a5bb8f2" + + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeef00" + + "00000000000000000000000000000000000000000000000000000000000000a0" + + "00000000000000000000000000000000000000000000000000000000000000e0" + + "0000000000000000000000000000000000000000000000000000000000000001" + + "0000000000000000000000000000000000000000000000000000000000000120" + + "000000000000000000000000000000000000000000000000000000000000000d" + + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "ffee3f7f00000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000002" + + "00000000000000000000000000000000000000000000000000000000000000ff" + + "000000000000000000000000000000000000000000000000000000000000007f") + .isEqualTo(paramsHex); } @Test @DisplayName("encodes array types correctly") void arrayTypesEncoding() { ContractFunctionParameters params = new ContractFunctionParameters() - .addStringArray(new String[]{"hello", ",", "world!"}) - .addInt32Array(new int[]{0x88, 0x99, 0xAA, 0xBB}) - .addInt256Array(new BigInteger[]{BigInteger.valueOf(0x1111)}); - - assertThat( - "025838fc" + - "0000000000000000000000000000000000000000000000000000000000000060" + - "00000000000000000000000000000000000000000000000000000000000001a0" + - "0000000000000000000000000000000000000000000000000000000000000240" + - "0000000000000000000000000000000000000000000000000000000000000003" + - "0000000000000000000000000000000000000000000000000000000000000060" + - "00000000000000000000000000000000000000000000000000000000000000a0" + - "00000000000000000000000000000000000000000000000000000000000000e0" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "68656c6c6f000000000000000000000000000000000000000000000000000000" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "2c00000000000000000000000000000000000000000000000000000000000000" + - "0000000000000000000000000000000000000000000000000000000000000006" + - "776f726c64210000000000000000000000000000000000000000000000000000" + - "0000000000000000000000000000000000000000000000000000000000000004" + - "0000000000000000000000000000000000000000000000000000000000000088" + - "0000000000000000000000000000000000000000000000000000000000000099" + - "00000000000000000000000000000000000000000000000000000000000000aa" + - "00000000000000000000000000000000000000000000000000000000000000bb" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "0000000000000000000000000000000000000000000000000000000000001111" - ).isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); + .addStringArray(new String[] {"hello", ",", "world!"}) + .addInt32Array(new int[] {0x88, 0x99, 0xAA, 0xBB}) + .addInt256Array(new BigInteger[] {BigInteger.valueOf(0x1111)}); + + assertThat("025838fc" + "0000000000000000000000000000000000000000000000000000000000000060" + + "00000000000000000000000000000000000000000000000000000000000001a0" + + "0000000000000000000000000000000000000000000000000000000000000240" + + "0000000000000000000000000000000000000000000000000000000000000003" + + "0000000000000000000000000000000000000000000000000000000000000060" + + "00000000000000000000000000000000000000000000000000000000000000a0" + + "00000000000000000000000000000000000000000000000000000000000000e0" + + "0000000000000000000000000000000000000000000000000000000000000005" + + "68656c6c6f000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000001" + + "2c00000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000006" + + "776f726c64210000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000004" + + "0000000000000000000000000000000000000000000000000000000000000088" + + "0000000000000000000000000000000000000000000000000000000000000099" + + "00000000000000000000000000000000000000000000000000000000000000aa" + + "00000000000000000000000000000000000000000000000000000000000000bb" + + "0000000000000000000000000000000000000000000000000000000000000001" + + "0000000000000000000000000000000000000000000000000000000000001111") + .isEqualTo(Hex.toHexString(params.toBytes("foo").toByteArray())); } @Test @DisplayName("bytes4[] encodes correctly") void fixedBytes4ArrayEncoding() { - ContractFunctionParameters params = new ContractFunctionParameters() - .addBytes4Array(new byte[][]{ - {1, 2, 3, 4}, - {5, 6, 7, 8}, - {9, 10, 11, 12} - }); + ContractFunctionParameters params = new ContractFunctionParameters().addBytes4Array(new byte[][] { + {1, 2, 3, 4}, + {5, 6, 7, 8}, + {9, 10, 11, 12} + }); assertThat( - "0000000000000000000000000000000000000000000000000000000000000020" + // offset of array - "0000000000000000000000000000000000000000000000000000000000000003" + // length of array - "0102030400000000000000000000000000000000000000000000000000000000" + // first bytes4 - "0506070800000000000000000000000000000000000000000000000000000000" + // second bytes4 - "090a0b0c00000000000000000000000000000000000000000000000000000000" // third bytes4 - ).isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); + "0000000000000000000000000000000000000000000000000000000000000020" + // offset of array + "0000000000000000000000000000000000000000000000000000000000000003" + + // length of array + "0102030400000000000000000000000000000000000000000000000000000000" + + // first bytes4 + "0506070800000000000000000000000000000000000000000000000000000000" + + // second bytes4 + "090a0b0c00000000000000000000000000000000000000000000000000000000" // third bytes4 + ) + .isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); } @Test @@ -473,67 +425,92 @@ void fixedBytes4ArrayEncoding() { void fixedBytesArrayEncoding() { // each string should be padded to 32 bytes and have no length prefix - ContractFunctionParameters params = new ContractFunctionParameters() - .addBytes32Array(new byte[][]{ - "Hello".getBytes(StandardCharsets.UTF_8), - ",".getBytes(StandardCharsets.UTF_8), - "world!".getBytes(StandardCharsets.UTF_8) - }); + ContractFunctionParameters params = new ContractFunctionParameters().addBytes32Array(new byte[][] { + "Hello".getBytes(StandardCharsets.UTF_8), + ",".getBytes(StandardCharsets.UTF_8), + "world!".getBytes(StandardCharsets.UTF_8) + }); assertThat( - "0000000000000000000000000000000000000000000000000000000000000020" + - "0000000000000000000000000000000000000000000000000000000000000003" + // length of array - "48656c6c6f000000000000000000000000000000000000000000000000000000" + // "Hello" UTF-8 encoded - "2c00000000000000000000000000000000000000000000000000000000000000" + // "," UTF-8 encoded - "776f726c64210000000000000000000000000000000000000000000000000000" // "world!" UTF-8 encoded - ).isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); + "0000000000000000000000000000000000000000000000000000000000000020" + + "0000000000000000000000000000000000000000000000000000000000000003" + + // length of array + "48656c6c6f000000000000000000000000000000000000000000000000000000" + + // "Hello" UTF-8 encoded + "2c00000000000000000000000000000000000000000000000000000000000000" + + // "," UTF-8 encoded + "776f726c64210000000000000000000000000000000000000000000000000000" // "world!" UTF-8 + // encoded + ) + .isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); } @Test @DisplayName("bytes[] encodes correctly") void dynBytesArrayEncoding() { // result should be the exact same as the strings test below - ContractFunctionParameters params = new ContractFunctionParameters() - .addBytesArray(new byte[][]{ - "Hello".getBytes(StandardCharsets.UTF_8), - ",".getBytes(StandardCharsets.UTF_8), - "world!".getBytes(StandardCharsets.UTF_8) - }); + ContractFunctionParameters params = new ContractFunctionParameters().addBytesArray(new byte[][] { + "Hello".getBytes(StandardCharsets.UTF_8), + ",".getBytes(StandardCharsets.UTF_8), + "world!".getBytes(StandardCharsets.UTF_8) + }); assertThat( - "0000000000000000000000000000000000000000000000000000000000000020" + // offset to array - "0000000000000000000000000000000000000000000000000000000000000003" + // length of array - "0000000000000000000000000000000000000000000000000000000000000060" + // first element offset, relative to beginning of this list (after length) - "00000000000000000000000000000000000000000000000000000000000000a0" + // second element offset - "00000000000000000000000000000000000000000000000000000000000000e0" + // third element offset - "0000000000000000000000000000000000000000000000000000000000000005" + // "Hello".length - "48656c6c6f000000000000000000000000000000000000000000000000000000" + // "Hello" UTF-8 encoded - "0000000000000000000000000000000000000000000000000000000000000001" + // ",".length - "2c00000000000000000000000000000000000000000000000000000000000000" + // "," UTF-8 encoded - "0000000000000000000000000000000000000000000000000000000000000006" + // "world!".length - "776f726c64210000000000000000000000000000000000000000000000000000" // "world!" UTF-8 encoded - ).isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); + "0000000000000000000000000000000000000000000000000000000000000020" + // offset to array + "0000000000000000000000000000000000000000000000000000000000000003" + + // length of array + "0000000000000000000000000000000000000000000000000000000000000060" + + // first element offset, relative to beginning of this list (after length) + "00000000000000000000000000000000000000000000000000000000000000a0" + + // second element offset + "00000000000000000000000000000000000000000000000000000000000000e0" + + // third element offset + "0000000000000000000000000000000000000000000000000000000000000005" + + // "Hello".length + "48656c6c6f000000000000000000000000000000000000000000000000000000" + + // "Hello" UTF-8 encoded + "0000000000000000000000000000000000000000000000000000000000000001" + + // ",".length + "2c00000000000000000000000000000000000000000000000000000000000000" + + // "," UTF-8 encoded + "0000000000000000000000000000000000000000000000000000000000000006" + + // "world!".length + "776f726c64210000000000000000000000000000000000000000000000000000" // "world!" UTF-8 + // encoded + ) + .isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); } @Test @DisplayName("issue 376: string[] encodes correctly") void stringArrayEncoding() { - ContractFunctionParameters params = new ContractFunctionParameters() - .addStringArray(new String[]{"Hello", ",", "world!"}); + ContractFunctionParameters params = + new ContractFunctionParameters().addStringArray(new String[] {"Hello", ",", "world!"}); assertThat( - "0000000000000000000000000000000000000000000000000000000000000020" + // offset to array - "0000000000000000000000000000000000000000000000000000000000000003" + // length of array - "0000000000000000000000000000000000000000000000000000000000000060" + // first element offset, relative to beginning of this list (after length) - "00000000000000000000000000000000000000000000000000000000000000a0" + // second element offset - "00000000000000000000000000000000000000000000000000000000000000e0" + // third element offset - "0000000000000000000000000000000000000000000000000000000000000005" + // "Hello".length - "48656c6c6f000000000000000000000000000000000000000000000000000000" + // "Hello" UTF-8 encoded - "0000000000000000000000000000000000000000000000000000000000000001" + // ",".length - "2c00000000000000000000000000000000000000000000000000000000000000" + // "," UTF-8 encoded - "0000000000000000000000000000000000000000000000000000000000000006" + // "world!".length - "776f726c64210000000000000000000000000000000000000000000000000000" // "world!" UTF-8 encoded - ).isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); + "0000000000000000000000000000000000000000000000000000000000000020" + // offset to array + "0000000000000000000000000000000000000000000000000000000000000003" + + // length of array + "0000000000000000000000000000000000000000000000000000000000000060" + + // first element offset, relative to beginning of this list (after length) + "00000000000000000000000000000000000000000000000000000000000000a0" + + // second element offset + "00000000000000000000000000000000000000000000000000000000000000e0" + + // third element offset + "0000000000000000000000000000000000000000000000000000000000000005" + + // "Hello".length + "48656c6c6f000000000000000000000000000000000000000000000000000000" + + // "Hello" UTF-8 encoded + "0000000000000000000000000000000000000000000000000000000000000001" + + // ",".length + "2c00000000000000000000000000000000000000000000000000000000000000" + + // "," UTF-8 encoded + "0000000000000000000000000000000000000000000000000000000000000006" + + // "world!".length + "776f726c64210000000000000000000000000000000000000000000000000000" // "world!" UTF-8 + // encoded + ) + .isEqualTo(Hex.toHexString(params.toBytes(null).toByteArray())); } @Test @@ -548,13 +525,13 @@ void bigIntChecks() { String rangeErr = "BigInteger out of range for Solidity integers"; - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> params.addInt256(BigInteger.ONE.shiftLeft(255)) - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo(rangeErr)); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> params.addInt256(BigInteger.ONE.shiftLeft(255))) + .satisfies(error -> assertThat(error.getMessage()).isEqualTo(rangeErr)); - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> params.addInt256(BigInteger.ONE.negate().shiftLeft(256)) - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo(rangeErr)); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> params.addInt256(BigInteger.ONE.negate().shiftLeft(256))) + .satisfies(error -> assertThat(error.getMessage()).isEqualTo(rangeErr)); } @Test @@ -564,39 +541,40 @@ void addressParamChecks() { String lenErr = "Solidity addresses must be 40 hex chars"; - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> params.addAddress("") - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo(lenErr)); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> params.addAddress("")) + .satisfies(error -> assertThat(error.getMessage()).isEqualTo(lenErr)); - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> params.addAddress("aabbccdd") - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo(lenErr)); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> params.addAddress("aabbccdd")) + .satisfies(error -> assertThat(error.getMessage()).isEqualTo(lenErr)); - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> params.addAddress("00112233445566778899aabbccddeeff0011223344") - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo(lenErr)); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> params.addAddress("00112233445566778899aabbccddeeff0011223344")) + .satisfies(error -> assertThat(error.getMessage()).isEqualTo(lenErr)); - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> params.addAddress("gghhii--__zz66778899aabbccddeeff00112233") - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo("failed to decode Solidity address as hex")); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> params.addAddress("gghhii--__zz66778899aabbccddeeff00112233")) + .satisfies( + error -> assertThat(error.getMessage()).isEqualTo("failed to decode Solidity address as hex")); } @ParameterizedTest @DisplayName("int256() encodes correctly") @MethodSource("int256Arguments") void int256EncodesCorrectly(long val, String hexString) { - assertThat(hexString).isEqualTo( - Hex.toHexString(ContractFunctionParameters.int256(val, 64).toByteArray()) - ); + assertThat(hexString) + .isEqualTo(Hex.toHexString( + ContractFunctionParameters.int256(val, 64).toByteArray())); } @ParameterizedTest @DisplayName("uint256() encodes correctly") @MethodSource("uInt256Arguments") void uInt256EncodesCorrectly(long val, String hexString, int bitWidth) { - assertThat(hexString).isEqualTo( - Hex.toHexString(ContractFunctionParameters.uint256(val, bitWidth).toByteArray()) - ); + assertThat(hexString) + .isEqualTo(Hex.toHexString( + ContractFunctionParameters.uint256(val, bitWidth).toByteArray())); } @Test @@ -606,28 +584,30 @@ void intSizesEncodeCorrectly() throws Exception { var bitWidth = n; var argType = ((Supplier>) () -> { - if (bitWidth == 8) { - return byte.class; - } else if (bitWidth <= 32) { - return int.class; - } else if (bitWidth <= 64) { - return long.class; - } else { - return BigInteger.class; - } - }).get(); + if (bitWidth == 8) { + return byte.class; + } else if (bitWidth <= 32) { + return int.class; + } else if (bitWidth <= 64) { + return long.class; + } else { + return BigInteger.class; + } + }) + .get(); var argVal = ((Supplier) () -> { - if (bitWidth == 8) { - return (byte) (1 << (bitWidth - 1)); - } else if (bitWidth <= 32) { - return (1 << (bitWidth - 1)); - } else if (bitWidth <= 64) { - return (1L << (bitWidth - 1)); - } else { - return BigInteger.ONE.shiftLeft(bitWidth - 1); - } - }).get(); + if (bitWidth == 8) { + return (byte) (1 << (bitWidth - 1)); + } else if (bitWidth <= 32) { + return (1 << (bitWidth - 1)); + } else if (bitWidth <= 64) { + return (1L << (bitWidth - 1)); + } else { + return BigInteger.ONE.shiftLeft(bitWidth - 1); + } + }) + .get(); var argArrayVal = Array.newInstance(argType, 2); Array.set(argArrayVal, 0, argVal); @@ -646,7 +626,8 @@ void intSizesEncodeCorrectly() throws Exception { addIntArrayMethod.invoke(params, argArrayVal); addUintArrayMethod.invoke(params, argArrayVal); - snapshotStrings.add("bitWidth = " + bitWidth + ": " + Hex.toHexString(params.toBytes(null).toByteArray())); + snapshotStrings.add("bitWidth = " + bitWidth + ": " + + Hex.toHexString(params.toBytes(null).toByteArray())); } SnapshotMatcher.expect(snapshotStrings.toArray()).toMatchSnapshot(); } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java b/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java index cc400569e7..21093cb5d4 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java @@ -1,58 +1,36 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractFunctionResult; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractNonceInfo; +import java.math.BigInteger; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.math.BigInteger; - -import static org.assertj.core.api.Assertions.assertThat; - public class ContractFunctionResultTest { static final String CALL_RESULT_HEX = "00000000000000000000000000000000000000000000000000000000ffffffff" - + "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - + "00000000000000000000000011223344556677889900aabbccddeeff00112233" - + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - + "00000000000000000000000000000000000000000000000000000000000000c0" - + "0000000000000000000000000000000000000000000000000000000000000100" - + "000000000000000000000000000000000000000000000000000000000000000d" - + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000" - + "0000000000000000000000000000000000000000000000000000000000000014" - + "48656c6c6f2c20776f726c642c20616761696e21000000000000000000000000"; - - private static final String STRING_ARRAY_RESULT_HEX = "0000000000000000000000000000000000000000000000000000000000000020" - + "0000000000000000000000000000000000000000000000000000000000000002" - + "0000000000000000000000000000000000000000000000000000000000000040" - + "0000000000000000000000000000000000000000000000000000000000000080" - + "000000000000000000000000000000000000000000000000000000000000000C" - + "72616E646F6D2062797465730000000000000000000000000000000000000000" - + "000000000000000000000000000000000000000000000000000000000000000C" - + "72616E646F6D2062797465730000000000000000000000000000000000000000"; + + "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + + "00000000000000000000000011223344556677889900aabbccddeeff00112233" + + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + + "00000000000000000000000000000000000000000000000000000000000000c0" + + "0000000000000000000000000000000000000000000000000000000000000100" + + "000000000000000000000000000000000000000000000000000000000000000d" + + "48656c6c6f2c20776f726c642100000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000014" + + "48656c6c6f2c20776f726c642c20616761696e21000000000000000000000000"; + + private static final String STRING_ARRAY_RESULT_HEX = + "0000000000000000000000000000000000000000000000000000000000000020" + + "0000000000000000000000000000000000000000000000000000000000000002" + + "0000000000000000000000000000000000000000000000000000000000000040" + + "0000000000000000000000000000000000000000000000000000000000000080" + + "000000000000000000000000000000000000000000000000000000000000000C" + + "72616E646F6D2062797465730000000000000000000000000000000000000000" + + "000000000000000000000000000000000000000000000000000000000000000C" + + "72616E646F6D2062797465730000000000000000000000000000000000000000"; private static final byte[] callResult = Hex.decode(CALL_RESULT_HEX); private static final byte[] stringArrayCallResult = Hex.decode(STRING_ARRAY_RESULT_HEX); @@ -60,11 +38,12 @@ public class ContractFunctionResultTest { @Test @DisplayName("provides results correctly") void providesResultsCorrectly() { - var result = new ContractFunctionResult( - com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + var result = new ContractFunctionResult(com.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(ContractId.fromString("1.2.3").toProtobuf()) .setContractCallResult(ByteString.copyFrom(callResult)) - .setEvmAddress(BytesValue.newBuilder().setValue(ByteString.copyFrom(Hex.decode("98329e006610472e6B372C080833f6D79ED833cf"))).build()) + .setEvmAddress(BytesValue.newBuilder() + .setValue(ByteString.copyFrom(Hex.decode("98329e006610472e6B372C080833f6D79ED833cf"))) + .build()) // .addStateChanges( // new ContractStateChange( // ContractId.fromString("1.2.3"), @@ -77,10 +56,7 @@ void providesResultsCorrectly() { // ) // ).toProtobuf()) .setSenderId(AccountId.fromString("1.2.3").toProtobuf()) - .addContractNonces( - new ContractNonceInfo(ContractId.fromString("1.2.3"), 10L) - .toProtobuf()) - ); + .addContractNonces(new ContractNonceInfo(ContractId.fromString("1.2.3"), 10L).toProtobuf())); // interpretation varies based on width assertThat(result.getBool(0)).isTrue(); @@ -104,7 +80,8 @@ void providesResultsCorrectly() { assertThat(result.senderAccountId).isEqualTo(AccountId.fromString("1.2.3")); assertThat(result.contractId).isEqualTo(ContractId.fromString("1.2.3")); - assertThat(result.evmAddress).isEqualTo(ContractId.fromEvmAddress(1, 2, "98329e006610472e6B372C080833f6D79ED833cf")); + assertThat(result.evmAddress) + .isEqualTo(ContractId.fromEvmAddress(1, 2, "98329e006610472e6B372C080833f6D79ED833cf")); // assertThat(result.stateChanges.size()).isEqualTo(1); // ContractStateChange resultStateChange = result.stateChanges.get(0); // assertThat(resultStateChange.contractId).isEqualTo(ContractId.fromString("1.2.3")); @@ -119,10 +96,8 @@ void providesResultsCorrectly() { @Test @DisplayName("can get string array result") void canGetStringArrayResult() { - var result = new ContractFunctionResult( - com.hiero.sdk.proto.ContractFunctionResult.newBuilder() - .setContractCallResult(ByteString.copyFrom(stringArrayCallResult)) - ); + var result = new ContractFunctionResult(com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + .setContractCallResult(ByteString.copyFrom(stringArrayCallResult))); var strings = result.getStringArray(0); assertThat(strings.get(0)).isEqualTo("random bytes"); @@ -131,7 +106,5 @@ void canGetStringArrayResult() { @Test @DisplayName("Can to/from bytes with state changes") - void canToFromBytesStateChanges() { - - } + void canToFromBytesStateChanges() {} } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java b/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java index 44ed85292b..5cf8a4dd46 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java @@ -1,65 +1,46 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.ContractFunctionSelector; -import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatNoException; +import org.bouncycastle.util.encoders.Hex; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + public class ContractFunctionSelectorTest { @Test @DisplayName("Can add all types") void selector() { var signature = new ContractFunctionSelector("testFunction") - .addAddress() - .addAddressArray() - .addBool() - .addBytes() - .addBytes32() - .addBytes32Array() - .addBytesArray() - .addFunction() - .addInt8() - .addInt8Array() - .addInt32() - .addInt32Array() - .addInt64() - .addInt64Array() - .addInt256() - .addInt256Array() - .addUint8() - .addUint8Array() - .addUint32() - .addUint32Array() - .addUint64() - .addUint64Array() - .addUint256() - .addUint256Array() - .addString() - .addStringArray() - .finish(); + .addAddress() + .addAddressArray() + .addBool() + .addBytes() + .addBytes32() + .addBytes32Array() + .addBytesArray() + .addFunction() + .addInt8() + .addInt8Array() + .addInt32() + .addInt32Array() + .addInt64() + .addInt64Array() + .addInt256() + .addInt256Array() + .addUint8() + .addUint8Array() + .addUint32() + .addUint32Array() + .addUint64() + .addUint64Array() + .addUint256() + .addUint256Array() + .addString() + .addStringArray() + .finish(); assertThat(Hex.toHexString(signature)).isEqualTo("4438e4ce"); } @@ -67,8 +48,7 @@ void selector() { @Test @DisplayName("Throws in adding after finished") void selectorError() { - var signature = new ContractFunctionSelector("testFunction") - .addAddress(); + var signature = new ContractFunctionSelector("testFunction").addAddress(); signature.finish(); assertThatExceptionOfType(IllegalStateException.class).isThrownBy(signature::addStringArray); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java index fa5da0b8c3..eee2bb2747 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java @@ -1,35 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.ContractId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - - class ContractIdTest { @BeforeAll public static void beforeAll() { @@ -48,27 +28,37 @@ void fromString() { @Test void fromSolidityAddress() { - SnapshotMatcher.expect(ContractId.fromSolidityAddress("000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(ContractId.fromSolidityAddress("000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddressWith0x() { - SnapshotMatcher.expect(ContractId.fromSolidityAddress("0x000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(ContractId.fromSolidityAddress("0x000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test void fromEvmAddress() { - SnapshotMatcher.expect(ContractId.fromEvmAddress(1, 2, "98329e006610472e6B372C080833f6D79ED833cf").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(ContractId.fromEvmAddress(1, 2, "98329e006610472e6B372C080833f6D79ED833cf") + .toString()) + .toMatchSnapshot(); } @Test void fromEvmAddressWith0x() { - SnapshotMatcher.expect(ContractId.fromEvmAddress(1, 2, "0x98329e006610472e6B372C080833f6D79ED833cf").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(ContractId.fromEvmAddress(1, 2, "0x98329e006610472e6B372C080833f6D79ED833cf") + .toString()) + .toMatchSnapshot(); } @Test void fromStringWithEvmAddress() { - SnapshotMatcher.expect(ContractId.fromString("1.2.98329e006610472e6B372C080833f6D79ED833cf").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(ContractId.fromString("1.2.98329e006610472e6B372C080833f6D79ED833cf") + .toString()) + .toMatchSnapshot(); } @Test @@ -86,7 +76,9 @@ void toBytes() throws InvalidProtocolBufferException { @Test void fromBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(ContractId.fromBytes(new ContractId(5005).toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect( + ContractId.fromBytes(new ContractId(5005).toBytes()).toString()) + .toMatchSnapshot(); } @Test @@ -96,6 +88,8 @@ void toSolidityAddress() { @Test void toSolidityAddress2() { - SnapshotMatcher.expect(ContractId.fromEvmAddress(1, 2, "0x98329e006610472e6B372C080833f6D79ED833cf").toSolidityAddress()).toMatchSnapshot(); + SnapshotMatcher.expect(ContractId.fromEvmAddress(1, 2, "0x98329e006610472e6B372C080833f6D79ED833cf") + .toSolidityAddress()) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java index 8ef390fce7..d2b04f4b0b 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java @@ -1,26 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractInfoQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -42,8 +22,9 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new ContractInfoQuery() - .setContractId(ContractId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setContractId(ContractId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java index 2c243aeba1..7b4586ba9c 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java @@ -1,45 +1,18 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractInfo; -import com.hiero.sdk.DurationConverter; -import com.hiero.sdk.InstantConverter; -import com.hiero.sdk.LedgerId; import com.hiero.sdk.proto.ContractGetInfoResponse; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Duration; +import java.time.Instant; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Duration; -import java.time.Instant; - - public class ContractInfoTest { - private final ContractGetInfoResponse.ContractInfo info = - ContractGetInfoResponse.ContractInfo.newBuilder() + private final ContractGetInfoResponse.ContractInfo info = ContractGetInfoResponse.ContractInfo.newBuilder() .setContractID(new ContractId(1).toProtobuf()) .setAccountID(new AccountId(2).toProtobuf()) .setContractAccountID("3") @@ -63,25 +36,23 @@ public static void afterAll() { @Test void fromProtobuf() { - SnapshotMatcher.expect(ContractInfo.fromProtobuf(info).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect(ContractInfo.fromProtobuf(info).toString()).toMatchSnapshot(); } @Test void toProtobuf() { - SnapshotMatcher.expect(ContractInfo.fromProtobuf(info).toProtobuf()) - .toMatchSnapshot(); + SnapshotMatcher.expect(ContractInfo.fromProtobuf(info).toProtobuf()).toMatchSnapshot(); } @Test void toBytes() { SnapshotMatcher.expect(Hex.toHexString(ContractInfo.fromProtobuf(info).toBytes())) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(ContractInfo.fromBytes(info.toByteArray()).toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java index 0fd8a21e23..04be1d2fd0 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java @@ -1,25 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractLogInfo; import com.hiero.sdk.proto.ContractLoginfo; import io.github.jsonSnapshot.SnapshotMatcher; +import java.nio.charset.StandardCharsets; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.nio.charset.StandardCharsets; - public class ContractLogInfoTest { private static final ContractLoginfo info = ContractLoginfo.newBuilder() - .setContractID(new ContractId(10).toProtobuf()) - .setBloom(ByteString.copyFrom("bloom", StandardCharsets.UTF_8)) - .addTopic(ByteString.copyFrom("bloom", StandardCharsets.UTF_8)) - .setData(ByteString.copyFrom("data", StandardCharsets.UTF_8)) - .build(); + .setContractID(new ContractId(10).toProtobuf()) + .setBloom(ByteString.copyFrom("bloom", StandardCharsets.UTF_8)) + .addTopic(ByteString.copyFrom("bloom", StandardCharsets.UTF_8)) + .setData(ByteString.copyFrom("data", StandardCharsets.UTF_8)) + .build(); @BeforeAll public static void beforeAll() { @@ -33,25 +31,25 @@ public static void afterAll() { @Test void fromProtobuf() { - SnapshotMatcher.expect(ContractLogInfo.fromProtobuf(info).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect(ContractLogInfo.fromProtobuf(info).toString()).toMatchSnapshot(); } @Test void toProtobuf() throws InvalidProtocolBufferException { SnapshotMatcher.expect(ContractLogInfo.fromProtobuf(info).toProtobuf().toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(ContractLogInfo.fromBytes(info.toByteArray()).toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void toBytes() { - SnapshotMatcher.expect(Hex.toHexString(ContractLogInfo.fromProtobuf(info).toBytes())) - .toMatchSnapshot(); + SnapshotMatcher.expect( + Hex.toHexString(ContractLogInfo.fromProtobuf(info).toBytes())) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java index 4fc112b0f2..a46cc56c72 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractNonceInfo; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; @@ -10,8 +9,7 @@ import org.junit.jupiter.api.Test; public class ContractNonceInfoTest { - private final com.hiero.sdk.proto.ContractNonceInfo info = - com.hiero.sdk.proto.ContractNonceInfo.newBuilder() + private final com.hiero.sdk.proto.ContractNonceInfo info = com.hiero.sdk.proto.ContractNonceInfo.newBuilder() .setContractId(new ContractId(1).toProtobuf()) .setNonce(2) .build(); @@ -28,25 +26,25 @@ public static void afterAll() { @Test void fromProtobuf() { - SnapshotMatcher.expect(ContractNonceInfo.fromProtobuf(info).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect(ContractNonceInfo.fromProtobuf(info).toString()).toMatchSnapshot(); } @Test void toProtobuf() { SnapshotMatcher.expect(ContractNonceInfo.fromProtobuf(info).toProtobuf()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void toBytes() { - SnapshotMatcher.expect(Hex.toHexString(ContractNonceInfo.fromProtobuf(info).toBytes())) - .toMatchSnapshot(); + SnapshotMatcher.expect( + Hex.toHexString(ContractNonceInfo.fromProtobuf(info).toBytes())) + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(ContractNonceInfo.fromBytes(info.toByteArray()).toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java index df8b1133bf..5c905894a4 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java @@ -1,47 +1,21 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractUpdateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.ContractUpdateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Duration; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class ContractUpdateTransactionTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -57,16 +31,12 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test void shouldSerialize2() { - SnapshotMatcher.expect(spawnTestTransaction2() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction2().toString()).toMatchSnapshot(); } @Test @@ -78,38 +48,38 @@ void shouldBytesNoSetters() throws Exception { private ContractUpdateTransaction spawnTestTransaction() { return new ContractUpdateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContractId(ContractId.fromString("0.0.5007")) - .setAdminKey(privateKey) - .setMaxAutomaticTokenAssociations(101) - .setAutoRenewPeriod(Duration.ofDays(1)) - .setContractMemo("3") - .setStakedAccountId(AccountId.fromString("0.0.3")) - .setExpirationTime(Instant.ofEpochMilli(4)) - .setProxyAccountId(new AccountId(4)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setAutoRenewAccountId(new AccountId(30)) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContractId(ContractId.fromString("0.0.5007")) + .setAdminKey(privateKey) + .setMaxAutomaticTokenAssociations(101) + .setAutoRenewPeriod(Duration.ofDays(1)) + .setContractMemo("3") + .setStakedAccountId(AccountId.fromString("0.0.3")) + .setExpirationTime(Instant.ofEpochMilli(4)) + .setProxyAccountId(new AccountId(4)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setAutoRenewAccountId(new AccountId(30)) + .freeze() + .sign(privateKey); } private ContractUpdateTransaction spawnTestTransaction2() { return new ContractUpdateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContractId(ContractId.fromString("0.0.5007")) - .setAdminKey(privateKey) - .setMaxAutomaticTokenAssociations(101) - .setAutoRenewPeriod(Duration.ofDays(1)) - .setContractMemo("3") - .setStakedNodeId(4L) - .setExpirationTime(Instant.ofEpochMilli(4)) - .setProxyAccountId(new AccountId(4)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setAutoRenewAccountId(new AccountId(30)) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContractId(ContractId.fromString("0.0.5007")) + .setAdminKey(privateKey) + .setMaxAutomaticTokenAssociations(101) + .setAutoRenewPeriod(Duration.ofDays(1)) + .setContractMemo("3") + .setStakedNodeId(4L) + .setExpirationTime(Instant.ofEpochMilli(4)) + .setProxyAccountId(new AccountId(4)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setAutoRenewAccountId(new AccountId(30)) + .freeze() + .sign(privateKey); } @Test @@ -129,8 +99,9 @@ void shouldBytes2() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setContractUpdateInstance(ContractUpdateTransactionBody.newBuilder().build()) - .build(); + .setContractUpdateInstance( + ContractUpdateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java index fead24128d..40aeffc156 100644 --- a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java @@ -1,50 +1,23 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; import com.hiero.sdk.proto.CryptoTransferTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TransactionList; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class CryptoTransferTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -60,9 +33,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -74,52 +45,85 @@ void shouldBytesNoSetters() throws Exception { private TransferTransaction spawnTestTransaction() { return new TransferTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .addHbarTransfer(AccountId.fromString("0.0.5008"), Hbar.fromTinybars(400)) - .addHbarTransfer(AccountId.fromString("0.0.5006"), Hbar.fromTinybars(800).negated()) - .addHbarTransfer(AccountId.fromString("0.0.5007"), Hbar.fromTinybars(400)) - .addTokenTransfer(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5008"), 400) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5006"), -800, 3) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5007"), 400, 3) - .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5008"), 1) - .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), -1) - .addNftTransfer(TokenId.fromString("0.0.3").nft(2), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5007")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(1), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5007")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(3), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5006")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(4), AccountId.fromString("0.0.5007"), AccountId.fromString("0.0.5006")) - .addNftTransfer(TokenId.fromString("0.0.2").nft(4), AccountId.fromString("0.0.5007"), AccountId.fromString("0.0.5006")) - .setHbarTransferApproval(AccountId.fromString("0.0.5007"), true) - .setTokenTransferApproval(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), true) - .setNftTransferApproval(new NftId(TokenId.fromString("0.0.4"), 4), true) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .addHbarTransfer(AccountId.fromString("0.0.5008"), Hbar.fromTinybars(400)) + .addHbarTransfer( + AccountId.fromString("0.0.5006"), Hbar.fromTinybars(800).negated()) + .addHbarTransfer(AccountId.fromString("0.0.5007"), Hbar.fromTinybars(400)) + .addTokenTransfer(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5008"), 400) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5006"), -800, 3) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5007"), 400, 3) + .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5008"), 1) + .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), -1) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(2), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5007")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(1), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5007")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(3), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5006")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(4), + AccountId.fromString("0.0.5007"), + AccountId.fromString("0.0.5006")) + .addNftTransfer( + TokenId.fromString("0.0.2").nft(4), + AccountId.fromString("0.0.5007"), + AccountId.fromString("0.0.5006")) + .setHbarTransferApproval(AccountId.fromString("0.0.5007"), true) + .setTokenTransferApproval(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), true) + .setNftTransferApproval(new NftId(TokenId.fromString("0.0.4"), 4), true) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } private TransferTransaction spawnModifiedTestTransaction() { return new TransferTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .addHbarTransfer(AccountId.fromString("0.0.5008"), Hbar.fromTinybars(400)) - .addHbarTransfer(AccountId.fromString("0.0.5006"), Hbar.fromTinybars(800).negated()) - .addHbarTransfer(AccountId.fromString("0.0.5007"), Hbar.fromTinybars(400)) - .addTokenTransfer(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5008"), 400) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5006"), -800, 3) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5007"), 400, 3) - .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5008"), 1) - .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), -1) - .addNftTransfer(TokenId.fromString("0.0.3").nft(2), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5007")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(1), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5007")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(3), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5006")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(4), AccountId.fromString("0.0.5007"), AccountId.fromString("0.0.5006")) - .addNftTransfer(TokenId.fromString("0.0.2").nft(4), AccountId.fromString("0.0.5007"), AccountId.fromString("0.0.5006")) - .setHbarTransferApproval(AccountId.fromString("0.0.5007"), true) - // !!! .setTokenTransferApproval(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), true) !!! - .setNftTransferApproval(new NftId(TokenId.fromString("0.0.4"), 4), true) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .addHbarTransfer(AccountId.fromString("0.0.5008"), Hbar.fromTinybars(400)) + .addHbarTransfer( + AccountId.fromString("0.0.5006"), Hbar.fromTinybars(800).negated()) + .addHbarTransfer(AccountId.fromString("0.0.5007"), Hbar.fromTinybars(400)) + .addTokenTransfer(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5008"), 400) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5006"), -800, 3) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5007"), 400, 3) + .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5008"), 1) + .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), -1) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(2), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5007")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(1), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5007")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(3), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5006")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(4), + AccountId.fromString("0.0.5007"), + AccountId.fromString("0.0.5006")) + .addNftTransfer( + TokenId.fromString("0.0.2").nft(4), + AccountId.fromString("0.0.5007"), + AccountId.fromString("0.0.5006")) + .setHbarTransferApproval(AccountId.fromString("0.0.5007"), true) + // !!! .setTokenTransferApproval(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), true) + // !!! + .setNftTransferApproval(new NftId(TokenId.fromString("0.0.4"), 4), true) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -133,8 +137,8 @@ void shouldBytes() throws Exception { void decimalsMustBeConsistent() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { new TransferTransaction() - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.8"), 100, 2) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.7"), -100, 3); + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.8"), 100, 2) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.7"), -100, 3); }); } @@ -150,13 +154,12 @@ void canGetDecimals() { @Test void transactionBodiesMustMatch() throws InvalidProtocolBufferException { - com.hiero.sdk.proto.Transaction tx1 = TransactionList.parseFrom(spawnTestTransaction().toBytes()) - .getTransactionList(0); - com.hiero.sdk.proto.Transaction tx2 = TransactionList.parseFrom(spawnModifiedTestTransaction().toBytes()) - .getTransactionList(1); - var brokenTxList = TransactionList.newBuilder() - .addTransactionList(tx1) - .addTransactionList(tx2); + com.hiero.sdk.proto.Transaction tx1 = + TransactionList.parseFrom(spawnTestTransaction().toBytes()).getTransactionList(0); + com.hiero.sdk.proto.Transaction tx2 = TransactionList.parseFrom( + spawnModifiedTestTransaction().toBytes()) + .getTransactionList(1); + var brokenTxList = TransactionList.newBuilder().addTransactionList(tx1).addTransactionList(tx2); var brokenTxBytes = brokenTxList.build().toByteArray(); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { Transaction.fromBytes(brokenTxBytes); @@ -166,8 +169,8 @@ void transactionBodiesMustMatch() throws InvalidProtocolBufferException { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setCryptoTransfer(CryptoTransferTransactionBody.newBuilder().build()) - .build(); + .setCryptoTransfer(CryptoTransferTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java b/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java index 52b7210e22..5bb4e4e89b 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java @@ -1,40 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.CustomRoyaltyFee; -import com.hiero.sdk.TokenId; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.util.ArrayList; +import java.util.List; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; - public class CustomFeeListTest { @BeforeAll public static void beforeAll() { @@ -46,28 +21,25 @@ public static void afterAll() { SnapshotMatcher.validateSnapshots(); } - static private List spawnCustomFeeListExample() { + private static List spawnCustomFeeListExample() { var returnList = new ArrayList(); returnList.add(new CustomFixedFee() - .setFeeCollectorAccountId(new AccountId(4322)) - .setDenominatingTokenId(new TokenId(483902)) - .setAmount(10) - ); + .setFeeCollectorAccountId(new AccountId(4322)) + .setDenominatingTokenId(new TokenId(483902)) + .setAmount(10)); returnList.add(new CustomFractionalFee() - .setFeeCollectorAccountId(new AccountId(389042)) - .setNumerator(3) - .setDenominator(7) - .setMin(3) - .setMax(100) - ); + .setFeeCollectorAccountId(new AccountId(389042)) + .setNumerator(3) + .setDenominator(7) + .setMin(3) + .setMax(100)); returnList.add(new CustomRoyaltyFee() - .setFeeCollectorAccountId(new AccountId(23423)) - .setNumerator(5) - .setDenominator(8) - .setFallbackFee(new CustomFixedFee() - .setDenominatingTokenId(new TokenId(483902)) - .setAmount(10)) - ); + .setFeeCollectorAccountId(new AccountId(23423)) + .setNumerator(5) + .setDenominator(8) + .setFallbackFee(new CustomFixedFee() + .setDenominatingTokenId(new TokenId(483902)) + .setAmount(10))); return returnList; } diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java b/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java index f05d1acc0a..4a730222a8 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java @@ -1,36 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.TokenId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.FixedFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class CustomFixedFeeTest { private static final boolean allCollectorsAreExempt = true; private static final AccountId feeCollectorAccountId = new AccountId(1, 2, 3); @@ -38,9 +16,9 @@ public class CustomFixedFeeTest { private static final TokenId tokenId = new TokenId(5, 6, 7); private final FixedFee fee = FixedFee.newBuilder() - .setAmount(amount) - .setDenominatingTokenId(tokenId.toProtobuf()) - .build(); + .setAmount(amount) + .setDenominatingTokenId(tokenId.toProtobuf()) + .build(); @BeforeAll public static void beforeAll() { @@ -60,8 +38,8 @@ void fromProtobuf() { @Test void deepCloneSubclass() { var customFixedFee = new CustomFixedFee() - .setFeeCollectorAccountId(feeCollectorAccountId) - .setAllCollectorsAreExempt(allCollectorsAreExempt); + .setFeeCollectorAccountId(feeCollectorAccountId) + .setAllCollectorsAreExempt(allCollectorsAreExempt); var clonedCustomFixedFee = customFixedFee.deepCloneSubclass(); assertThat(clonedCustomFixedFee.getFeeCollectorAccountId()).isEqualTo(feeCollectorAccountId); @@ -70,12 +48,15 @@ void deepCloneSubclass() { @Test void toProtobuf() { - SnapshotMatcher.expect(CustomFixedFee.fromProtobuf(fee).toProtobuf().toString()).toMatchSnapshot(); + SnapshotMatcher.expect(CustomFixedFee.fromProtobuf(fee).toProtobuf().toString()) + .toMatchSnapshot(); } @Test void toFixedFeeProtobuf() { - SnapshotMatcher.expect(CustomFixedFee.fromProtobuf(fee).toFixedFeeProtobuf().toString()).toMatchSnapshot(); + SnapshotMatcher.expect( + CustomFixedFee.fromProtobuf(fee).toFixedFeeProtobuf().toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java b/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java index 044f46984c..98141e0079 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java @@ -1,8 +1,8 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.FeeAssessmentMethod; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.Fraction; import com.hiero.sdk.proto.FractionalFee; import io.github.jsonSnapshot.SnapshotMatcher; @@ -10,8 +10,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class CustomFractionalFeeTest { private static final boolean allCollectorsAreExempt = true; private static final AccountId feeCollectorAccountId = new AccountId(1, 2, 3); @@ -22,11 +20,11 @@ public class CustomFractionalFeeTest { private static final FeeAssessmentMethod feeAssessmentMethod = FeeAssessmentMethod.EXCLUSIVE; private final FractionalFee fee = FractionalFee.newBuilder() - .setFractionalAmount(Fraction.newBuilder().setNumerator(numerator).setDenominator(denominator)) - .setMinimumAmount(minAmount) - .setMaximumAmount(maxAmount) - .setNetOfTransfers(true) - .build(); + .setFractionalAmount(Fraction.newBuilder().setNumerator(numerator).setDenominator(denominator)) + .setMinimumAmount(minAmount) + .setMaximumAmount(maxAmount) + .setNetOfTransfers(true) + .build(); @BeforeAll public static void beforeAll() { @@ -46,8 +44,8 @@ void fromProtobuf() { @Test void deepCloneSubclass() { var customFractionalFee = new CustomFractionalFee() - .setFeeCollectorAccountId(feeCollectorAccountId) - .setAllCollectorsAreExempt(allCollectorsAreExempt); + .setFeeCollectorAccountId(feeCollectorAccountId) + .setAllCollectorsAreExempt(allCollectorsAreExempt); var clonedCustomFractionalFee = customFractionalFee.deepCloneSubclass(); assertThat(clonedCustomFractionalFee.getFeeCollectorAccountId()).isEqualTo(feeCollectorAccountId); @@ -56,7 +54,9 @@ void deepCloneSubclass() { @Test void toProtobuf() { - SnapshotMatcher.expect(CustomFractionalFee.fromProtobuf(fee).toProtobuf().toString()).toMatchSnapshot(); + SnapshotMatcher.expect( + CustomFractionalFee.fromProtobuf(fee).toProtobuf().toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java b/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java index ba2057e838..d151bf1adc 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java @@ -1,27 +1,8 @@ -/*- - * - * Hedera C++ SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomRoyaltyFee; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.FixedFee; import com.hiero.sdk.proto.Fraction; import com.hiero.sdk.proto.RoyaltyFee; @@ -30,8 +11,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class CustomRoyaltyFeeTest { private static final boolean allCollectorsAreExempt = true; private static final AccountId feeCollectorAccountId = new AccountId(1, 2, 3); @@ -40,9 +19,10 @@ public class CustomRoyaltyFeeTest { private static final CustomFixedFee fallbackFee = new CustomFixedFee().setAmount(6); private final RoyaltyFee fee = RoyaltyFee.newBuilder() - .setExchangeValueFraction(Fraction.newBuilder().setNumerator(numerator).setDenominator(denominator)) - .setFallbackFee(FixedFee.newBuilder().setAmount(6).build()) - .build(); + .setExchangeValueFraction( + Fraction.newBuilder().setNumerator(numerator).setDenominator(denominator)) + .setFallbackFee(FixedFee.newBuilder().setAmount(6).build()) + .build(); @BeforeAll public static void beforeAll() { @@ -62,8 +42,8 @@ void fromProtobuf() { @Test void deepCloneSubclass() { var customRoyaltyFee = new CustomRoyaltyFee() - .setFeeCollectorAccountId(feeCollectorAccountId) - .setAllCollectorsAreExempt(allCollectorsAreExempt); + .setFeeCollectorAccountId(feeCollectorAccountId) + .setAllCollectorsAreExempt(allCollectorsAreExempt); var clonedCustomRoyaltyFee = customRoyaltyFee.deepCloneSubclass(); assertThat(clonedCustomRoyaltyFee.getFeeCollectorAccountId()).isEqualTo(feeCollectorAccountId); @@ -72,7 +52,8 @@ void deepCloneSubclass() { @Test void toProtobuf() { - SnapshotMatcher.expect(CustomRoyaltyFee.fromProtobuf(fee).toProtobuf().toString()).toMatchSnapshot(); + SnapshotMatcher.expect(CustomRoyaltyFee.fromProtobuf(fee).toProtobuf().toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java index e8fbb3f185..b8efc2fe99 100644 --- a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java @@ -1,26 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.DelegateContractId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; @@ -40,27 +21,35 @@ public static void afterAll() { @Test void fromString() { - SnapshotMatcher.expect(DelegateContractId.fromString("0.0.5005").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(DelegateContractId.fromString("0.0.5005").toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddress() { - SnapshotMatcher.expect(DelegateContractId.fromSolidityAddress("000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(DelegateContractId.fromSolidityAddress("000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddressWith0x() { - SnapshotMatcher.expect(DelegateContractId.fromSolidityAddress("0x000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(DelegateContractId.fromSolidityAddress("0x000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test void toBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(Hex.toHexString(new DelegateContractId(5005).toBytes())).toMatchSnapshot(); + SnapshotMatcher.expect(Hex.toHexString(new DelegateContractId(5005).toBytes())) + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(DelegateContractId.fromBytes(new DelegateContractId(5005).toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect(DelegateContractId.fromBytes(new DelegateContractId(5005).toBytes()) + .toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java index eb74688794..db15c800ad 100644 --- a/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java @@ -1,13 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.TransactionId; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import java.util.HashSet; - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; public class DuplicateTransactionTest { diff --git a/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java b/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java index bb0399dad2..886fe79f9e 100644 --- a/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java @@ -1,34 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.PrivateKey; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.utils.Bip32Utils; +import java.io.IOException; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.io.IOException; - -import static org.assertj.core.api.Assertions.assertThat; - public class ECDSAPrivateKeyTest { private static final String TEST_VECTOR_PEM_PASSPHRASE = "asdasd123"; @@ -139,8 +119,7 @@ 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)); + data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); } return data; } @@ -240,10 +219,12 @@ void slip10TestVector2() { final String PRIVATE_KEY6 = "bb7d39bdb83ecf58f2fd82b6d918341cbef428661ef01ab97c28a4842125ac23"; final String PUBLIC_KEY6 = "024d902e1a2fc7a8755ab5b694c575fce742c48d9ff192e63df5193e4c7afe1f9c"; - var seed = hexStringToByteArray("fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542"); + var seed = hexStringToByteArray( + "fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542"); // Chain m - PrivateKey key1 = PrivateKey.fromSeedECDSAsecp256k1(seed);; + PrivateKey key1 = PrivateKey.fromSeedECDSAsecp256k1(seed); + ; assertThat(Hex.toHexString(key1.getChainCode().getKey())).isEqualTo(CHAIN_CODE1); assertThat(key1.toStringRaw()).isEqualTo(PRIVATE_KEY1); assertThat(key1.getPublicKey().toStringRaw()).isSubstringOf(PUBLIC_KEY1); @@ -283,39 +264,37 @@ void slip10TestVector2() { @DisplayName("PEM import test vectors") void PEMImportTestVectors() throws IOException { // https://github.com/hashgraph/hedera-sdk-reference/issues/93#issue-1665972122 - var PRIVATE_KEY_PEM1 = "-----BEGIN EC PRIVATE KEY-----\n" + - "MHQCAQEEIG8I+jKi+iGVa7ttbfnlnML5AdvPugbgBWnseYjrle6qoAcGBSuBBAAK\n" + - "oUQDQgAEqf5BmMeBzkU1Ra9UAbZJo3tytVOlb7erTc36LRLP20mOLU7+mFY+3Cfe\n" + - "fAZgBtPXRAmDtRvYGODswAalW85GKA==\n" + - "-----END EC PRIVATE KEY-----"; + var PRIVATE_KEY_PEM1 = "-----BEGIN EC PRIVATE KEY-----\n" + + "MHQCAQEEIG8I+jKi+iGVa7ttbfnlnML5AdvPugbgBWnseYjrle6qoAcGBSuBBAAK\n" + + "oUQDQgAEqf5BmMeBzkU1Ra9UAbZJo3tytVOlb7erTc36LRLP20mOLU7+mFY+3Cfe\n" + + "fAZgBtPXRAmDtRvYGODswAalW85GKA==\n" + + "-----END EC PRIVATE KEY-----"; var PRIVATE_KEY1 = "6f08fa32a2fa21956bbb6d6df9e59cc2f901dbcfba06e00569ec7988eb95eeaa"; var PUBLIC_KEY1 = "02a9fe4198c781ce453545af5401b649a37b72b553a56fb7ab4dcdfa2d12cfdb49"; - var PRIVATE_KEY_PEM2 = "-----BEGIN EC PRIVATE KEY-----\n" + - "MFQCAQEEIOHyhclwHbha3f281Kvd884rhBzltxGJxCZyaQCagH9joAcGBSuBBAAK\n" + - "oSQDIgACREr6gFZa4K7hBP+bA25VdgQ+0ABFgM+g5RYw/W6T1Og=\n" + - "-----END EC PRIVATE KEY-----"; + var PRIVATE_KEY_PEM2 = "-----BEGIN EC PRIVATE KEY-----\n" + + "MFQCAQEEIOHyhclwHbha3f281Kvd884rhBzltxGJxCZyaQCagH9joAcGBSuBBAAK\n" + + "oSQDIgACREr6gFZa4K7hBP+bA25VdgQ+0ABFgM+g5RYw/W6T1Og=\n" + + "-----END EC PRIVATE KEY-----"; var PRIVATE_KEY2 = "e1f285c9701db85addfdbcd4abddf3ce2b841ce5b71189c4267269009a807f63"; var PUBLIC_KEY2 = "02444afa80565ae0aee104ff9b036e5576043ed0004580cfa0e51630fd6e93d4e8"; - var PRIVATE_KEY_PEM3 = "-----BEGIN EC PRIVATE KEY-----\n" + - "Proc-Type: 4,ENCRYPTED\n" + - "DEK-Info: AES-128-CBC,0046A9EED8D16F0CAA66A197CE8BE8BD\n" + - "\n" + - "9VU9gReUmrn4XywjMx0F0A3oGzpHIksEXma72TCSdcxI7zHy0mtzuGq4Wd25O38s\n" + - "H9c6kvhTPS1N/c6iNhx154B0HUoND8jvAvfxbGR/R87vpZJsOoKCmRxGqrxG8HER\n" + - "FIHQ1jy16DrAbU95kDyLsiF1dy2vUY/HoqFZwxl/IVc=\n" + - "-----END EC PRIVATE KEY-----"; + var PRIVATE_KEY_PEM3 = "-----BEGIN EC PRIVATE KEY-----\n" + "Proc-Type: 4,ENCRYPTED\n" + + "DEK-Info: AES-128-CBC,0046A9EED8D16F0CAA66A197CE8BE8BD\n" + + "\n" + + "9VU9gReUmrn4XywjMx0F0A3oGzpHIksEXma72TCSdcxI7zHy0mtzuGq4Wd25O38s\n" + + "H9c6kvhTPS1N/c6iNhx154B0HUoND8jvAvfxbGR/R87vpZJsOoKCmRxGqrxG8HER\n" + + "FIHQ1jy16DrAbU95kDyLsiF1dy2vUY/HoqFZwxl/IVc=\n" + + "-----END EC PRIVATE KEY-----"; var PRIVATE_KEY3 = "cf49eb5206c1b0468854d6ea7b370590619625514f71ff93608a18465e4012ad"; var PUBLIC_KEY3 = "025f0d14a7562d6319e5b8f91620d2ce9ad13d9abf21cfe9bd0a092c0f35bf1701"; - var PRIVATE_KEY_PEM4 = "-----BEGIN EC PRIVATE KEY-----\n" + - "Proc-Type: 4,ENCRYPTED\n" + - "DEK-Info: AES-128-CBC,4A9B3B987EC2EFFA405818327D14FFF7\n" + - "\n" + - "Wh756RkK5fn1Ke2denR1OYfqE9Kr4BXhgrEMTU/6o0SNhMULUhWGHrCWvmNeEQwp\n" + - "ZVZYUxgYoTlJBeREzKAZithcvxIcTbQfLABo1NZbjA6YKqAqlGpM6owwL/f9e2ST\n" + - "-----END EC PRIVATE KEY-----"; + var PRIVATE_KEY_PEM4 = "-----BEGIN EC PRIVATE KEY-----\n" + "Proc-Type: 4,ENCRYPTED\n" + + "DEK-Info: AES-128-CBC,4A9B3B987EC2EFFA405818327D14FFF7\n" + + "\n" + + "Wh756RkK5fn1Ke2denR1OYfqE9Kr4BXhgrEMTU/6o0SNhMULUhWGHrCWvmNeEQwp\n" + + "ZVZYUxgYoTlJBeREzKAZithcvxIcTbQfLABo1NZbjA6YKqAqlGpM6owwL/f9e2ST\n" + + "-----END EC PRIVATE KEY-----"; var PRIVATE_KEY4 = "c0d3e16ba5a1abbeac4cd327a3c3c1cc10438431d0bac019054e573e67768bb5"; var PUBLIC_KEY4 = "02065f736378134c53c7a2ee46f199fb93b9b32337be4e95660677046476995544"; @@ -340,19 +319,23 @@ void PEMImportTestVectors() throws IOException { @DisplayName("DER import test vectors") void DERImportTestVectors() { // https://github.com/hashgraph/hedera-sdk-reference/issues/93#issue-1665972122 - var PRIVATE_KEY_DER1 = "3030020100300706052b8104000a042204208c2cdc9575fe67493443967d74958fd7808a3787fd3337e99cfeebbc7566b586"; + var PRIVATE_KEY_DER1 = + "3030020100300706052b8104000a042204208c2cdc9575fe67493443967d74958fd7808a3787fd3337e99cfeebbc7566b586"; var PRIVATE_KEY1 = "8c2cdc9575fe67493443967d74958fd7808a3787fd3337e99cfeebbc7566b586"; var PUBLIC_KEY1 = "028173079d2e996ef6b2d064fc82d5fc7094367211e28422bec50a2f75c365f5fd"; - var PRIVATE_KEY_DER2 = "30540201010420ac318ea8ff8d991ab2f16172b4738e74dc35a56681199cfb1c0cb2e7cb560ffda00706052b8104000aa124032200036843f5cb338bbb4cdb21b0da4ea739d910951d6e8a5f703d313efe31afe788f4"; + var PRIVATE_KEY_DER2 = + "30540201010420ac318ea8ff8d991ab2f16172b4738e74dc35a56681199cfb1c0cb2e7cb560ffda00706052b8104000aa124032200036843f5cb338bbb4cdb21b0da4ea739d910951d6e8a5f703d313efe31afe788f4"; var PRIVATE_KEY2 = "ac318ea8ff8d991ab2f16172b4738e74dc35a56681199cfb1c0cb2e7cb560ffd"; var PUBLIC_KEY2 = "036843f5cb338bbb4cdb21b0da4ea739d910951d6e8a5f703d313efe31afe788f4"; - var PRIVATE_KEY_DER3 = "307402010104208927647ad12b29646a1d051da8453462937bb2c813c6815cac6c0b720526ffc6a00706052b8104000aa14403420004aaac1c3ac1bea0245b8e00ce1e2018f9eab61b6331fbef7266f2287750a6597795f855ddcad2377e22259d1fcb4e0f1d35e8f2056300c15070bcbfce3759cc9d"; + var PRIVATE_KEY_DER3 = + "307402010104208927647ad12b29646a1d051da8453462937bb2c813c6815cac6c0b720526ffc6a00706052b8104000aa14403420004aaac1c3ac1bea0245b8e00ce1e2018f9eab61b6331fbef7266f2287750a6597795f855ddcad2377e22259d1fcb4e0f1d35e8f2056300c15070bcbfce3759cc9d"; var PRIVATE_KEY3 = "8927647ad12b29646a1d051da8453462937bb2c813c6815cac6c0b720526ffc6"; var PUBLIC_KEY3 = "03aaac1c3ac1bea0245b8e00ce1e2018f9eab61b6331fbef7266f2287750a65977"; - var PRIVATE_KEY_DER4 = "302e0201010420a6170a6aa6389a5bd3a3a8f9375f57bd91aa7f7d8b8b46ce0b702e000a21a5fea00706052b8104000a"; + var PRIVATE_KEY_DER4 = + "302e0201010420a6170a6aa6389a5bd3a3a8f9375f57bd91aa7f7d8b8b46ce0b702e000a21a5fea00706052b8104000a"; var PRIVATE_KEY4 = "a6170a6aa6389a5bd3a3a8f9375f57bd91aa7f7d8b8b46ce0b702e000a21a5fe"; var PUBLIC_KEY4 = "03b69a75a5ddb1c0747e995d47555019e5d8a28003ab5202bd92f534361fb4ec8a"; diff --git a/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java b/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java index 7d488f6942..c9ad2a2986 100644 --- a/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java @@ -1,45 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.HbarUnit; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.PublicKeyECDSA; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import java.math.BigDecimal; -import java.util.Collections; - import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import java.math.BigDecimal; +import java.util.Collections; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + public class ECDSAPublicKeyTest { @Test void verifyTransaction() { @@ -84,26 +55,82 @@ void keyByteValidation() { assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyECDSA)); assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(invalidKeyECDSA)); - byte[] invalidCompressedKey = new byte[]{ + byte[] invalidCompressedKey = new byte[] { 0x00, - (byte) 0xca, (byte) 0x35, 0x4b, 0x7c, (byte) 0xf4, (byte) 0x87, (byte) 0xd1, (byte) 0xbc, 0x43, - 0x5a, 0x25, 0x66, 0x77, 0x09, (byte) 0xc1, (byte) 0xab, (byte) 0x98, 0x0c, 0x11, 0x4d, - 0x35, (byte) 0x94, (byte) 0xe6, 0x25, (byte) 0x9e, (byte) 0x81, 0x2e, 0x6a, 0x70, 0x3d, - 0x4f, 0x51 + (byte) 0xca, + (byte) 0x35, + 0x4b, + 0x7c, + (byte) 0xf4, + (byte) 0x87, + (byte) 0xd1, + (byte) 0xbc, + 0x43, + 0x5a, + 0x25, + 0x66, + 0x77, + 0x09, + (byte) 0xc1, + (byte) 0xab, + (byte) 0x98, + 0x0c, + 0x11, + 0x4d, + 0x35, + (byte) 0x94, + (byte) 0xe6, + 0x25, + (byte) 0x9e, + (byte) 0x81, + 0x2e, + 0x6a, + 0x70, + 0x3d, + 0x4f, + 0x51 }; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytesECDSA(invalidCompressedKey)); + .isThrownBy(() -> PublicKey.fromBytesECDSA(invalidCompressedKey)); - byte[] malformedKey = new byte[]{0x00, 0x01, 0x02}; + byte[] malformedKey = new byte[] {0x00, 0x01, 0x02}; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytesECDSA(malformedKey)); + .isThrownBy(() -> PublicKey.fromBytesECDSA(malformedKey)); - byte[] validCompressedKey = new byte[]{ + byte[] validCompressedKey = new byte[] { 0x02, // Prefix for compressed keys - (byte) 0xca, (byte) 0x35, 0x4b, 0x7c, (byte) 0xf4, (byte) 0x87, (byte) 0xd1, (byte) 0xbc, 0x43, - 0x5a, 0x25, 0x66, 0x77, 0x09, (byte) 0xc1, (byte) 0xab, (byte) 0x98, 0x0c, 0x1f, 0x4d, - 0x35, (byte) 0x94, (byte) 0xe6, 0x25, (byte) 0x9e, (byte) 0x81, 0x2e, 0x6a, 0x75, 0x3d, - 0x4f, 0x59 + (byte) 0xca, + (byte) 0x35, + 0x4b, + 0x7c, + (byte) 0xf4, + (byte) 0x87, + (byte) 0xd1, + (byte) 0xbc, + 0x43, + 0x5a, + 0x25, + 0x66, + 0x77, + 0x09, + (byte) 0xc1, + (byte) 0xab, + (byte) 0x98, + 0x0c, + 0x1f, + 0x4d, + 0x35, + (byte) 0x94, + (byte) 0xe6, + 0x25, + (byte) 0x9e, + (byte) 0x81, + 0x2e, + 0x6a, + 0x75, + 0x3d, + 0x4f, + 0x59 }; assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(validCompressedKey)); @@ -132,11 +159,10 @@ void keyByteSerializationThroughTransaction() { var receiverAccount = AccountId.fromString("0.0.3"); var transferAmount = Hbar.from(new BigDecimal("0.0001"), HbarUnit.HBAR); var privateKey = PrivateKey.generateECDSA(); - var client = Client.forTestnet() - .setOperator(senderAccount, privateKey); + var client = Client.forTestnet().setOperator(senderAccount, privateKey); var tx = new TransferTransaction() - .addHbarTransfer(senderAccount, transferAmount.negated()) - .addHbarTransfer(receiverAccount, transferAmount); + .addHbarTransfer(senderAccount, transferAmount.negated()) + .addHbarTransfer(receiverAccount, transferAmount); tx.freezeWith(client); tx.signWithOperator(client); @@ -227,13 +253,16 @@ void toEvmAddress() { @DisplayName("DER import test vectors") void DERImportTestVectors() { // https://github.com/hashgraph/hedera-sdk-reference/issues/93#issue-1665972122 - var PUBLIC_KEY_DER1 = "302d300706052b8104000a032200028173079d2e996ef6b2d064fc82d5fc7094367211e28422bec50a2f75c365f5fd"; + var PUBLIC_KEY_DER1 = + "302d300706052b8104000a032200028173079d2e996ef6b2d064fc82d5fc7094367211e28422bec50a2f75c365f5fd"; var PUBLIC_KEY1 = "028173079d2e996ef6b2d064fc82d5fc7094367211e28422bec50a2f75c365f5fd"; - var PUBLIC_KEY_DER2 = "3036301006072a8648ce3d020106052b8104000a032200036843f5cb338bbb4cdb21b0da4ea739d910951d6e8a5f703d313efe31afe788f4"; + var PUBLIC_KEY_DER2 = + "3036301006072a8648ce3d020106052b8104000a032200036843f5cb338bbb4cdb21b0da4ea739d910951d6e8a5f703d313efe31afe788f4"; var PUBLIC_KEY2 = "036843f5cb338bbb4cdb21b0da4ea739d910951d6e8a5f703d313efe31afe788f4"; - var PUBLIC_KEY_DER3 = "3056301006072a8648ce3d020106052b8104000a03420004aaac1c3ac1bea0245b8e00ce1e2018f9eab61b6331fbef7266f2287750a6597795f855ddcad2377e22259d1fcb4e0f1d35e8f2056300c15070bcbfce3759cc9d"; + var PUBLIC_KEY_DER3 = + "3056301006072a8648ce3d020106052b8104000a03420004aaac1c3ac1bea0245b8e00ce1e2018f9eab61b6331fbef7266f2287750a6597795f855ddcad2377e22259d1fcb4e0f1d35e8f2056300c15070bcbfce3759cc9d"; var PUBLIC_KEY3 = "03aaac1c3ac1bea0245b8e00ce1e2018f9eab61b6331fbef7266f2287750a65977"; var ecdsaPublicKey1 = PublicKey.fromStringDER(PUBLIC_KEY_DER1); diff --git a/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java b/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java index c6bb9715e5..6d29b65c87 100644 --- a/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java @@ -1,27 +1,13 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.BadKeyException; -import com.hiero.sdk.Mnemonic; -import com.hiero.sdk.PrivateKey; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.util.stream.Stream; import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; @@ -29,69 +15,69 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import java.io.IOException; -import java.io.StringReader; -import java.nio.charset.StandardCharsets; -import java.util.stream.Stream; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class Ed25519PrivateKeyTest { - private static final String TEST_KEY_STR = "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"; + private static final String TEST_KEY_STR = + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"; private static final String TEST_KEY_STR_RAW = "db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"; private static final String TEST_KEY_PEM = "-----BEGIN PRIVATE KEY-----\n" - + "MC4CAQAwBQYDK2VwBCIEINtIS4KOZLLY8SzjwKDpOguMznrxu485yXcyOUSCU44Q\n" - + "-----END PRIVATE KEY-----\n"; + + "MC4CAQAwBQYDK2VwBCIEINtIS4KOZLLY8SzjwKDpOguMznrxu485yXcyOUSCU44Q\n" + + "-----END PRIVATE KEY-----\n"; // generated by hedera-sdk-js, not used anywhere - private static final String MNEMONIC_STRING = "inmate flip alley wear offer often piece magnet surge toddler submit right radio absent pear floor belt raven price stove replace reduce plate home"; - private static final String MNEMONIC_PRIVATE_KEY = "302e020100300506032b657004220420853f15aecd22706b105da1d709b4ac05b4906170c2b9c7495dff9af49e1391da"; + private static final String MNEMONIC_STRING = + "inmate flip alley wear offer often piece magnet surge toddler submit right radio absent pear floor belt raven price stove replace reduce plate home"; + private static final String MNEMONIC_PRIVATE_KEY = + "302e020100300506032b657004220420853f15aecd22706b105da1d709b4ac05b4906170c2b9c7495dff9af49e1391da"; - private static final String MNEMONIC_LEGACY_STRING = "jolly kidnap tom lawn drunk chick optic lust mutter mole bride galley dense member sage neural widow decide curb aboard margin manure"; - private static final String MNEMONIC_LEGACY_PRIVATE_KEY = "302e020100300506032b657004220420882a565ad8cb45643892b5366c1ee1c1ef4a730c5ce821a219ff49b6bf173ddf"; + private static final String MNEMONIC_LEGACY_STRING = + "jolly kidnap tom lawn drunk chick optic lust mutter mole bride galley dense member sage neural widow decide curb aboard margin manure"; + private static final String MNEMONIC_LEGACY_PRIVATE_KEY = + "302e020100300506032b657004220420882a565ad8cb45643892b5366c1ee1c1ef4a730c5ce821a219ff49b6bf173ddf"; // backup phrase generated by the iOS wallet, not used anywhere - private static final String IOS_MNEMONIC_STRING = "tiny denial casual grass skull spare awkward indoor ethics dash enough flavor good daughter early hard rug staff capable swallow raise flavor empty angle"; + private static final String IOS_MNEMONIC_STRING = + "tiny denial casual grass skull spare awkward indoor ethics dash enough flavor good daughter early hard rug staff capable swallow raise flavor empty angle"; // private key for "default account", should be index 0 - private static final String IOS_DEFAULT_PRIVATE_KEY = "5f66a51931e8c99089472e0d70516b6272b94dd772b967f8221e1077f966dbda2b60cf7ee8cf10ecd5a076bffad9a7c7b97df370ad758c0f1dd4ef738e04ceb6"; + private static final String IOS_DEFAULT_PRIVATE_KEY = + "5f66a51931e8c99089472e0d70516b6272b94dd772b967f8221e1077f966dbda2b60cf7ee8cf10ecd5a076bffad9a7c7b97df370ad758c0f1dd4ef738e04ceb6"; // backup phrase generated by the Android wallet, also not used anywhere - private static final String ANDROID_MNEMONIC_STRING = "ramp april job flavor surround pyramid fish sea good know blame gate village viable include mixed term draft among monitor swear swing novel track"; + private static final String ANDROID_MNEMONIC_STRING = + "ramp april job flavor surround pyramid fish sea good know blame gate village viable include mixed term draft among monitor swear swing novel track"; // private key for "default account", should be index 0 - private static final String ANDROID_DEFAULT_PRIVATE_KEY = "c284c25b3a1458b59423bc289e83703b125c8eefec4d5aa1b393c2beb9f2bae66188a344ba75c43918ab12fa2ea4a92960eca029a2320d8c6a1c3b94e06c9985"; + private static final String ANDROID_DEFAULT_PRIVATE_KEY = + "c284c25b3a1458b59423bc289e83703b125c8eefec4d5aa1b393c2beb9f2bae66188a344ba75c43918ab12fa2ea4a92960eca029a2320d8c6a1c3b94e06c9985"; private static final String PEM_PASSPHRASE = "this is a passphrase"; private static final String TEST_VECTOR_PEM_PASSPHRASE = "asdasd123"; /* - # enter passphrase "this is a passphrase" - echo '302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10' \ - | xxd -r -p \ - | openssl pkey -inform der -aes-128-cbc - */ + # enter passphrase "this is a passphrase" + echo '302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10' \ + | xxd -r -p \ + | openssl pkey -inform der -aes-128-cbc + */ private static final String ENCRYPTED_PEM = "-----BEGIN ENCRYPTED PRIVATE KEY-----\n" - + "MIGbMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAi8WY7Gy2tThQICCAAw\n" - + "DAYIKoZIhvcNAgkFADAdBglghkgBZQMEAQIEEOq46NPss58chbjUn20NoK0EQG1x\n" - + "R88hIXcWDOECttPTNlMXWJt7Wufm1YwBibrxmCq1QykIyTYhy1TZMyxyPxlYW6aV\n" - + "9hlo4YEh3uEaCmfJzWM=\n" - + "-----END ENCRYPTED PRIVATE KEY-----\n"; + + "MIGbMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAi8WY7Gy2tThQICCAAw\n" + + "DAYIKoZIhvcNAgkFADAdBglghkgBZQMEAQIEEOq46NPss58chbjUn20NoK0EQG1x\n" + + "R88hIXcWDOECttPTNlMXWJt7Wufm1YwBibrxmCq1QykIyTYhy1TZMyxyPxlYW6aV\n" + + "9hlo4YEh3uEaCmfJzWM=\n" + + "-----END ENCRYPTED PRIVATE KEY-----\n"; private static final String MESSAGE_STR = "This is a message about the world."; private static final byte[] MESSAGE_BYTES = MESSAGE_STR.getBytes(StandardCharsets.UTF_8); - private static final String SIG_STR = "73bea53f31ca9c42a422ecb7516ec08d0bbd1a6bfd630ccf10ec1872454814d29f4a8011129cd007eab544af01a75f508285b591e5bed24b68f927751e49e30e"; + private static final String SIG_STR = + "73bea53f31ca9c42a422ecb7516ec08d0bbd1a6bfd630ccf10ec1872454814d29f4a8011129cd007eab544af01a75f508285b591e5bed24b68f927751e49e30e"; @SuppressWarnings("unused") private static Stream privKeyStrings() { return Stream.of( - TEST_KEY_STR, - // raw hex (concatenated private + public key) - TEST_KEY_STR_RAW + - "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", - // raw hex (just private key) - TEST_KEY_STR_RAW - ); + TEST_KEY_STR, + // raw hex (concatenated private + public key) + TEST_KEY_STR_RAW + "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", + // raw hex (just private key) + TEST_KEY_STR_RAW); } @Test @@ -186,14 +172,14 @@ void keyStringification3() { @ParameterizedTest @DisplayName("private key can be recovered from external string") - @ValueSource(strings = { - TEST_KEY_STR, - // raw hex (concatenated private + public key) - TEST_KEY_STR_RAW + - "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", - // raw hex (just private key) - TEST_KEY_STR_RAW - }) + @ValueSource( + strings = { + TEST_KEY_STR, + // raw hex (concatenated private + public key) + TEST_KEY_STR_RAW + "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", + // raw hex (just private key) + TEST_KEY_STR_RAW + }) void externalKeyDeserialize(String keyStr) { PrivateKey key = PrivateKey.fromString(keyStr); assertThat(key).isNotNull(); @@ -283,14 +269,8 @@ void keyFromGeneratedMnemonic24() { byte[] signature = privateKey.sign(messageToSign); assertThat(Ed25519.verify( - signature, - 0, - privateKey.getPublicKey().toBytes(), - 0, - messageToSign, - 0, - messageToSign.length - )).isTrue(); + signature, 0, privateKey.getPublicKey().toBytes(), 0, messageToSign, 0, messageToSign.length)) + .isTrue(); } @Test @@ -304,14 +284,8 @@ void keyFromGeneratedMnemonic12() { byte[] signature = privateKey.sign(messageToSign); assertThat(Ed25519.verify( - signature, - 0, - privateKey.getPublicKey().toBytes(), - 0, - messageToSign, - 0, - messageToSign.length - )).isTrue(); + signature, 0, privateKey.getPublicKey().toBytes(), 0, messageToSign, 0, messageToSign.length)) + .isTrue(); } @Test @@ -324,29 +298,29 @@ void keyFromEncryptedPem() throws IOException { @Test @DisplayName("fromPem() with encrypted key without a passphrase throws useful error") void errorKeyFromEncryptedPemNoPassphrase() { - assertThatExceptionOfType(BadKeyException.class).isThrownBy( - () -> PrivateKey.fromPem(ENCRYPTED_PEM) - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo( - "PEM file contained an encrypted private key but no passphrase was given" - )); + assertThatExceptionOfType(BadKeyException.class) + .isThrownBy(() -> PrivateKey.fromPem(ENCRYPTED_PEM)) + .satisfies(error -> assertThat(error.getMessage()) + .isEqualTo("PEM file contained an encrypted private key but no passphrase was given")); } @ParameterizedTest @DisplayName("reproducible signature can be computed") - @ValueSource(strings = { - TEST_KEY_STR, - // raw hex (concatenated private + public key) - TEST_KEY_STR_RAW + - "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", - // raw hex (just private key) - TEST_KEY_STR_RAW - }) + @ValueSource( + strings = { + TEST_KEY_STR, + // raw hex (concatenated private + public key) + TEST_KEY_STR_RAW + "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", + // raw hex (just private key) + TEST_KEY_STR_RAW + }) void reproducibleSignature(String keyStr) { PrivateKey key = PrivateKey.fromString(keyStr); byte[] signature = key.sign(MESSAGE_BYTES); assertThat(Hex.toHexString(signature)).isEqualTo(SIG_STR); } + @Test @DisplayName("private key is is ECDSA") void keyIsECDSA() { @@ -368,8 +342,7 @@ 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)); + data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); } return data; } @@ -469,7 +442,8 @@ void slip10TestVector2() { final String PRIVATE_KEY6 = "551d333177df541ad876a60ea71f00447931c0a9da16f227c11ea080d7391b8d"; final String PUBLIC_KEY6 = "0047150c75db263559a70d5778bf36abbab30fb061ad69f69ece61a72b0cfa4fc0"; - var seed = hexStringToByteArray("fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542"); + var seed = hexStringToByteArray( + "fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542"); // Chain m PrivateKey key1 = PrivateKey.fromSeedED25519(seed); @@ -512,18 +486,17 @@ void slip10TestVector2() { @DisplayName("PEM import test vectors") void PEMImportTestVectors() throws IOException { // https://github.com/hashgraph/hedera-sdk-reference/issues/93#issue-1665972122 - var PRIVATE_KEY_PEM1 = "-----BEGIN PRIVATE KEY-----\n" + - "MC4CAQAwBQYDK2VwBCIEIOgbjaHgEqF7PY0t2dUf2VU0u1MRoKii/fywDlze4lvl\n" + - "-----END PRIVATE KEY-----"; + var PRIVATE_KEY_PEM1 = "-----BEGIN PRIVATE KEY-----\n" + + "MC4CAQAwBQYDK2VwBCIEIOgbjaHgEqF7PY0t2dUf2VU0u1MRoKii/fywDlze4lvl\n" + "-----END PRIVATE KEY-----"; var PRIVATE_KEY1 = "e81b8da1e012a17b3d8d2dd9d51fd95534bb5311a0a8a2fdfcb00e5cdee25be5"; var PUBLIC_KEY1 = "f7b9aa4a8e4eee94e4277dfe757d8d7cde027e7cd5349b7d8e6ee21c9b9395be"; - var PRIVATE_KEY_PEM2 = "-----BEGIN ENCRYPTED PRIVATE KEY-----\n" + - "MIGbMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAiho4GvPxvL6wICCAAw\n" + - "DAYIKoZIhvcNAgkFADAdBglghkgBZQMEAQIEEIdsubXR0QvxXGSprqDuDXwEQJZl\n" + - "OBtwm2p2P7WrWE0OnjGxUe24fWwdrvJUuguFtH3FVWc8C5Jbxgbyxsuzbf+utNL6\n" + - "0ey+WdbGL06Bw0HGqs8=\n" + - "-----END ENCRYPTED PRIVATE KEY-----"; + var PRIVATE_KEY_PEM2 = "-----BEGIN ENCRYPTED PRIVATE KEY-----\n" + + "MIGbMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAiho4GvPxvL6wICCAAw\n" + + "DAYIKoZIhvcNAgkFADAdBglghkgBZQMEAQIEEIdsubXR0QvxXGSprqDuDXwEQJZl\n" + + "OBtwm2p2P7WrWE0OnjGxUe24fWwdrvJUuguFtH3FVWc8C5Jbxgbyxsuzbf+utNL6\n" + + "0ey+WdbGL06Bw0HGqs8=\n" + + "-----END ENCRYPTED PRIVATE KEY-----"; var PRIVATE_KEY2 = "fa0857e963946d5f5e035684c40354d3cd3dcc80c0fb77beac2ef7c4b5271599"; var PUBLIC_KEY2 = "202af61e141465d4bf2c356d37d18bd026c246bde4eb73258722ad11f790be4e"; @@ -540,7 +513,8 @@ void PEMImportTestVectors() throws IOException { @DisplayName("DER import test vectors") void DERImportTestVectors() { // https://github.com/hashgraph/hedera-sdk-reference/issues/93#issue-1665972122 - var PRIVATE_KEY_DER1 = "302e020100300506032b657004220420feb858a4a69600a5eef2d9c76f7fb84fc0b6627f29e0ab17e160f640c267d404"; + var PRIVATE_KEY_DER1 = + "302e020100300506032b657004220420feb858a4a69600a5eef2d9c76f7fb84fc0b6627f29e0ab17e160f640c267d404"; var PRIVATE_KEY1 = "feb858a4a69600a5eef2d9c76f7fb84fc0b6627f29e0ab17e160f640c267d404"; var PUBLIC_KEY1 = "8ccd31b53d1835b467aac795dab19b274dd3b37e3daf12fcec6bc02bac87b53d"; diff --git a/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java b/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java index d6f64ed289..7b7fc26833 100644 --- a/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java @@ -1,50 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.HbarUnit; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.PublicKeyED25519; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatNoException; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + +import java.math.BigDecimal; +import java.util.Collections; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import java.math.BigDecimal; -import java.util.Collections; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatNoException; -import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; - class Ed25519PublicKeyTest { - private static final String TEST_KEY_STR = "302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7"; + private static final String TEST_KEY_STR = + "302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7"; private static final String TEST_KEY_STR_RAW = "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7"; @Test @@ -66,19 +38,47 @@ void keyByteValidation() { Assertions.assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyED25519)); assertDoesNotThrow(() -> PublicKey.fromBytesED25519(invalidKeyED25519)); - byte[] invalidKey = new byte[]{ + byte[] invalidKey = new byte[] { 0x00, - (byte) 0xca, (byte) 0x35, 0x4b, 0x7c, (byte) 0xf4, (byte) 0x87, (byte) 0xd1, (byte) 0xbc, 0x43, - 0x5a, 0x25, 0x66, 0x77, 0x09, (byte) 0xc1, (byte) 0xab, (byte) 0x98, 0x0c, 0x11, 0x4d, - 0x35, (byte) 0x94, (byte) 0xe6, 0x25, (byte) 0x9e, (byte) 0x81, 0x2e, 0x6a, 0x70, 0x3d, - 0x4f, 0x51 + (byte) 0xca, + (byte) 0x35, + 0x4b, + 0x7c, + (byte) 0xf4, + (byte) 0x87, + (byte) 0xd1, + (byte) 0xbc, + 0x43, + 0x5a, + 0x25, + 0x66, + 0x77, + 0x09, + (byte) 0xc1, + (byte) 0xab, + (byte) 0x98, + 0x0c, + 0x11, + 0x4d, + 0x35, + (byte) 0x94, + (byte) 0xe6, + 0x25, + (byte) 0x9e, + (byte) 0x81, + 0x2e, + 0x6a, + 0x70, + 0x3d, + 0x4f, + 0x51 }; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytesED25519(invalidKey)); + .isThrownBy(() -> PublicKey.fromBytesED25519(invalidKey)); - byte[] malformedKey = new byte[]{0x00, 0x01, 0x02}; + byte[] malformedKey = new byte[] {0x00, 0x01, 0x02}; assertThatExceptionOfType(IllegalArgumentException.class) - .isThrownBy(() -> PublicKey.fromBytesED25519(malformedKey)); + .isThrownBy(() -> PublicKey.fromBytesED25519(malformedKey)); byte[] validKey = PrivateKey.generateED25519().getPublicKey().toBytes(); assertDoesNotThrow(() -> PublicKey.fromBytesED25519(validKey)); @@ -133,11 +133,10 @@ void keyByteSerializationThroughTransaction() { var receiverAccount = AccountId.fromString("0.0.3"); var transferAmount = Hbar.from(new BigDecimal("0.0001"), HbarUnit.HBAR); var privateKey = PrivateKey.generateED25519(); - var client = Client.forTestnet() - .setOperator(senderAccount, privateKey); + var client = Client.forTestnet().setOperator(senderAccount, privateKey); var tx = new TransferTransaction() - .addHbarTransfer(senderAccount, transferAmount.negated()) - .addHbarTransfer(receiverAccount, transferAmount); + .addHbarTransfer(senderAccount, transferAmount.negated()) + .addHbarTransfer(receiverAccount, transferAmount); tx.freezeWith(client); tx.signWithOperator(client); @@ -195,12 +194,13 @@ void keyStringSerialization3() { @ParameterizedTest @DisplayName("public key can be recovered from external string") - @ValueSource(strings = { - // ASN1 encoded hex - "302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", - // raw hex - "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", - }) + @ValueSource( + strings = { + // ASN1 encoded hex + "302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", + // raw hex + "e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7", + }) void externalKeyDeserialize(String keyStr) { PublicKey key = PublicKey.fromString(keyStr); assertThat(key).isNotNull(); @@ -239,7 +239,8 @@ void keyIsNotEd25519() { @DisplayName("DER import test vectors") void DERImportTestVectors() { // https://github.com/hashgraph/hedera-sdk-reference/issues/93#issue-1665972122 - var PUBLIC_KEY_DER1 = "302a300506032b65700321008ccd31b53d1835b467aac795dab19b274dd3b37e3daf12fcec6bc02bac87b53d"; + var PUBLIC_KEY_DER1 = + "302a300506032b65700321008ccd31b53d1835b467aac795dab19b274dd3b37e3daf12fcec6bc02bac87b53d"; var PUBLIC_KEY1 = "8ccd31b53d1835b467aac795dab19b274dd3b37e3daf12fcec6bc02bac87b53d"; var ed25519PublicKey1 = PublicKey.fromStringDER(PUBLIC_KEY_DER1); diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java b/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java index ca33dfeb29..6ef2432d24 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java +++ b/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java @@ -1,11 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.EthereumFlow; -import com.hiero.sdk.EthereumTransactionData; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.proto.FileID; import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.ResponseCodeEnum; @@ -15,38 +13,41 @@ import com.hiero.sdk.proto.TransactionGetReceiptResponse; import com.hiero.sdk.proto.TransactionReceipt; import com.hiero.sdk.proto.TransactionResponse; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; - -import static org.assertj.core.api.Assertions.assertThat; - class EthereumFlowMockTest { - static ByteString ETHEREUM_DATA = ByteString.fromHex("f864012f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc18180827653820277a0f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2fa00c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290fb792"); + static ByteString ETHEREUM_DATA = ByteString.fromHex( + "f864012f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc18180827653820277a0f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2fa00c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290fb792"); static ByteString LONG_CALL_DATA = ByteString.fromHex("00".repeat(5121)); @Test - void dontTruncateEthereumDataUnnecessarily() throws PrecheckStatusException, TimeoutException, InterruptedException, ReceiptStatusException { + void dontTruncateEthereumDataUnnecessarily() + throws PrecheckStatusException, TimeoutException, InterruptedException, ReceiptStatusException { List responses1 = List.of( (Function) o -> { var signedTransaction = SignedTransaction.parseFrom(((Transaction) o).getSignedTransactionBytes()); var transactionBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); - assertThat(transactionBody.getDataCase()).isEqualByComparingTo(TransactionBody.DataCase.ETHEREUMTRANSACTION); + assertThat(transactionBody.getDataCase()) + .isEqualByComparingTo(TransactionBody.DataCase.ETHEREUMTRANSACTION); assertThat(transactionBody.hasEthereumTransaction()).isTrue(); - assertThat(transactionBody.getEthereumTransaction().getEthereumData()).isEqualTo(ETHEREUM_DATA); - return TransactionResponse.newBuilder().setNodeTransactionPrecheckCodeValue(0).build(); + assertThat(transactionBody.getEthereumTransaction().getEthereumData()) + .isEqualTo(ETHEREUM_DATA); + return TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCodeValue(0) + .build(); }, Response.newBuilder() .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() - .setReceipt(TransactionReceipt.newBuilder().setStatusValue(ResponseCodeEnum.SUCCESS_VALUE)) - ).build() - ); + .setReceipt( + TransactionReceipt.newBuilder().setStatusValue(ResponseCodeEnum.SUCCESS_VALUE))) + .build()); var responses = List.of(responses1); @@ -59,53 +60,67 @@ void dontTruncateEthereumDataUnnecessarily() throws PrecheckStatusException, Tim } @ParameterizedTest(name = "[{0}] ContractCreateFlow functions") - @CsvSource({ - "sync", - "async" - }) - void extractsCallData(String versionToTest) throws PrecheckStatusException, TimeoutException, InterruptedException, ReceiptStatusException, ExecutionException { + @CsvSource({"sync", "async"}) + void extractsCallData(String versionToTest) + throws PrecheckStatusException, TimeoutException, InterruptedException, ReceiptStatusException, + ExecutionException { List responses1 = List.of( (Function) o -> { var signedTransaction = SignedTransaction.parseFrom(((Transaction) o).getSignedTransactionBytes()); var transactionBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); assertThat(transactionBody.getDataCase()).isEqualByComparingTo(TransactionBody.DataCase.FILECREATE); assertThat(transactionBody.hasFileCreate()).isTrue(); - assertThat(transactionBody.getFileCreate().getContents().size()).isEqualTo(4096); - return TransactionResponse.newBuilder().setNodeTransactionPrecheckCodeValue(0).build(); + assertThat(transactionBody.getFileCreate().getContents().size()) + .isEqualTo(4096); + return TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCodeValue(0) + .build(); }, Response.newBuilder() .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() .setReceipt(TransactionReceipt.newBuilder() .setStatusValue(ResponseCodeEnum.SUCCESS_VALUE) - .setFileID(FileID.newBuilder().setFileNum(1) - ))).build(), + .setFileID(FileID.newBuilder().setFileNum(1)))) + .build(), (Function) o -> { var signedTransaction = SignedTransaction.parseFrom(((Transaction) o).getSignedTransactionBytes()); var transactionBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); assertThat(transactionBody.getDataCase()).isEqualByComparingTo(TransactionBody.DataCase.FILEAPPEND); assertThat(transactionBody.hasFileAppend()).isTrue(); assertThat(transactionBody.getFileAppend().hasFileID()).isTrue(); - assertThat(transactionBody.getFileAppend().getFileID().getFileNum()).isEqualTo(1); + assertThat(transactionBody.getFileAppend().getFileID().getFileNum()) + .isEqualTo(1); assertThat(transactionBody.getFileAppend().getContents()).isEqualTo(LONG_CALL_DATA.substring(4096)); - return TransactionResponse.newBuilder().setNodeTransactionPrecheckCodeValue(0).build(); + return TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCodeValue(0) + .build(); }, Response.newBuilder() .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() - .setReceipt(TransactionReceipt.newBuilder().setStatusValue(ResponseCodeEnum.SUCCESS_VALUE)) - ).build(), + .setReceipt( + TransactionReceipt.newBuilder().setStatusValue(ResponseCodeEnum.SUCCESS_VALUE))) + .build(), (Function) o -> { var signedTransaction = SignedTransaction.parseFrom(((Transaction) o).getSignedTransactionBytes()); var transactionBody = TransactionBody.parseFrom(signedTransaction.getBodyBytes()); - assertThat(transactionBody.getDataCase()).isEqualByComparingTo(TransactionBody.DataCase.ETHEREUMTRANSACTION); + assertThat(transactionBody.getDataCase()) + .isEqualByComparingTo(TransactionBody.DataCase.ETHEREUMTRANSACTION); assertThat(transactionBody.hasEthereumTransaction()).isTrue(); - Assertions.assertThat(EthereumTransactionData.fromBytes(transactionBody.getEthereumTransaction().getEthereumData().toByteArray()).callData).isEmpty(); - return TransactionResponse.newBuilder().setNodeTransactionPrecheckCodeValue(0).build(); + Assertions.assertThat(EthereumTransactionData.fromBytes(transactionBody + .getEthereumTransaction() + .getEthereumData() + .toByteArray()) + .callData) + .isEmpty(); + return TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCodeValue(0) + .build(); }, Response.newBuilder() .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() - .setReceipt(TransactionReceipt.newBuilder().setStatusValue(ResponseCodeEnum.SUCCESS_VALUE)) - ).build() - ); + .setReceipt( + TransactionReceipt.newBuilder().setStatusValue(ResponseCodeEnum.SUCCESS_VALUE))) + .build()); var responses = List.of(responses1); @@ -116,21 +131,19 @@ void extractsCallData(String versionToTest) throws PrecheckStatusException, Time if (versionToTest.equals("sync")) { ethereumFlow = new EthereumFlow() - .setMaxGasAllowance(Hbar.fromTinybars(25)) - .setEthereumData(ethereumData.toBytes()); + .setMaxGasAllowance(Hbar.fromTinybars(25)) + .setEthereumData(ethereumData.toBytes()); - ethereumFlow - .execute(mocker.client) - .getReceipt(mocker.client); + ethereumFlow.execute(mocker.client).getReceipt(mocker.client); } else { ethereumFlow = new EthereumFlow() - .setMaxGasAllowance(Hbar.fromTinybars(25)) - .setEthereumData(ethereumData.toBytes()); + .setMaxGasAllowance(Hbar.fromTinybars(25)) + .setEthereumData(ethereumData.toBytes()); ethereumFlow - .executeAsync(mocker.client) - .thenCompose(response -> response.getReceiptAsync(mocker.client)) - .get(); + .executeAsync(mocker.client) + .thenCompose(response -> response.getReceiptAsync(mocker.client)) + .get(); } assertThat(ethereumFlow.getEthereumData()).isNotNull(); diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java index f6fc5e87be..1488e5b1f6 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java @@ -1,21 +1,19 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.EthereumTransactionData; -import com.hiero.sdk.EthereumTransactionDataEip1559; -import com.hiero.sdk.EthereumTransactionDataLegacy; +import static org.assertj.core.api.Assertions.assertThat; + import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class EthereumTransactionDataLegacyTest { // https://github.com/hashgraph/hedera-services/blob/1e01d9c6b8923639b41359c55413640b589c4ec7/hapi-utils/src/test/java/com/hedera/services/ethereum/EthTxDataTest.java#L49 static final String RAW_TX_TYPE_0 = - "f864012f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc18180827653820277a0f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2fa00c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290fb792"; + "f864012f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc18180827653820277a0f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2fa00c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290fb792"; static final String RAW_TX_TYPE_0_TRIMMED_LAST_BYTES = - "f864012f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc18180827653820277a0f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2fa00c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290000"; + "f864012f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc18180827653820277a0f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2fa00c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290000"; static final String RAW_TX_TYPE_2 = - "02f87082012a022f2f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc181880de0b6b3a764000083123456c001a0df48f2efd10421811de2bfb125ab75b2d3c44139c4642837fb1fccce911fd479a01aaf7ae92bee896651dfc9d99ae422a296bf5d9f1ca49b2d96d82b79eb112d66"; + "02f87082012a022f2f83018000947e3a9eaf9bcc39e2ffa38eb30bf7a93feacbc181880de0b6b3a764000083123456c001a0df48f2efd10421811de2bfb125ab75b2d3c44139c4642837fb1fccce911fd479a01aaf7ae92bee896651dfc9d99ae422a296bf5d9f1ca49b2d96d82b79eb112d66"; @Test public void legacyToFromBytes() { @@ -32,8 +30,10 @@ public void legacyToFromBytes() { assertThat(Hex.toHexString(data.value)).isEqualTo(""); assertThat(Hex.toHexString(data.callData)).isEqualTo("7653"); assertThat(Hex.toHexString(data.v)).isEqualTo("0277"); - assertThat(Hex.toHexString(data.r)).isEqualTo("f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2f"); - assertThat(Hex.toHexString(data.s)).isEqualTo("0c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290fb792"); + assertThat(Hex.toHexString(data.r)) + .isEqualTo("f9fbff985d374be4a55f296915002eec11ac96f1ce2df183adf992baa9390b2f"); + assertThat(Hex.toHexString(data.s)) + .isEqualTo("0c1e867cc960d9c74ec2e6a662b7908ec4c8cc9f3091e886bcefbeb2290fb792"); // We don't currently support a way to get the ethereum has, but we probably should // assertEquals("9ffbd69c44cf643ed8d1e756b505e545e3b5dd3a6b5ef9da1d8eca6679706594", @@ -55,7 +55,9 @@ public void eip1559ToFromBytes() { assertThat(Hex.toHexString(data.callData)).isEqualTo("123456"); assertThat(Hex.toHexString(data.accessList)).isEqualTo(""); assertThat(Hex.toHexString(data.recoveryId)).isEqualTo("01"); - assertThat(Hex.toHexString(data.r)).isEqualTo("df48f2efd10421811de2bfb125ab75b2d3c44139c4642837fb1fccce911fd479"); - assertThat(Hex.toHexString(data.s)).isEqualTo("1aaf7ae92bee896651dfc9d99ae422a296bf5d9f1ca49b2d96d82b79eb112d66"); + assertThat(Hex.toHexString(data.r)) + .isEqualTo("df48f2efd10421811de2bfb125ab75b2d3c44139c4642837fb1fccce911fd479"); + assertThat(Hex.toHexString(data.s)) + .isEqualTo("1aaf7ae92bee896651dfc9d99ae422a296bf5d9f1ca49b2d96d82b79eb112d66"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java index 7c2be9f8b5..a26e668ef6 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java @@ -1,27 +1,19 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.EthereumTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class EthereumTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -37,14 +29,14 @@ public static void afterAll() { EthereumTransaction spawnTestTransaction() { return new EthereumTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setEthereumData(Hex.decode("deadbeef")) - .setCallDataFileId(FileId.fromString("4.5.6")) - .setMaxGasAllowanceHbar(Hbar.fromString("3")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setEthereumData(Hex.decode("deadbeef")) + .setCallDataFileId(FileId.fromString("4.5.6")) + .setMaxGasAllowanceHbar(Hbar.fromString("3")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -56,9 +48,7 @@ void shouldBytesNoSetters() throws Exception { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java b/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java index a134eca94c..04078c9929 100644 --- a/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java @@ -1,35 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.ExchangeRates; +import java.time.Instant; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Test; -import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; - public class ExchangeRatesTest { - private static final String exchangeRateSetHex = "0a1008b0ea0110b6b4231a0608f0bade9006121008b0ea01108cef231a060880d7de9006"; + private static final String exchangeRateSetHex = + "0a1008b0ea0110b6b4231a0608f0bade9006121008b0ea01108cef231a060880d7de9006"; @Test void fromProtobuf() throws InvalidProtocolBufferException { diff --git a/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java b/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java index d955aa51db..75419aa0d2 100644 --- a/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java @@ -1,40 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Executable; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import com.hiero.sdk.Executable.GrpcRequest; -import com.hiero.sdk.ExecutionState; -import com.hiero.sdk.MaxAttemptsExceededException; -import com.hiero.sdk.Network; -import com.hiero.sdk.Node; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Query; -import com.hiero.sdk.Status; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionReceipt; -import com.hiero.sdk.TransactionReceiptQuery; -import com.hiero.sdk.TransactionResponse; import com.hiero.sdk.logger.LogLevel; import com.hiero.sdk.logger.Logger; import com.hiero.sdk.proto.QueryHeader; @@ -43,12 +18,6 @@ import com.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import io.grpc.StatusRuntimeException; -import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.stubbing.Answer; - -import javax.annotation.Nullable; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -58,14 +27,11 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import javax.annotation.Nullable; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.stubbing.Answer; class ExecutableTest { Client client; @@ -91,11 +57,7 @@ void setup() { when(network.getNodeProxies(new AccountId(4))).thenReturn(List.of(node4)); when(network.getNodeProxies(new AccountId(5))).thenReturn(List.of(node5)); - nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); } @Test @@ -112,7 +74,6 @@ void firstNodeHealthy() { Assertions.assertThat(node).isEqualTo(node3); } - @Test void calloptionsShouldRespectGrpcDeadline() { when(node3.isHealthy()).thenReturn(true); @@ -290,33 +251,28 @@ void successfulExecute() throws PrecheckStatusException, TimeoutException { var tx = new DummyTransaction() { @Nullable @Override - TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, - AccountId nodeId, com.hiero.sdk.proto.Transaction request) { + TransactionResponse mapResponse( + com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, + com.hiero.sdk.proto.Transaction request) { return new TransactionResponse( - new AccountId(3), - TransactionId.withValidStart(new AccountId(3), now), - new byte[]{1, 2, 3}, - null) - .setValidateStatus(true); + new AccountId(3), + TransactionId.withValidStart(new AccountId(3), now), + new byte[] {1, 2, 3}, + null) + .setValidateStatus(true); } }; - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = - com.hiero.sdk.proto.TransactionResponse - .newBuilder() + var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute( - client); + com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute(client); assertThat(resp.nodeId).isEqualTo(new AccountId(3)); assertThat(resp.getValidateStatus()).isTrue(); @@ -335,32 +291,27 @@ void executeWithChannelFailure() throws PrecheckStatusException, TimeoutExceptio var tx = new DummyTransaction() { @Nullable @Override - TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, - AccountId nodeId, com.hiero.sdk.proto.Transaction request) { + TransactionResponse mapResponse( + com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, + com.hiero.sdk.proto.Transaction request) { return new TransactionResponse( - new AccountId(4), - TransactionId.withValidStart(new AccountId(4), now), - new byte[]{1, 2, 3}, - null); + new AccountId(4), + TransactionId.withValidStart(new AccountId(4), now), + new byte[] {1, 2, 3}, + null); } }; - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = - com.hiero.sdk.proto.TransactionResponse - .newBuilder() + var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute( - client); + com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute(client); verify(node3).channelFailedToConnect(any(Instant.class)); verify(node4).channelFailedToConnect(any(Instant.class)); @@ -381,8 +332,8 @@ void executeWithAllUnhealthyNodes() throws PrecheckStatusException, TimeoutExcep when(node3.channelFailedToConnect(any(Instant.class))).thenAnswer((Answer) inv -> i.get() == 0); when(node4.channelFailedToConnect(any(Instant.class))).thenAnswer((Answer) inv -> i.get() == 0); - when(node5.channelFailedToConnect(any(Instant.class))).thenAnswer( - (Answer) inv -> i.getAndIncrement() == 0); + when(node5.channelFailedToConnect(any(Instant.class))) + .thenAnswer((Answer) inv -> i.getAndIncrement() == 0); when(node3.getRemainingTimeForBackoff()).thenReturn(500L); when(node4.getRemainingTimeForBackoff()).thenReturn(600L); @@ -392,32 +343,27 @@ void executeWithAllUnhealthyNodes() throws PrecheckStatusException, TimeoutExcep var tx = new DummyTransaction() { @Nullable @Override - TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, - AccountId nodeId, com.hiero.sdk.proto.Transaction request) { + TransactionResponse mapResponse( + com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, + com.hiero.sdk.proto.Transaction request) { return new TransactionResponse( - new AccountId(3), - TransactionId.withValidStart(new AccountId(3), now), - new byte[]{1, 2, 3}, - null); + new AccountId(3), + TransactionId.withValidStart(new AccountId(3), now), + new byte[] {1, 2, 3}, + null); } }; - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = - com.hiero.sdk.proto.TransactionResponse - .newBuilder() + var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute( - client); + com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute(client); verify(node3, times(2)).channelFailedToConnect(any(Instant.class)); verify(node4).channelFailedToConnect(any(Instant.class)); @@ -436,11 +382,7 @@ void executeExhaustRetries() { when(node5.channelFailedToConnect(any(Instant.class))).thenReturn(true); var tx = new DummyTransaction(); - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); assertThatExceptionOfType(MaxAttemptsExceededException.class).isThrownBy(() -> tx.execute(client)); } @@ -456,11 +398,7 @@ void executeRetriableErrorDuringCall() { when(node4.channelFailedToConnect(any(Instant.class))).thenReturn(false); var tx = new DummyTransaction(); - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); tx.blockingUnaryCall = (grpcRequest) -> { @@ -480,11 +418,10 @@ void executeRetriableErrorDuringCall() { @Test void testChannelFailedToConnectTimeout() { TransactionResponse transactionResponse = new TransactionResponse( - new AccountId(3), - TransactionId.withValidStart(new AccountId(3), java.time.Instant.now()), - new byte[]{1, 2, 3}, - null - ); + new AccountId(3), + TransactionId.withValidStart(new AccountId(3), java.time.Instant.now()), + new byte[] {1, 2, 3}, + null); var tx = new DummyTransaction(); tx.blockingUnaryCall = (grpcRequest) -> { @@ -494,8 +431,8 @@ void testChannelFailedToConnectTimeout() { when(node3.isHealthy()).thenReturn(true); when(node3.channelFailedToConnect(any(Instant.class))).thenReturn(true); - assertThatExceptionOfType(MaxAttemptsExceededException.class).isThrownBy( - () -> transactionResponse.getReceipt(client, Duration.ofSeconds(2))); + assertThatExceptionOfType(MaxAttemptsExceededException.class) + .isThrownBy(() -> transactionResponse.getReceipt(client, Duration.ofSeconds(2))); } @Test @@ -518,19 +455,15 @@ ExecutionState getExecutionState(Status status, Response response) { return i.getAndIncrement() == 0 ? ExecutionState.RETRY : ExecutionState.SUCCESS; } }; - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); var receipt = com.hiero.sdk.proto.TransactionReceipt.newBuilder() - .setStatus(ResponseCodeEnum.OK) - .build(); + .setStatus(ResponseCodeEnum.OK) + .build(); var receiptResp = com.hiero.sdk.proto.TransactionGetReceiptResponse.newBuilder() - .setReceipt(receipt) - .build(); + .setReceipt(receipt) + .build(); var resp = Response.newBuilder().setTransactionGetReceipt(receiptResp).build(); tx.blockingUnaryCall = (grpcRequest) -> resp; @@ -540,7 +473,6 @@ ExecutionState getExecutionState(Status status, Response response) { verify(node4).channelFailedToConnect(any(Instant.class)); } - @Test void executeUserError() throws PrecheckStatusException, TimeoutException { when(node3.isHealthy()).thenReturn(true); @@ -552,16 +484,10 @@ Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { return Status.ACCOUNT_DELETED; } }; - var nodeAccountIds = Arrays.asList( - new AccountId(3), - new AccountId(4), - new AccountId(5) - ); + var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = - com.hiero.sdk.proto.TransactionResponse - .newBuilder() + var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.ACCOUNT_DELETED) .build(); @@ -575,12 +501,14 @@ Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { void shouldRetryReturnsCorrectStates() { var tx = new DummyTransaction(); - Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)).isEqualTo( - ExecutionState.SERVER_ERROR); - Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)).isEqualTo(ExecutionState.SERVER_ERROR); + Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)) + .isEqualTo(ExecutionState.SERVER_ERROR); + Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)) + .isEqualTo(ExecutionState.SERVER_ERROR); Assertions.assertThat(tx.getExecutionState(Status.BUSY, null)).isEqualTo(ExecutionState.RETRY); Assertions.assertThat(tx.getExecutionState(Status.OK, null)).isEqualTo(ExecutionState.SUCCESS); - Assertions.assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)).isEqualTo(ExecutionState.REQUEST_ERROR); + Assertions.assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)) + .isEqualTo(ExecutionState.REQUEST_ERROR); } @Test @@ -595,12 +523,11 @@ void shouldSetMaxRetry() { } static class DummyTransaction> - extends - Executable { + extends Executable< + T, com.hiero.sdk.proto.Transaction, com.hiero.sdk.proto.TransactionResponse, TransactionResponse> { @Override - void onExecute(Client client) { - } + void onExecute(Client client) {} @Nullable @Override @@ -616,8 +543,10 @@ com.hiero.sdk.proto.Transaction makeRequest() { @Nullable @Override - TransactionResponse mapResponse(com.hiero.sdk.proto.TransactionResponse response, AccountId nodeId, - com.hiero.sdk.proto.Transaction request) { + TransactionResponse mapResponse( + com.hiero.sdk.proto.TransactionResponse response, + AccountId nodeId, + com.hiero.sdk.proto.Transaction request) { return null; } @@ -628,7 +557,8 @@ Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { @Nullable @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor + getMethodDescriptor() { return null; } @@ -641,12 +571,10 @@ TransactionId getTransactionIdInternal() { static class DummyQuery extends Query { @Override - void onExecute(Client client) { - } + void onExecute(Client client) {} @Override - TransactionReceipt mapResponse(Response response, AccountId nodeId, - com.hiero.sdk.proto.Query request) { + TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { return null; } @@ -661,8 +589,7 @@ MethodDescriptor getMethodDescriptor() { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { - } + void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) {} @Override ResponseHeader mapResponseHeader(Response response) { @@ -675,7 +602,6 @@ QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { } @Override - void validateChecksums(Client client) { - } + void validateChecksums(Client client) {} } } diff --git a/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java b/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java index c141ab2f10..d65342bb0c 100644 --- a/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java @@ -1,17 +1,15 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.FeeAssessmentMethod; +import static org.assertj.core.api.Assertions.assertThat; + import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - class FeeAssessmentMethodTest { @Test void feeAssessmentMethodToString() { - Assertions.assertThat(FeeAssessmentMethod.valueOf(true)) - .hasToString(FeeAssessmentMethod.EXCLUSIVE.toString()); - assertThat(FeeAssessmentMethod.valueOf(false)) - .hasToString(FeeAssessmentMethod.INCLUSIVE.toString()); + Assertions.assertThat(FeeAssessmentMethod.valueOf(true)).hasToString(FeeAssessmentMethod.EXCLUSIVE.toString()); + assertThat(FeeAssessmentMethod.valueOf(false)).hasToString(FeeAssessmentMethod.INCLUSIVE.toString()); } } diff --git a/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java b/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java index e3a12faa0a..be8f9a802a 100644 --- a/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java @@ -1,38 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.FeeComponents; -import com.hiero.sdk.FeeData; -import com.hiero.sdk.FeeSchedule; -import com.hiero.sdk.FeeSchedules; -import com.hiero.sdk.TransactionFeeSchedule; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; - public class FeeSchedulesTest { @BeforeAll public static void beforeAll() { @@ -46,32 +22,22 @@ public static void afterAll() { FeeSchedules spawnFeeSchedulesExample() { return new FeeSchedules() - .setCurrent(new FeeSchedule() - .setExpirationTime(Instant.ofEpochSecond(1554158542)) - .addTransactionFeeSchedule(new TransactionFeeSchedule() - .addFee(new FeeData() - .setNodeData(new FeeComponents()) - .setNetworkData(new FeeComponents() - .setMin(2) - .setMax(5) - ) - .setServiceData(new FeeComponents()) - ) - ) - ) - .setNext(new FeeSchedule() - .setExpirationTime(Instant.ofEpochSecond(1554158222)) - .addTransactionFeeSchedule(new TransactionFeeSchedule() - .addFee(new FeeData() - .setNodeData(new FeeComponents() - .setMin(1) - .setMax(2) - ) - .setNetworkData(new FeeComponents()) - .setServiceData(new FeeComponents()) - ) - ) - ); + .setCurrent(new FeeSchedule() + .setExpirationTime(Instant.ofEpochSecond(1554158542)) + .addTransactionFeeSchedule(new TransactionFeeSchedule() + .addFee(new FeeData() + .setNodeData(new FeeComponents()) + .setNetworkData( + new FeeComponents().setMin(2).setMax(5)) + .setServiceData(new FeeComponents())))) + .setNext(new FeeSchedule() + .setExpirationTime(Instant.ofEpochSecond(1554158222)) + .addTransactionFeeSchedule(new TransactionFeeSchedule() + .addFee(new FeeData() + .setNodeData( + new FeeComponents().setMin(1).setMax(2)) + .setNetworkData(new FeeComponents()) + .setServiceData(new FeeComponents())))); } @Test @@ -80,8 +46,9 @@ void shouldSerialize() throws Exception { byte[] feeSchedulesBytes = originalFeeSchedules.toBytes(); var copyFeeSchedules = FeeSchedules.fromBytes(feeSchedulesBytes); assertThat(copyFeeSchedules.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalFeeSchedules.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalFeeSchedules.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalFeeSchedules.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalFeeSchedules.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java index a496c39d08..c2b7472922 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java @@ -1,100 +1,73 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileAppendTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.proto.FileAppendTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.bouncycastle.util.encoders.Hex; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class FileAppendTransactionTest { - public static final String BIG_CONTENTS = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\n" + - "\n" + - "Suspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\n" + - "\n" + - "Nunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\n" + - "\n" + - "Integer pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\n" + - "\n" + - "Pellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\n" + - "\n" + - "Cras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\n" + - "\n" + - "Ut interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\n" + - "\n" + - "Aenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\n" + - "\n" + - "Pellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\n" + - "\n" + - "In hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\n" + - "\n" + - "Vivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\n" + - "\n" + - "Donec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\n" + - "\n" + - "Fusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\n" + - "\n" + - "Nunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\n" + - "\n" + - "Duis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\n" + - "\n" + - "Mauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\n" + - "\n" + - "Aenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\n" + - "\n" + - "Nunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\n" + - "\n" + - "Mauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\n" + - "\n" + - "Proin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\n" + - "\n" + - "Suspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\n" + - "\n" + - "In consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\n" + - "\n" + - "Etiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\n"; + public static final String BIG_CONTENTS = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\n" + + "\n" + + "Suspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\n" + + "\n" + + "Nunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\n" + + "\n" + + "Integer pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\n" + + "\n" + + "Pellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\n" + + "\n" + + "Cras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\n" + + "\n" + + "Ut interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\n" + + "\n" + + "Aenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\n" + + "\n" + + "Pellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\n" + + "\n" + + "In hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\n" + + "\n" + + "Vivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\n" + + "\n" + + "Donec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\n" + + "\n" + + "Fusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\n" + + "\n" + + "Nunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\n" + + "\n" + + "Duis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\n" + + "\n" + + "Mauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\n" + + "\n" + + "Aenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\n" + + "\n" + + "Nunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\n" + + "\n" + + "Mauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\n" + + "\n" + + "Proin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\n" + + "\n" + + "Suspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\n" + + "\n" + + "In consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\n" + + "\n" + + "Etiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\n"; private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final PrivateKey secondPrivateKey = PrivateKey.fromString( - "302e020100300506032b65700422042099b8587e5abccf6999b0d42b88c581c45284290450487ce90095561c85af11e4" - ); + "302e020100300506032b65700422042099b8587e5abccf6999b0d42b88c581c45284290450487ce90095561c85af11e4"); final Instant validStart = Instant.ofEpochSecond(1554158542); @BeforeAll @@ -110,19 +83,19 @@ public static void afterAll() { @Test void shouldSerialize() { SnapshotMatcher.expect(spawnTestTransaction(Collections.singletonList(AccountId.fromString("0.0.5005"))) - .toString() - ).toMatchSnapshot(); + .toString()) + .toMatchSnapshot(); } private FileAppendTransaction spawnTestTransaction(List accountIds) { return new FileAppendTransaction() - .setNodeAccountIds(accountIds) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(FileId.fromString("0.0.6006")) - .setContents(new byte[]{1, 2, 3, 4}) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(accountIds) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(FileId.fromString("0.0.6006")) + .setContents(new byte[] {1, 2, 3, 4}) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -138,20 +111,19 @@ void shouldSerializeBigContents() { nodeAccountIds.add(AccountId.fromString("0.0.444")); nodeAccountIds.add(AccountId.fromString("0.0.555")); - SnapshotMatcher.expect(spawnTestTransactionBigContents(nodeAccountIds) - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransactionBigContents(nodeAccountIds).toString()) + .toMatchSnapshot(); } private FileAppendTransaction spawnTestTransactionBigContents(ArrayList nodeAccountIds) { return new FileAppendTransaction() - .setNodeAccountIds(nodeAccountIds) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(FileId.fromString("0.0.6006")) - .setContents(BIG_CONTENTS) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(nodeAccountIds) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(FileId.fromString("0.0.6006")) + .setContents(BIG_CONTENTS) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } String hashesToString(List> hashes) { @@ -160,7 +132,11 @@ String hashesToString(List> hashes) { for (var tx : hashes) { outString.append("{"); for (var entry : tx.entrySet()) { - outString.append(entry.getKey().toString()).append("=").append(Hex.toHexString(entry.getValue())).append(", "); + outString + .append(entry.getKey().toString()) + .append("=") + .append(Hex.toHexString(entry.getValue())) + .append(", "); } outString.append("}, "); } @@ -173,11 +149,9 @@ void shouldHash() { nodeAccountIds.add(AccountId.fromString("0.0.444")); nodeAccountIds.add(AccountId.fromString("0.0.555")); - SnapshotMatcher.expect( - hashesToString(spawnTestTransactionBigContents(nodeAccountIds) - .getAllTransactionHashesPerNode() - ) - ).toMatchSnapshot(); + SnapshotMatcher.expect(hashesToString( + spawnTestTransactionBigContents(nodeAccountIds).getAllTransactionHashesPerNode())) + .toMatchSnapshot(); } String signaturesToString(Map> signatures) { @@ -186,7 +160,11 @@ String signaturesToString(Map> signatures) { for (var nodeEntry : signatures.entrySet()) { outString.append(nodeEntry.getKey()).append("={"); for (var sigEntry : nodeEntry.getValue().entrySet()) { - outString.append(sigEntry.getKey()).append("=").append(Hex.toHexString(sigEntry.getValue())).append(", "); + outString + .append(sigEntry.getKey()) + .append("=") + .append(Hex.toHexString(sigEntry.getValue())) + .append(", "); } outString.append("}, "); } @@ -207,9 +185,8 @@ void shouldGetSignatures() { var nodeAccountIds = new ArrayList(); nodeAccountIds.add(AccountId.fromString("0.0.444")); nodeAccountIds.add(AccountId.fromString("0.0.555")); - var signatures = spawnTestTransaction(nodeAccountIds) - .sign(secondPrivateKey) - .getSignatures(); + var signatures = + spawnTestTransaction(nodeAccountIds).sign(secondPrivateKey).getSignatures(); SnapshotMatcher.expect(signaturesToString(signatures)).toMatchSnapshot(); } @@ -219,8 +196,8 @@ void shouldGetAllSignatures() { nodeAccountIds.add(AccountId.fromString("0.0.444")); nodeAccountIds.add(AccountId.fromString("0.0.555")); var signatures = spawnTestTransactionBigContents(nodeAccountIds) - .sign(secondPrivateKey) - .getAllSignatures(); + .sign(secondPrivateKey) + .getAllSignatures(); SnapshotMatcher.expect(allSignaturesToString(signatures)).toMatchSnapshot(); } @@ -240,8 +217,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setFileAppend(FileAppendTransactionBody.newBuilder().build()) - .build(); + .setFileAppend(FileAppendTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java index f7e5fe776c..fa7c497307 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java @@ -1,26 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.FileContentsQuery; -import com.hiero.sdk.FileId; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -42,8 +22,9 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new FileContentsQuery() - .setFileId(FileId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setFileId(FileId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java index e2c3cce498..b6e5831502 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java @@ -1,45 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.FileCreateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class FileCreateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -55,9 +30,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -69,15 +42,15 @@ void shouldBytesNoSetters() throws Exception { private FileCreateTransaction spawnTestTransaction() { return new FileCreateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContents(new byte[]{1, 2, 3, 4}) - .setExpirationTime(Instant.ofEpochSecond(1554158728)) - .setKeys(unusedPrivateKey) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setFileMemo("Hello memo") - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContents(new byte[] {1, 2, 3, 4}) + .setExpirationTime(Instant.ofEpochSecond(1554158728)) + .setKeys(unusedPrivateKey) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setFileMemo("Hello memo") + .freeze() + .sign(unusedPrivateKey); } @Test @@ -90,8 +63,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setFileCreate(FileCreateTransactionBody.newBuilder().build()) - .build(); + .setFileCreate(FileCreateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java index febe7f2be3..d8d43c532d 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.FileDeleteTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class FileDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,9 +30,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -70,12 +42,12 @@ void shouldBytesNoSetters() throws Exception { private FileDeleteTransaction spawnTestTransaction() { return new FileDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(FileId.fromString("0.0.6006")) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(FileId.fromString("0.0.6006")) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -88,8 +60,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setFileDelete(FileDeleteTransactionBody.newBuilder().build()) - .build(); + .setFileDelete(FileDeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/FileIdTest.java b/sdk/src/test/java/com/hiero/sdk/FileIdTest.java index fc9ed32e53..b0bd61c104 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileIdTest.java @@ -1,26 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.FileId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; @@ -48,15 +29,17 @@ void toBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(Hex.toHexString(new FileId(5005).toBytes())).toMatchSnapshot(); } - @Test void fromBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(FileId.fromBytes(new FileId(5005).toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect(FileId.fromBytes(new FileId(5005).toBytes()).toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddress() { - SnapshotMatcher.expect(FileId.fromSolidityAddress("000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(FileId.fromSolidityAddress("000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java index 312214b18d..fbb601f198 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java @@ -1,26 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.FileId; -import com.hiero.sdk.FileInfoQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -42,8 +22,9 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new FileInfoQuery() - .setFileId(FileId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setFileId(FileId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java b/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java index 39b15977a5..911623ef2e 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java @@ -1,54 +1,28 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.FileId; -import com.hiero.sdk.FileInfo; -import com.hiero.sdk.InstantConverter; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.PrivateKey; import com.hiero.sdk.proto.FileGetInfoResponse; import com.hiero.sdk.proto.KeyList; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - - public class FileInfoTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final FileGetInfoResponse.FileInfo info = FileGetInfoResponse.FileInfo.newBuilder() - .setFileID(new FileId(1).toProtobuf()) - .setSize(2) - .setExpirationTime(InstantConverter.toProtobuf(Instant.ofEpochMilli(3))) - .setDeleted(true) - .setKeys(KeyList.newBuilder() - .addKeys(privateKey.getPublicKey().toProtobufKey())) - .setLedgerId(LedgerId.MAINNET.toByteString()) - .build(); + .setFileID(new FileId(1).toProtobuf()) + .setSize(2) + .setExpirationTime(InstantConverter.toProtobuf(Instant.ofEpochMilli(3))) + .setDeleted(true) + .setKeys(KeyList.newBuilder().addKeys(privateKey.getPublicKey().toProtobufKey())) + .setLedgerId(LedgerId.MAINNET.toByteString()) + .build(); @BeforeAll public static void beforeAll() { @@ -62,25 +36,24 @@ public static void afterAll() { @Test void fromProtobuf() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(FileInfo.fromProtobuf(info).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect(FileInfo.fromProtobuf(info).toString()).toMatchSnapshot(); } @Test void toProtobuf() throws InvalidProtocolBufferException { SnapshotMatcher.expect(FileInfo.fromProtobuf(info).toProtobuf().toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(FileInfo.fromBytes(info.toByteArray()).toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void toBytes() { SnapshotMatcher.expect(Hex.toHexString(FileInfo.fromProtobuf(info).toBytes())) - .toMatchSnapshot(); + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java index c23380d23f..f655e6d800 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileId; -import com.hiero.sdk.FileUpdateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.FileUpdateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class FileUpdateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,23 +30,21 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private FileUpdateTransaction spawnTestTransaction() { return new FileUpdateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(FileId.fromString("0.0.6006")) - .setExpirationTime(Instant.ofEpochSecond(1554158728)) - .setContents(new byte[]{1, 2, 3, 4, 5}) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setKeys(unusedPrivateKey) - .setFileMemo("Hello memo") - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(FileId.fromString("0.0.6006")) + .setExpirationTime(Instant.ofEpochSecond(1554158728)) + .setContents(new byte[] {1, 2, 3, 4, 5}) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setKeys(unusedPrivateKey) + .setFileMemo("Hello memo") + .freeze() + .sign(unusedPrivateKey); } @Test @@ -82,7 +54,6 @@ void shouldBytes() throws Exception { assertThat(tx2.toString()).isEqualTo(tx.toString()); } - @Test void shouldBytesNoSetters() throws Exception { var tx = new FileUpdateTransaction(); @@ -90,12 +61,11 @@ void shouldBytesNoSetters() throws Exception { assertThat(tx2.toString()).isEqualTo(tx.toString()); } - @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setFileUpdate(FileUpdateTransactionBody.newBuilder().build()) - .build(); + .setFileUpdate(FileUpdateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java index c042cf2a5d..8a0e9a9c0a 100644 --- a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java @@ -1,53 +1,26 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileId; -import com.hiero.sdk.FreezeTransaction; -import com.hiero.sdk.FreezeType; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.FreezeTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.Timestamp; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class FreezeTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final FileId testFileId = FileId.fromString("4.5.6"); private static final byte[] testFileHash = Hex.decode("1723904587120938954702349857"); @@ -71,11 +44,16 @@ void shouldSerialize() { } private FreezeTransaction spawnTestTransaction() { - return new FreezeTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(testFileId).setFileHash(testFileHash).setStartTime(validStart).setFreezeType(testFreezeType) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)).freeze().sign(unusedPrivateKey); + return new FreezeTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(testFileId) + .setFileHash(testFileHash) + .setStartTime(validStart) + .setFreezeType(testFreezeType) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -95,7 +73,8 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setFreeze(FreezeTransactionBody.newBuilder().build()).build(); + .setFreeze(FreezeTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -104,10 +83,11 @@ void fromScheduledTransaction() { @Test void constructFreezeTransactionFromTransactionBodyProtobuf() { - var transactionBody = FreezeTransactionBody.newBuilder().setUpdateFile(testFileId.toProtobuf()) - .setFileHash(ByteString.copyFrom(testFileHash)) - .setStartTime(Timestamp.newBuilder().setSeconds(validStart.getEpochSecond())) - .setFreezeType(testFreezeType.code); + var transactionBody = FreezeTransactionBody.newBuilder() + .setUpdateFile(testFileId.toProtobuf()) + .setFileHash(ByteString.copyFrom(testFileHash)) + .setStartTime(Timestamp.newBuilder().setSeconds(validStart.getEpochSecond())) + .setFreezeType(testFreezeType.code); var tx = TransactionBody.newBuilder().setFreeze(transactionBody).build(); var freezeTransaction = new FreezeTransaction(tx); diff --git a/sdk/src/test/java/com/hiero/sdk/Function.java b/sdk/src/test/java/com/hiero/sdk/Function.java index fe0d78ea06..820a476de8 100644 --- a/sdk/src/test/java/com/hiero/sdk/Function.java +++ b/sdk/src/test/java/com/hiero/sdk/Function.java @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; public interface Function { diff --git a/sdk/src/test/java/com/hiero/sdk/HbarTest.java b/sdk/src/test/java/com/hiero/sdk/HbarTest.java index fe5dc7f927..f0c0ceb4e3 100644 --- a/sdk/src/test/java/com/hiero/sdk/HbarTest.java +++ b/sdk/src/test/java/com/hiero/sdk/HbarTest.java @@ -1,37 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.HbarUnit; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import java.math.BigDecimal; import java.util.Iterator; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; public class HbarTest { private static final long fiftyGTinybar = 5_000_000_000L; @@ -43,13 +22,13 @@ public class HbarTest { static Iterator getValueConversions() { return List.of( - Arguments.arguments(new BigDecimal(50_000_000), HbarUnit.MICROBAR), - Arguments.arguments(new BigDecimal(50_000), HbarUnit.MILLIBAR), - Arguments.arguments(new BigDecimal(50), HbarUnit.HBAR), - Arguments.arguments(new BigDecimal("0.05"), HbarUnit.KILOBAR), - Arguments.arguments(new BigDecimal("0.00005"), HbarUnit.MEGABAR), - Arguments.arguments(new BigDecimal("0.00000005"), HbarUnit.GIGABAR) - ).iterator(); + Arguments.arguments(new BigDecimal(50_000_000), HbarUnit.MICROBAR), + Arguments.arguments(new BigDecimal(50_000), HbarUnit.MILLIBAR), + Arguments.arguments(new BigDecimal(50), HbarUnit.HBAR), + Arguments.arguments(new BigDecimal("0.05"), HbarUnit.KILOBAR), + Arguments.arguments(new BigDecimal("0.00005"), HbarUnit.MEGABAR), + Arguments.arguments(new BigDecimal("0.00000005"), HbarUnit.GIGABAR)) + .iterator(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java b/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java index c2d2b19547..45eb6fa4fe 100644 --- a/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java +++ b/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java @@ -1,31 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.HederaTrustManager; -import com.hiero.sdk.LedgerId; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import com.google.protobuf.ByteString; import java.io.ByteArrayInputStream; import java.nio.charset.StandardCharsets; import java.security.cert.CertificateException; @@ -33,29 +11,29 @@ import java.security.cert.X509Certificate; import java.util.Map; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.Test; public class HederaTrustManagerTest { - public static final String PREVIEWNET_CERT_NODE_3_STRING = "-----BEGIN CERTIFICATE-----\n" + - "MIICnzCCAiWgAwIBAgIUenyqJ4UaFBbwokatcUqAwW3o3rswCgYIKoZIzj0EAwMw\n" + - "gYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJUWDETMBEGA1UEBwwKUmljaGFyZHNv\n" + - "bjEPMA0GA1UECgwGSGVkZXJhMQ8wDQYDVQQLDAZIZWRlcmExEDAOBgNVBAMMBzAw\n" + - "MDAwMDAxHzAdBgkqhkiG9w0BCQEWEGFkbWluQGhlZGVyYS5jb20wIBcNMjEwODIz\n" + - "MjIyMTU4WhgPMjI5NTA2MDcyMjIxNThaMIGEMQswCQYDVQQGEwJVUzELMAkGA1UE\n" + - "CAwCVFgxEzARBgNVBAcMClJpY2hhcmRzb24xDzANBgNVBAoMBkhlZGVyYTEPMA0G\n" + - "A1UECwwGSGVkZXJhMRAwDgYDVQQDDAcwMDAwMDAwMR8wHQYJKoZIhvcNAQkBFhBh\n" + - "ZG1pbkBoZWRlcmEuY29tMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEm5b1+oG9R0qt\n" + - "zM7UZnS5l/xxUNHIHq5+NAvtlviCpJL19jrW9+/UOy00Qqc6vS6tS1hS+dNJmpiZ\n" + - "FN0EHew4VDR7ACnL4LDJKmIHWjQ0iwvZo5kCpO0r9BtPN5FvaSxyo1QwUjAPBgNV\n" + - "HREECDAGhwR/AAABMAsGA1UdDwQEAwIEsDATBgNVHSUEDDAKBggrBgEFBQcDATAd\n" + - "BgNVHQ4EFgQUeciBviJtjeuue0GPf1xllNw7qvYwCgYIKoZIzj0EAwMDaAAwZQIw\n" + - "JeG0H2HdsI1VhOYmJmYlNeKCNgAk+LMorzPmsIInVBO2HK2IrKfpReWDS/m5j51V\n" + - "AjEAxKBxDezJDqAZHTkTXCg+X9Q9V6J6M5yDy5IS90aCWEo+W8C1Hc6hkn2/NrvT\n" + - "PhwK\n" + - "-----END CERTIFICATE-----\n"; - - public static final ByteArrayInputStream PREVIEWNET_CERT_NODE_3_BYTES = new ByteArrayInputStream(PREVIEWNET_CERT_NODE_3_STRING.getBytes(StandardCharsets.UTF_8)); + public static final String PREVIEWNET_CERT_NODE_3_STRING = + "-----BEGIN CERTIFICATE-----\n" + "MIICnzCCAiWgAwIBAgIUenyqJ4UaFBbwokatcUqAwW3o3rswCgYIKoZIzj0EAwMw\n" + + "gYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJUWDETMBEGA1UEBwwKUmljaGFyZHNv\n" + + "bjEPMA0GA1UECgwGSGVkZXJhMQ8wDQYDVQQLDAZIZWRlcmExEDAOBgNVBAMMBzAw\n" + + "MDAwMDAxHzAdBgkqhkiG9w0BCQEWEGFkbWluQGhlZGVyYS5jb20wIBcNMjEwODIz\n" + + "MjIyMTU4WhgPMjI5NTA2MDcyMjIxNThaMIGEMQswCQYDVQQGEwJVUzELMAkGA1UE\n" + + "CAwCVFgxEzARBgNVBAcMClJpY2hhcmRzb24xDzANBgNVBAoMBkhlZGVyYTEPMA0G\n" + + "A1UECwwGSGVkZXJhMRAwDgYDVQQDDAcwMDAwMDAwMR8wHQYJKoZIhvcNAQkBFhBh\n" + + "ZG1pbkBoZWRlcmEuY29tMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEm5b1+oG9R0qt\n" + + "zM7UZnS5l/xxUNHIHq5+NAvtlviCpJL19jrW9+/UOy00Qqc6vS6tS1hS+dNJmpiZ\n" + + "FN0EHew4VDR7ACnL4LDJKmIHWjQ0iwvZo5kCpO0r9BtPN5FvaSxyo1QwUjAPBgNV\n" + + "HREECDAGhwR/AAABMAsGA1UdDwQEAwIEsDATBgNVHSUEDDAKBggrBgEFBQcDATAd\n" + + "BgNVHQ4EFgQUeciBviJtjeuue0GPf1xllNw7qvYwCgYIKoZIzj0EAwMDaAAwZQIw\n" + + "JeG0H2HdsI1VhOYmJmYlNeKCNgAk+LMorzPmsIInVBO2HK2IrKfpReWDS/m5j51V\n" + + "AjEAxKBxDezJDqAZHTkTXCg+X9Q9V6J6M5yDy5IS90aCWEo+W8C1Hc6hkn2/NrvT\n" + + "PhwK\n" + + "-----END CERTIFICATE-----\n"; + + public static final ByteArrayInputStream PREVIEWNET_CERT_NODE_3_BYTES = + new ByteArrayInputStream(PREVIEWNET_CERT_NODE_3_STRING.getBytes(StandardCharsets.UTF_8)); public static final CertificateFactory CERTIFICATE_FACTORY; @@ -71,13 +49,14 @@ public class HederaTrustManagerTest { static { try { - PREVIEWNET_CERT_NODE_3 = (X509Certificate) CERTIFICATE_FACTORY.generateCertificate(PREVIEWNET_CERT_NODE_3_BYTES); + PREVIEWNET_CERT_NODE_3 = + (X509Certificate) CERTIFICATE_FACTORY.generateCertificate(PREVIEWNET_CERT_NODE_3_BYTES); } catch (CertificateException e) { throw new RuntimeException(e); } } - static final X509Certificate[] CERTIFICATE_CHAIN = new X509Certificate[]{PREVIEWNET_CERT_NODE_3}; + static final X509Certificate[] CERTIFICATE_CHAIN = new X509Certificate[] {PREVIEWNET_CERT_NODE_3}; @Test void skipsCheckIfVerificationIsDisabled() throws CertificateException { @@ -97,22 +76,27 @@ void throwsErrorIfCertificateIsNotProvidedButVerificationIsRequired() { @Test void properlyChecksCertificateAgainstCurrentNetworkAddressBook() throws InterruptedException, CertificateException { var client = Client.forNetwork(Map.of("0.previewnet.hedera.com:50211", new AccountId(3))) - .setTransportSecurity(true) - .setVerifyCertificates(true) - .setLedgerId(LedgerId.PREVIEWNET); - - var nodeAddress = Objects.requireNonNull(Objects.requireNonNull(client.network.addressBook).get(new AccountId(3))); - new HederaTrustManager(nodeAddress.getCertHash(), client.isVerifyCertificates()).checkServerTrusted(CERTIFICATE_CHAIN, ""); + .setTransportSecurity(true) + .setVerifyCertificates(true) + .setLedgerId(LedgerId.PREVIEWNET); + + var nodeAddress = Objects.requireNonNull( + Objects.requireNonNull(client.network.addressBook).get(new AccountId(3))); + new HederaTrustManager(nodeAddress.getCertHash(), client.isVerifyCertificates()) + .checkServerTrusted(CERTIFICATE_CHAIN, ""); } @Test void certificateCheckFailWhenHashMismatches() throws InterruptedException, CertificateException { var client = Client.forNetwork(Map.of("0.previewnet.hedera.com:50211", new AccountId(3))) - .setTransportSecurity(true) - .setVerifyCertificates(true) - .setLedgerId(LedgerId.PREVIEWNET); - - var nodeAddress = Objects.requireNonNull(Objects.requireNonNull(client.network.addressBook).get(new AccountId(4))); - assertThatExceptionOfType(CertificateException.class).isThrownBy(() -> new HederaTrustManager(nodeAddress.getCertHash(), client.isVerifyCertificates()).checkServerTrusted(CERTIFICATE_CHAIN, "")); + .setTransportSecurity(true) + .setVerifyCertificates(true) + .setLedgerId(LedgerId.PREVIEWNET); + + var nodeAddress = Objects.requireNonNull( + Objects.requireNonNull(client.network.addressBook).get(new AccountId(4))); + assertThatExceptionOfType(CertificateException.class) + .isThrownBy(() -> new HederaTrustManager(nodeAddress.getCertHash(), client.isVerifyCertificates()) + .checkServerTrusted(CERTIFICATE_CHAIN, "")); } } diff --git a/sdk/src/test/java/com/hiero/sdk/KeyListTest.java b/sdk/src/test/java/com/hiero/sdk/KeyListTest.java index 80baf06794..3ad922b24f 100644 --- a/sdk/src/test/java/com/hiero/sdk/KeyListTest.java +++ b/sdk/src/test/java/com/hiero/sdk/KeyListTest.java @@ -1,42 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.google.protobuf.ByteString; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; import com.hiero.sdk.proto.Key; +import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - class KeyListTest { private static final PublicKey mTestPublicKey1 = PrivateKey.fromStringED25519( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10") + .getPublicKey(); private static final PublicKey mTestPublicKey2 = PrivateKey.fromStringED25519( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") + .getPublicKey(); private static final PublicKey mTestPublicKey3 = PrivateKey.fromStringED25519( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") + .getPublicKey(); @Test @DisplayName("fromProtobuf") void fromProtobuf() { // Given - var protoKey1 = Key.newBuilder().setEd25519(ByteString.copyFrom(mTestPublicKey1.toBytes())).build(); - var protoKey3 = Key.newBuilder().setEd25519(ByteString.copyFrom(mTestPublicKey2.toBytes())).build(); - var protoKey2 = Key.newBuilder().setEd25519(ByteString.copyFrom(mTestPublicKey3.toBytes())).build(); + var protoKey1 = Key.newBuilder() + .setEd25519(ByteString.copyFrom(mTestPublicKey1.toBytes())) + .build(); + var protoKey3 = Key.newBuilder() + .setEd25519(ByteString.copyFrom(mTestPublicKey2.toBytes())) + .build(); + var protoKey2 = Key.newBuilder() + .setEd25519(ByteString.copyFrom(mTestPublicKey3.toBytes())) + .build(); var protoKeyList = com.hiero.sdk.proto.KeyList.newBuilder() - .addAllKeys(List.of(protoKey1, protoKey2, protoKey3)).build(); + .addAllKeys(List.of(protoKey1, protoKey2, protoKey3)) + .build(); // When var keyList = KeyList.fromProtobuf(protoKeyList, 3); @@ -86,12 +90,9 @@ void toProtobuf() { // Then assertThat(protoKeyList.getKeysCount()).isEqualTo(3); - assertThat(protoKeyList.getKeys(0).getEd25519().toByteArray()).isEqualTo( - mTestPublicKey1.toBytesRaw()); - assertThat(protoKeyList.getKeys(1).getEd25519().toByteArray()).isEqualTo( - mTestPublicKey2.toBytesRaw()); - assertThat(protoKeyList.getKeys(2).getEd25519().toByteArray()).isEqualTo( - mTestPublicKey3.toBytesRaw()); + assertThat(protoKeyList.getKeys(0).getEd25519().toByteArray()).isEqualTo(mTestPublicKey1.toBytesRaw()); + assertThat(protoKeyList.getKeys(1).getEd25519().toByteArray()).isEqualTo(mTestPublicKey2.toBytesRaw()); + assertThat(protoKeyList.getKeys(2).getEd25519().toByteArray()).isEqualTo(mTestPublicKey3.toBytesRaw()); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/KeyTest.java b/sdk/src/test/java/com/hiero/sdk/KeyTest.java index 15053af587..2bc4a4728c 100644 --- a/sdk/src/test/java/com/hiero/sdk/KeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/KeyTest.java @@ -1,48 +1,23 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static com.hiero.sdk.Key.fromBytes; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatNoException; + import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.Crypto; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PrivateKeyECDSA; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.PublicKeyECDSA; -import com.hiero.sdk.PublicKeyED25519; import com.hiero.sdk.proto.Key; import com.hiero.sdk.proto.KeyList; import com.hiero.sdk.proto.ThresholdKey; +import java.math.BigInteger; +import java.util.List; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.math.BigInteger; -import java.util.List; - -import static com.hiero.sdk.Key.fromBytes; -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.assertj.core.api.Assertions.assertThatNoException; - class KeyTest { @Test @DisplayName("can sign and verify a message") @@ -81,8 +56,8 @@ void calculateRecoveryIdECDSA() { System.arraycopy(signature, 0, r, 0, 32); final byte[] s = new byte[32]; System.arraycopy(signature, 32, s, 0, 32); - var recId = ((PrivateKeyECDSA) privateKey).getRecoveryId(r,s,message); - assertThat(recId).isBetween(0,1); + var recId = ((PrivateKeyECDSA) privateKey).getRecoveryId(r, s, message); + assertThat(recId).isBetween(0, 1); } @Test @@ -97,25 +72,25 @@ void failToCalculateRecoveryIdWithIllegalInputDataECDSA() { final byte[] s = new byte[32]; System.arraycopy(signature, 32, s, 0, 32); // recover public key with recId > 1 - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> Crypto.recoverPublicKeyECDSAFromSignature(2, BigInteger.ONE, BigInteger.ONE, Crypto.calcKeccak256(message)) - ); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Crypto.recoverPublicKeyECDSAFromSignature( + 2, BigInteger.ONE, BigInteger.ONE, Crypto.calcKeccak256(message))); // recover public key with negative 'r' or 's' - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> Crypto.recoverPublicKeyECDSAFromSignature(0, BigInteger.valueOf(-1), BigInteger.ONE, Crypto.calcKeccak256(message)) - ); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Crypto.recoverPublicKeyECDSAFromSignature( + 0, BigInteger.valueOf(-1), BigInteger.ONE, Crypto.calcKeccak256(message))); // calculate recId with wrong message var wrongMessage = "Hello".getBytes(UTF_8); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy( - () -> ((PrivateKeyECDSA) privateKey).getRecoveryId(r,s,wrongMessage) - ); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> ((PrivateKeyECDSA) privateKey).getRecoveryId(r, s, wrongMessage)); } @Test @DisplayName("can convert from protobuf ED25519 key to PublicKey") void fromProtoKeyEd25519() { var keyBytes = Hex.decode("0011223344556677889900112233445566778899001122334455667788990011"); - var protoKey = Key.newBuilder().setEd25519(ByteString.copyFrom(keyBytes)).build(); + var protoKey = + Key.newBuilder().setEd25519(ByteString.copyFrom(keyBytes)).build(); var cut = PublicKey.fromProtobufKey(protoKey); @@ -139,7 +114,7 @@ void fromProtoKeyECDSA() throws InvalidProtocolBufferException { @DisplayName("can convert from protobuf key list to PublicKey") void fromProtoKeyKeyList() { // given - var keyBytes = new byte[][]{ + var keyBytes = new byte[][] { Hex.decode("0011223344556677889900112233445566778899001122334455667788990011"), Hex.decode("aa11223344556677889900112233445566778899001122334455667788990011") }; @@ -170,7 +145,7 @@ void fromProtoKeyKeyList() { @DisplayName("can convert from protobuf threshold key to PublicKey") void fromProtoKeyThresholdKey() { // given - var keyBytes = new byte[][]{ + var keyBytes = new byte[][] { Hex.decode("0011223344556677889900112233445566778899001122334455667788990011"), Hex.decode("aa11223344556677889900112233445566778899001122334455667788990011") }; @@ -203,20 +178,20 @@ void fromProtoKeyThresholdKey() { @DisplayName("Throws given unsupported key") void throwsUnsupportedKey() { byte[] keyBytes = {0, 1, 2}; - var protoKey = Key.newBuilder().setRSA3072(ByteString.copyFrom(keyBytes)).build(); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy( - () -> com.hiero.sdk.Key.fromProtobufKey(protoKey) - ); + var protoKey = + Key.newBuilder().setRSA3072(ByteString.copyFrom(keyBytes)).build(); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> com.hiero.sdk.Key.fromProtobufKey(protoKey)); } @Test @DisplayName("Key equals") void keyEquals() { var key1 = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); var key2 = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); assertThat(key2.toString()).isEqualTo(key1.toString()); assertThat(key2.getPublicKey()).isEqualTo(key1.getPublicKey()); @@ -227,7 +202,7 @@ void keyEquals() { @DisplayName("Key has hash") void keyHash() { var key = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); assertThatNoException().isThrownBy(key::hashCode); } @@ -236,13 +211,13 @@ void keyHash() { @DisplayName("KeyList methods") void keyListMethods() { var key1 = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); var key2 = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11"); var key3 = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12"); var keyList = com.hiero.sdk.KeyList.withThreshold(1); keyList.add(key1); @@ -259,7 +234,7 @@ void keyListMethods() { assertThat(arr[1]).isEqualTo(key2); assertThat(arr[2]).isEqualTo(key3); - arr = new com.hiero.sdk.Key[]{null, null, null}; + arr = new com.hiero.sdk.Key[] {null, null, null}; keyList.toArray(arr); assertThat(arr[0]).isEqualTo(key1); assertThat(arr[1]).isEqualTo(key2); @@ -286,7 +261,8 @@ void keyListMethods() { @DisplayName("can convert from bytes ED25519 key to Key") void fromBytesEd25519() throws InvalidProtocolBufferException { var keyBytes = Hex.decode("0011223344556677889900112233445566778899001122334455667788990011"); - var protoKey = Key.newBuilder().setEd25519(ByteString.copyFrom(keyBytes)).build(); + var protoKey = + Key.newBuilder().setEd25519(ByteString.copyFrom(keyBytes)).build(); var bytes = protoKey.toByteArray(); var cut = fromBytes(bytes); @@ -309,7 +285,7 @@ void fromBytesECDSA() throws InvalidProtocolBufferException { @Test @DisplayName("can convert from bytes key list to Key") void fromBytesKeyList() throws InvalidProtocolBufferException { - var keyBytes = new byte[][]{ + var keyBytes = new byte[][] { Hex.decode("0011223344556677889900112233445566778899001122334455667788990011"), Hex.decode("aa11223344556677889900112233445566778899001122334455667788990011") }; @@ -338,7 +314,7 @@ void fromBytesKeyList() throws InvalidProtocolBufferException { @Test @DisplayName("can convert from bytes threshold key to Key") void fromBytesThresholdKey() throws InvalidProtocolBufferException { - var keyBytes = new byte[][]{ + var keyBytes = new byte[][] { Hex.decode("0011223344556677889900112233445566778899001122334455667788990011"), Hex.decode("aa11223344556677889900112233445566778899001122334455667788990011") }; @@ -370,11 +346,10 @@ void fromBytesThresholdKey() throws InvalidProtocolBufferException { @DisplayName("Throws given unsupported key") void throwsUnsupportedKeyFromBytes() { byte[] keyBytes = {0, 1, 2}; - var protoKey = Key.newBuilder().setRSA3072(ByteString.copyFrom(keyBytes)).build(); + var protoKey = + Key.newBuilder().setRSA3072(ByteString.copyFrom(keyBytes)).build(); var bytes = protoKey.toByteArray(); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy( - () -> fromBytes(bytes) - ); + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> fromBytes(bytes)); } } diff --git a/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java b/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java index c7a49ba933..64262f0001 100644 --- a/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java +++ b/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java @@ -1,38 +1,18 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.Keystore; -import com.hiero.sdk.PrivateKey; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class KeystoreTest { - private static final String TEST_KEY_STR = "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"; + private static final String TEST_KEY_STR = + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"; private static final String PASSPHRASE = "asdf1234"; @Test diff --git a/sdk/src/test/java/com/hiero/sdk/ListInputTest.java b/sdk/src/test/java/com/hiero/sdk/ListInputTest.java index e19e79e488..fa83313483 100644 --- a/sdk/src/test/java/com/hiero/sdk/ListInputTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ListInputTest.java @@ -1,42 +1,12 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenBurnTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDissociateTransaction; -import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenWipeTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import java.util.Objects; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; // A number of transactions take List<>s as inputs. // If the list parameter is used directly/naively, it can break encapsulation. @@ -121,15 +91,15 @@ void tokenWipeListTest() { void tokenMintListTest() { var tx = new TokenMintTransaction(); var list = new ArrayList(); - list.add(new byte[]{0}); + list.add(new byte[] {0}); tx.setMetadata(list); var v1 = new ArrayList<>(tx.getMetadata()); - list.add(new byte[]{1}); + list.add(new byte[] {1}); var v2 = new ArrayList<>(tx.getMetadata()); assertEquals(v1.toString(), v2.toString()); var list2 = tx.getMetadata(); - list2.add(new byte[]{2}); + list2.add(new byte[] {2}); var v3 = tx.getMetadata(); assertEquals(v1.toString(), v3.toString()); } diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java index 3bd79d56ca..ae32b4abdc 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java @@ -1,26 +1,21 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.LiveHashAddTransaction; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; class LiveHashAddTransactionTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -36,21 +31,19 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private LiveHashAddTransaction spawnTestTransaction() { return new LiveHashAddTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.100")) - .setHash(ByteString.copyFrom("hash", StandardCharsets.UTF_8)) - .setKeys(privateKey) - .setDuration(Duration.ofDays(30)) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.100")) + .setHash(ByteString.copyFrom("hash", StandardCharsets.UTF_8)) + .setKeys(privateKey) + .setDuration(Duration.ofDays(30)) + .freeze() + .sign(privateKey); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java index dd9f70585a..c5d49dafac 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java @@ -1,25 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.LiveHashDeleteTransaction; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; class LiveHashDeleteTransactionTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -35,19 +30,17 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private LiveHashDeleteTransaction spawnTestTransaction() { return new LiveHashDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.100")) - .setHash(ByteString.copyFrom("hash", StandardCharsets.UTF_8)) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.100")) + .setHash(ByteString.copyFrom("hash", StandardCharsets.UTF_8)) + .freeze() + .sign(privateKey); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java b/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java index 1db655aabd..1829a1830f 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java @@ -1,7 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.LiveHashQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -25,9 +24,10 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new LiveHashQuery() - .setAccountId(AccountId.fromString("0.0.100")) - .setHash(hash) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setAccountId(AccountId.fromString("0.0.100")) + .setHash(hash) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java b/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java index b51fe5ae14..270ea63ace 100644 --- a/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java @@ -1,42 +1,17 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import org.junit.jupiter.api.Test; - import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; + class MaxQueryPaymentExceededExceptionTest { @Test void shouldHaveMessage() { - var e = new MaxQueryPaymentExceededException( - new AccountBalanceQuery(), - new Hbar(30), - new Hbar(15) - ); + var e = new MaxQueryPaymentExceededException(new AccountBalanceQuery(), new Hbar(30), new Hbar(15)); - assertThat(e.getMessage()).isEqualTo( - "cost for AccountBalanceQuery, of 30 ℏ, without explicit payment is greater than the maximum allowed payment of 15 ℏ" - ); + assertThat(e.getMessage()) + .isEqualTo( + "cost for AccountBalanceQuery, of 30 ℏ, without explicit payment is greater than the maximum allowed payment of 15 ℏ"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java index 5de78e8887..4eb955117d 100644 --- a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java @@ -1,47 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FreezeTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.TopicMessageSubmitTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class MessageSubmitTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -71,27 +44,26 @@ void shouldBytesNoSetters() throws Exception { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private TopicMessageSubmitTransaction spawnTestTransaction() { return new TopicMessageSubmitTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTopicId(TopicId.fromString("0.0.5007")) - .setMessage("hello") - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTopicId(TopicId.fromString("0.0.5007")) + .setMessage("hello") + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setConsensusSubmitMessage(ConsensusSubmitMessageTransactionBody.newBuilder().build()) - .build(); + .setConsensusSubmitMessage( + ConsensusSubmitMessageTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java b/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java index 869d176138..c3d291cea6 100644 --- a/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertArrayEquals; @@ -27,12 +9,6 @@ import com.google.gson.JsonObject; import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.MirrorNodeContractCallQuery; -import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.MirrorNodeContractQuery; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -138,7 +114,7 @@ void testSetAndGetGas() { mirrorNodeContractEstimateGasQuery.setGasLimit(gas); assertEquals(gas, mirrorNodeContractEstimateGasQuery.getGasLimit()); - mirrorNodeContractCallQuery.setGasLimit(gas); + mirrorNodeContractCallQuery.setGasLimit(gas); assertEquals(gas, mirrorNodeContractCallQuery.getGasLimit()); } @@ -173,8 +149,8 @@ void testCreateJsonPayloadAllFieldsSet() { String blockNumber = "latest"; boolean estimate = true; - String jsonPayload = MirrorNodeContractQuery.createJsonPayload(data, senderAddress, contractAddress, gas, - gasPrice, value, blockNumber, estimate); + String jsonPayload = MirrorNodeContractQuery.createJsonPayload( + data, senderAddress, contractAddress, gas, gasPrice, value, blockNumber, estimate); JsonObject expectedJson = new JsonObject(); expectedJson.addProperty("data", "7465737444617461"); @@ -200,8 +176,8 @@ void testCreateJsonPayloadOnlyRequiredFieldsSet() { String blockNumber = "latest"; boolean estimate = true; - String jsonPayload = MirrorNodeContractQuery.createJsonPayload(data, senderAddress, contractAddress, gas, - gasPrice, value, blockNumber, estimate); + String jsonPayload = MirrorNodeContractQuery.createJsonPayload( + data, senderAddress, contractAddress, gas, gasPrice, value, blockNumber, estimate); JsonObject expectedJson = new JsonObject(); expectedJson.addProperty("data", "7465737444617461"); @@ -223,8 +199,8 @@ void testCreateJsonPayloadSomeOptionalFieldsSet() { String blockNumber = "latest"; boolean estimate = false; - String jsonPayload = MirrorNodeContractQuery.createJsonPayload(data, senderAddress, contractAddress, gas, - gasPrice, value, blockNumber, estimate); + String jsonPayload = MirrorNodeContractQuery.createJsonPayload( + data, senderAddress, contractAddress, gas, gasPrice, value, blockNumber, estimate); JsonObject expectedJson = new JsonObject(); expectedJson.addProperty("data", "7465737444617461"); @@ -249,8 +225,8 @@ void testCreateJsonPayloadAllOptionalFieldsDefault() { String blockNumber = "latest"; boolean estimate = false; - String jsonPayload = MirrorNodeContractQuery.createJsonPayload(data, senderAddress, contractAddress, gas, - gasPrice, value, blockNumber, estimate); + String jsonPayload = MirrorNodeContractQuery.createJsonPayload( + data, senderAddress, contractAddress, gas, gasPrice, value, blockNumber, estimate); JsonObject expectedJson = new JsonObject(); expectedJson.addProperty("data", "7465737444617461"); @@ -291,31 +267,30 @@ void shouldSerialize() { long testBlockNumber = 123456L; var mirrorNodeContractEstimateGasQuery = new MirrorNodeContractEstimateGasQuery() - .setContractId(testContractId) - .setContractEvmAddress(testEvmAddress) - .setSender(testSenderId) - .setSenderEvmAddress(testSenderEvmAddress) - .setFunction(testFunctionName, testParams) - .setFunctionParameters(testCallData) - .setValue(testValue) - .setGasLimit(testGasLimit) - .setGasPrice(testGasPrice) - .setBlockNumber(testBlockNumber); + .setContractId(testContractId) + .setContractEvmAddress(testEvmAddress) + .setSender(testSenderId) + .setSenderEvmAddress(testSenderEvmAddress) + .setFunction(testFunctionName, testParams) + .setFunctionParameters(testCallData) + .setValue(testValue) + .setGasLimit(testGasLimit) + .setGasPrice(testGasPrice) + .setBlockNumber(testBlockNumber); var mirrorNodeContractCallQuery = new MirrorNodeContractCallQuery() - .setContractId(testContractId) - .setContractEvmAddress(testEvmAddress) - .setSender(testSenderId) - .setSenderEvmAddress(testSenderEvmAddress) - .setFunction(testFunctionName, testParams) - .setFunctionParameters(testCallData) - .setValue(testValue) - .setGasLimit(testGasLimit) - .setGasPrice(testGasPrice) - .setBlockNumber(testBlockNumber); - - - SnapshotMatcher.expect(mirrorNodeContractEstimateGasQuery.toString() + mirrorNodeContractCallQuery.toString() - ).toMatchSnapshot(); + .setContractId(testContractId) + .setContractEvmAddress(testEvmAddress) + .setSender(testSenderId) + .setSenderEvmAddress(testSenderEvmAddress) + .setFunction(testFunctionName, testParams) + .setFunctionParameters(testCallData) + .setValue(testValue) + .setGasLimit(testGasLimit) + .setGasPrice(testGasPrice) + .setBlockNumber(testBlockNumber); + + SnapshotMatcher.expect(mirrorNodeContractEstimateGasQuery.toString() + mirrorNodeContractCallQuery.toString()) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java b/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java index 6e88f91d06..f183485945 100644 --- a/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java @@ -1,47 +1,27 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.BadMnemonicException; -import com.hiero.sdk.BadMnemonicReason; -import com.hiero.sdk.Mnemonic; -import com.hiero.sdk.PrivateKey; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.utils.Bip32Utils; +import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertThrowsExactly; - public class MnemonicTest { - private static final String MNEMONIC_LEGACY_V1_STRING = "jolly kidnap tom lawn drunk chick optic lust mutter mole bride galley dense member sage neural widow decide curb aboard margin manure"; - private static final String MNEMONIC_LEGACY_V2_STRING = "obvious favorite remain caution remove laptop base vacant increase video erase pass sniff sausage knock grid argue salt romance way alone fever slush dune"; - private static final String MNEMONIC_24_WORD_STRING = "inmate flip alley wear offer often piece magnet surge toddler submit right radio absent pear floor belt raven price stove replace reduce plate home"; - private static final String MNEMONIC_12_WORD_STRING = "finish furnace tomorrow wine mass goose festival air palm easy region guilt"; + private static final String MNEMONIC_LEGACY_V1_STRING = + "jolly kidnap tom lawn drunk chick optic lust mutter mole bride galley dense member sage neural widow decide curb aboard margin manure"; + private static final String MNEMONIC_LEGACY_V2_STRING = + "obvious favorite remain caution remove laptop base vacant increase video erase pass sniff sausage knock grid argue salt romance way alone fever slush dune"; + private static final String MNEMONIC_24_WORD_STRING = + "inmate flip alley wear offer often piece magnet surge toddler submit right radio absent pear floor belt raven price stove replace reduce plate home"; + private static final String MNEMONIC_12_WORD_STRING = + "finish furnace tomorrow wine mass goose festival air palm easy region guilt"; + @Test @DisplayName("Mnemonic.generate() creates a valid mnemonic") void generateValidMnemonic() { @@ -51,12 +31,13 @@ void generateValidMnemonic() { @ParameterizedTest @DisplayName("Mnemonic.validate() passes on known-good mnemonics") - @ValueSource(strings = { - "inmate flip alley wear offer often piece magnet surge toddler submit right radio absent pear floor belt raven price stove replace reduce plate home", - "tiny denial casual grass skull spare awkward indoor ethics dash enough flavor good daughter early hard rug staff capable swallow raise flavor empty angle", - "ramp april job flavor surround pyramid fish sea good know blame gate village viable include mixed term draft among monitor swear swing novel track", - "evoke rich bicycle fire promote climb zero squeeze little spoil slight damage", - }) + @ValueSource( + strings = { + "inmate flip alley wear offer often piece magnet surge toddler submit right radio absent pear floor belt raven price stove replace reduce plate home", + "tiny denial casual grass skull spare awkward indoor ethics dash enough flavor good daughter early hard rug staff capable swallow raise flavor empty angle", + "ramp april job flavor surround pyramid fish sea good know blame gate village viable include mixed term draft among monitor swear swing novel track", + "evoke rich bicycle fire promote climb zero squeeze little spoil slight damage", + }) void knownGoodMnemonics(String mnemonicStr) throws Exception { Mnemonic.fromString(mnemonicStr); } @@ -64,218 +45,202 @@ void knownGoodMnemonics(String mnemonicStr) throws Exception { @Test @DisplayName("Mnemonic.validate() throws on short word list") void shortWordList() { - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy( - () -> Mnemonic.fromWords(Arrays.asList("lorem", "ipsum", "dolor")) - ).satisfies( - error -> { - assertThat(error.reason).isEqualTo(BadMnemonicReason.BadLength); - assertThat(error.unknownWordIndices).isNull(); - } - ); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList("lorem", "ipsum", "dolor"))) + .satisfies(error -> { + assertThat(error.reason).isEqualTo(BadMnemonicReason.BadLength); + assertThat(error.unknownWordIndices).isNull(); + }); } @Test @DisplayName("Mnemonic.validate() throws on long word list") void longWordList() { - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy( - () -> Mnemonic.fromWords(Arrays.asList( - "lorem", - "ipsum", - "dolor", - "ramp", - "april", - "job", - "flavor", - "surround", - "pyramid", - "fish", - "sea", - "good", - "know", - "blame", - "gate", - "village", - "viable", - "include", - "mixed", - "term", - "draft", - "among", - "monitor", - "swear", - "swing", - "novel", - "track" - )) - ).satisfies( - error -> { - assertThat(error.reason).isEqualTo(BadMnemonicReason.BadLength); - assertThat(error.unknownWordIndices).isNull(); - } - ); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( + "lorem", + "ipsum", + "dolor", + "ramp", + "april", + "job", + "flavor", + "surround", + "pyramid", + "fish", + "sea", + "good", + "know", + "blame", + "gate", + "village", + "viable", + "include", + "mixed", + "term", + "draft", + "among", + "monitor", + "swear", + "swing", + "novel", + "track"))) + .satisfies(error -> { + assertThat(error.reason).isEqualTo(BadMnemonicReason.BadLength); + assertThat(error.unknownWordIndices).isNull(); + }); } @Test @DisplayName("Mnemonic.validate() throws on 12-24 words") void betweenWordList() { - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy( - () -> Mnemonic.fromWords(Arrays.asList("" + - "lorem", - "ipsum", - "dolor", - "ramp", - "april", - "job", - "flavor", - "surround", - "pyramid", - "fish", - "sea", - "good", - "know", - "blame" - )) - ).satisfies( - error -> { - assertThat(error.reason).isEqualTo(BadMnemonicReason.BadLength); - assertThat(error.unknownWordIndices).isNull(); - } - ); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( + "" + "lorem", + "ipsum", + "dolor", + "ramp", + "april", + "job", + "flavor", + "surround", + "pyramid", + "fish", + "sea", + "good", + "know", + "blame"))) + .satisfies(error -> { + assertThat(error.reason).isEqualTo(BadMnemonicReason.BadLength); + assertThat(error.unknownWordIndices).isNull(); + }); } @Test @DisplayName("Mnemonic.validate() throws on unknown words") void unknownWords() { - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy( - () -> Mnemonic.fromWords(Arrays.asList( - "abandon", - "ability", - "able", - "about", - "above", - "absent", - "adsorb", // typo from "absorb" - "abstract", - "absurd", - "abuse", - "access", - "accident", - "acount", // typo from "account" - "accuse", - "achieve", - "acid", - "acoustic", - "acquired", // typo from "acquire" - "across", - "act", - "action", - "actor", - "actress", - "actual" - )) - ).satisfies( - error -> { - assertThat(error.reason).isEqualTo(BadMnemonicReason.UnknownWords); - assertThat(error.unknownWordIndices).containsExactly(6, 12, 17); - } - ); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( + "abandon", + "ability", + "able", + "about", + "above", + "absent", + "adsorb", // typo from "absorb" + "abstract", + "absurd", + "abuse", + "access", + "accident", + "acount", // typo from "account" + "accuse", + "achieve", + "acid", + "acoustic", + "acquired", // typo from "acquire" + "across", + "act", + "action", + "actor", + "actress", + "actual"))) + .satisfies(error -> { + assertThat(error.reason).isEqualTo(BadMnemonicReason.UnknownWords); + assertThat(error.unknownWordIndices).containsExactly(6, 12, 17); + }); } @Test @DisplayName("Mnemonic.validate() throws on checksum mismatch, 24 words") void checksumMismatch() { // this mnemonic was just made up, the checksum should definitely not match - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy( - () -> Mnemonic.fromWords(Arrays.asList( - "abandon", - "ability", - "able", - "about", - "above", - "absent", - "absorb", - "abstract", - "absurd", - "abuse", - "access", - "accident", - "account", - "accuse", - "achieve", - "acid", - "acoustic", - "acquire", - "across", - "act", - "action", - "actor", - "actress", - "actual" - )) - ).satisfies( - error -> { - assertThat(error.reason).isEqualTo(BadMnemonicReason.ChecksumMismatch); - assertThat(error.unknownWordIndices).isNull(); - } - ); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( + "abandon", + "ability", + "able", + "about", + "above", + "absent", + "absorb", + "abstract", + "absurd", + "abuse", + "access", + "accident", + "account", + "accuse", + "achieve", + "acid", + "acoustic", + "acquire", + "across", + "act", + "action", + "actor", + "actress", + "actual"))) + .satisfies(error -> { + assertThat(error.reason).isEqualTo(BadMnemonicReason.ChecksumMismatch); + assertThat(error.unknownWordIndices).isNull(); + }); } @Test @DisplayName("Mnemonic.validate() throws on checksum mismatch, 12 words") void checksumMismatch12() { // this mnemonic was just made up, the checksum should definitely not match - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy( - () -> Mnemonic.fromWords(Arrays.asList( - "abandon", - "ability", - "able", - "about", - "above", - "absent", - "absorb", - "abstract", - "absurd", - "abuse", - "access", - "accident" - )) - ).satisfies( - error -> { - assertThat(error.reason).isEqualTo(BadMnemonicReason.ChecksumMismatch); - assertThat(error.unknownWordIndices).isNull(); - } - ); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( + "abandon", + "ability", + "able", + "about", + "above", + "absent", + "absorb", + "abstract", + "absurd", + "abuse", + "access", + "accident"))) + .satisfies(error -> { + assertThat(error.reason).isEqualTo(BadMnemonicReason.ChecksumMismatch); + assertThat(error.unknownWordIndices).isNull(); + }); } @Test @DisplayName("Invalid Mnemonic can still be used to generate a private key") void invalidToPrivateKey() { - assertThatExceptionOfType(BadMnemonicException.class).isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( - "abandon", - "ability", - "able", - "about", - "above", - "absent", - "absorb", - "abstract", - "absurd", - "abuse", - "access", - "accident", - "account", - "accuse", - "achieve", - "acid", - "acoustic", - "acquire", - "across", - "act", - "action", - "actor", - "actress", - "actual" - ))).satisfies(error -> assertThat(error.mnemonic).isNotNull()); + assertThatExceptionOfType(BadMnemonicException.class) + .isThrownBy(() -> Mnemonic.fromWords(Arrays.asList( + "abandon", + "ability", + "able", + "about", + "above", + "absent", + "absorb", + "abstract", + "absurd", + "abuse", + "access", + "accident", + "account", + "accuse", + "achieve", + "acid", + "acoustic", + "acquire", + "across", + "act", + "action", + "actor", + "actress", + "actual"))) + .satisfies(error -> assertThat(error.mnemonic).isNotNull()); } @Test @@ -353,9 +318,9 @@ void legacyV2MnemonicTest() throws Exception { void mnemonicTest() throws Exception { Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); PrivateKey key = mnemonic.toPrivateKey(); - assertThat(key).hasToString( - "302e020100300506032b657004220420853f15aecd22706b105da1d709b4ac05b4906170c2b9c7495dff9af49e1391da" - ); + assertThat(key) + .hasToString( + "302e020100300506032b657004220420853f15aecd22706b105da1d709b4ac05b4906170c2b9c7495dff9af49e1391da"); } @Test @@ -365,7 +330,8 @@ void mnemonicPassphraseTest() throws Exception { // Use unicode string as a passphrase. If it is properly normalized to NFKD, // it should generate the expectedPrivateKey bellow: String passphrase = "\u03B4\u03BF\u03BA\u03B9\u03BC\u03AE"; - String expectedPrivateKey = "302e020100300506032b6570042204203fefe1000db9485372851d542453b07e7970de4e2ecede7187d733ac037f4d2c"; + String expectedPrivateKey = + "302e020100300506032b6570042204203fefe1000db9485372851d542453b07e7970de4e2ecede7187d733ac037f4d2c"; Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); PrivateKey key = mnemonic.toPrivateKey(passphrase); @@ -383,25 +349,32 @@ void bip39() throws Exception { "legal winner thank year wave sausage worth useful legal winner thank yellow", "letter advice cage absurd amount doctor acoustic avoid letter advice cage above", "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong", -// "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon agent", -// "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will", -// "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter always", -// "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo when", + // "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon + // abandon abandon abandon abandon abandon abandon agent", + // "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth + // useful legal will", + // "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount + // doctor acoustic avoid letter always", + // "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo when", "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art", "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth title", "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic bless", "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote", "ozone drill grab fiber curtain grace pudding thank cruise elder eight picnic", -// "gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog", + // "gravity machine north sort system female filter attitude volume fold club stay feature office + // ecology stable narrow fog", "hamster diagram private dutch cause delay private meat slide toddler razor book happy fancy gospel tennis maple dilemma loan word shrug inflict delay length", "scheme spot photo card baby mountain device kick cradle pact join borrow", -// "horn tenant knee talent sponsor spell gate clip pulse soap slush warm silver nephew swap uncle crack brave", + // "horn tenant knee talent sponsor spell gate clip pulse soap slush warm silver nephew swap + // uncle crack brave", "panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside", "cat swing flag economy stadium alone churn speed unique patch report train", -// "light rule cinnamon wrap drastic word pride squirrel upgrade then income fatal apart sustain crack supply proud access", + // "light rule cinnamon wrap drastic word pride squirrel upgrade then income fatal apart sustain + // crack supply proud access", "all hour make first leader extend hole alien behind guard gospel lava path output census museum junior mass reopen famous sing advance salt reform", "vessel ladder alter error federal sibling chat ability sun glass valve picture", -// "scissors invite lock maple supreme raw rapid void congress muscle digital elegant little brisk hair mango congress clump", + // "scissors invite lock maple supreme raw rapid void congress muscle digital elegant little + // brisk hair mango congress clump", "void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold", }; @@ -410,25 +383,33 @@ void bip39() throws Exception { "2e8905819b8723fe2c1d161860e5ee1830318dbf49a83bd451cfb8440c28bd6fa457fe1296106559a3c80937a1c1069be3a3a5bd381ee6260e8d9739fce1f607", "d71de856f81a8acc65e6fc851a38d4d7ec216fd0796d0a6827a3ad6ed5511a30fa280f12eb2e47ed2ac03b5c462a0358d18d69fe4f985ec81778c1b370b652a8", "ac27495480225222079d7be181583751e86f571027b0497b5b5d11218e0a8a13332572917f0f8e5a589620c6f15b11c61dee327651a14c34e18231052e48c069", -// "035895f2f481b1b0f01fcf8c289c794660b289981a78f8106447707fdd9666ca06da5a9a565181599b79f53b844d8a71dd9f439c52a3d7b3e8a79c906ac845fa", -// "035895f2f481b1b0f01fcf8c289c794660b289981a78f8106447707fdd9666ca06da5a9a565181599b79f53b844d8a71dd9f439c52a3d7b3e8a79c906ac845fa", -// "107d7c02a5aa6f38c58083ff74f04c607c2d2c0ecc55501dadd72d025b751bc27fe913ffb796f841c49b1d33b610cf0e91d3aa239027f5e99fe4ce9e5088cd65", -// "0cd6e5d827bb62eb8fc1e262254223817fd068a74b5b449cc2f667c3f1f985a76379b43348d952e2265b4cd129090758b3e3c2c49103b5051aac2eaeb890a528", + // + // "035895f2f481b1b0f01fcf8c289c794660b289981a78f8106447707fdd9666ca06da5a9a565181599b79f53b844d8a71dd9f439c52a3d7b3e8a79c906ac845fa", + // + // "035895f2f481b1b0f01fcf8c289c794660b289981a78f8106447707fdd9666ca06da5a9a565181599b79f53b844d8a71dd9f439c52a3d7b3e8a79c906ac845fa", + // + // "107d7c02a5aa6f38c58083ff74f04c607c2d2c0ecc55501dadd72d025b751bc27fe913ffb796f841c49b1d33b610cf0e91d3aa239027f5e99fe4ce9e5088cd65", + // + // "0cd6e5d827bb62eb8fc1e262254223817fd068a74b5b449cc2f667c3f1f985a76379b43348d952e2265b4cd129090758b3e3c2c49103b5051aac2eaeb890a528", "bda85446c68413707090a52022edd26a1c9462295029f2e60cd7c4f2bbd3097170af7a4d73245cafa9c3cca8d561a7c3de6f5d4a10be8ed2a5e608d68f92fcc8", "bc09fca1804f7e69da93c2f2028eb238c227f2e9dda30cd63699232578480a4021b146ad717fbb7e451ce9eb835f43620bf5c514db0f8add49f5d121449d3e87", "c0c519bd0e91a2ed54357d9d1ebef6f5af218a153624cf4f2da911a0ed8f7a09e2ef61af0aca007096df430022f7a2b6fb91661a9589097069720d015e4e982f", "dd48c104698c30cfe2b6142103248622fb7bb0ff692eebb00089b32d22484e1613912f0a5b694407be899ffd31ed3992c456cdf60f5d4564b8ba3f05a69890ad", "274ddc525802f7c828d8ef7ddbcdc5304e87ac3535913611fbbfa986d0c9e5476c91689f9c8a54fd55bd38606aa6a8595ad213d4c9c9f9aca3fb217069a41028", -// "628c3827a8823298ee685db84f55caa34b5cc195a778e52d45f59bcf75aba68e4d7590e101dc414bc1bbd5737666fbbef35d1f1903953b66624f910feef245ac", + // + // "628c3827a8823298ee685db84f55caa34b5cc195a778e52d45f59bcf75aba68e4d7590e101dc414bc1bbd5737666fbbef35d1f1903953b66624f910feef245ac", "64c87cde7e12ecf6704ab95bb1408bef047c22db4cc7491c4271d170a1b213d20b385bc1588d9c7b38f1b39d415665b8a9030c9ec653d75e65f847d8fc1fc440", "ea725895aaae8d4c1cf682c1bfd2d358d52ed9f0f0591131b559e2724bb234fca05aa9c02c57407e04ee9dc3b454aa63fbff483a8b11de949624b9f1831a9612", -// "fd579828af3da1d32544ce4db5c73d53fc8acc4ddb1e3b251a31179cdb71e853c56d2fcb11aed39898ce6c34b10b5382772db8796e52837b54468aeb312cfc3d", + // + // "fd579828af3da1d32544ce4db5c73d53fc8acc4ddb1e3b251a31179cdb71e853c56d2fcb11aed39898ce6c34b10b5382772db8796e52837b54468aeb312cfc3d", "72be8e052fc4919d2adf28d5306b5474b0069df35b02303de8c1729c9538dbb6fc2d731d5f832193cd9fb6aeecbc469594a70e3dd50811b5067f3b88b28c3e8d", "deb5f45449e615feff5640f2e49f933ff51895de3b4381832b3139941c57b59205a42480c52175b6efcffaa58a2503887c1e8b363a707256bdd2b587b46541f5", -// "4cbdff1ca2db800fd61cae72a57475fdc6bab03e441fd63f96dabd1f183ef5b782925f00105f318309a7e9c3ea6967c7801e46c8a58082674c860a37b93eda02", + // + // "4cbdff1ca2db800fd61cae72a57475fdc6bab03e441fd63f96dabd1f183ef5b782925f00105f318309a7e9c3ea6967c7801e46c8a58082674c860a37b93eda02", "26e975ec644423f4a4c4f4215ef09b4bd7ef924e85d1d17c4cf3f136c2863cf6df0a475045652c57eb5fb41513ca2a2d67722b77e954b4b3fc11f7590449191d", "2aaa9242daafcee6aa9d7269f17d4efe271e1b9a529178d7dc139cd18747090bf9d60295d0ce74309a78852a9caadf0af48aae1c6253839624076224374bc63f", -// "7b4a10be9d98e6cba265566db7f136718e1398c71cb581e1b2f464cac1ceedf4f3e274dc270003c670ad8d02c4558b2f8e39edea2775c9e232c7cb798b069e88", + // + // "7b4a10be9d98e6cba265566db7f136718e1398c71cb581e1b2f464cac1ceedf4f3e274dc270003c670ad8d02c4558b2f8e39edea2775c9e232c7cb798b069e88", "01f5bced59dec48e362f2c45b5de68b9fd6c92c6634f44d6d40aab69056506f0e35524a518034ddc1192e1dacd32c1ed3eaa3c3b131c88ed8e7e54c49a5d0998", }; @@ -538,10 +519,9 @@ void toStandardED25519PrivateKeyShouldFailWhenIndexIsPreHardened() throws BadMne Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); int hardenedIndex = Bip32Utils.toHardenedIndex(10); - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> mnemonic.toStandardEd25519PrivateKey("", hardenedIndex) - ).satisfies(error -> assertThat(error.getMessage()).isEqualTo("the index should not be pre-hardened")); - + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> mnemonic.toStandardEd25519PrivateKey("", hardenedIndex)) + .satisfies(error -> assertThat(error.getMessage()).isEqualTo("the index should not be pre-hardened")); } @Test @@ -605,7 +585,8 @@ void toStandardECDSAsecp256k1PrivateKey() throws BadMnemonicException { assertThat(key5.getPublicKey().toStringRaw()).isSubstringOf(PUBLIC_KEY5); // Chain m/44'/3030'/0'/0/2147483647'; Passphrase "some pass" - PrivateKey key6 = mnemonic.toStandardECDSAsecp256k1PrivateKey("some pass", Bip32Utils.toHardenedIndex(2147483647)); + PrivateKey key6 = + mnemonic.toStandardECDSAsecp256k1PrivateKey("some pass", Bip32Utils.toHardenedIndex(2147483647)); assertThat(Hex.toHexString(key6.getChainCode().getKey())).isEqualTo(CHAIN_CODE6); assertThat(key6.toStringRaw()).isEqualTo(PRIVATE_KEY6); assertThat(key6.getPublicKey().toStringRaw()).isSubstringOf(PUBLIC_KEY6); @@ -672,14 +653,16 @@ void toStandardECDSAsecp256k1PrivateKey2() throws BadMnemonicException { assertThat(key5.getPublicKey().toStringRaw()).isSubstringOf(PUBLIC_KEY5); // Chain m/44'/3030'/0'/0/2147483647'; Passphrase "some pass" - PrivateKey key6 = mnemonic.toStandardECDSAsecp256k1PrivateKey("some pass", Bip32Utils.toHardenedIndex(2147483647)); + PrivateKey key6 = + mnemonic.toStandardECDSAsecp256k1PrivateKey("some pass", Bip32Utils.toHardenedIndex(2147483647)); assertThat(Hex.toHexString(key6.getChainCode().getKey())).isEqualTo(CHAIN_CODE6); assertThat(key6.toStringRaw()).isEqualTo(PRIVATE_KEY6); assertThat(key6.getPublicKey().toStringRaw()).isSubstringOf(PUBLIC_KEY6); } @Test - @DisplayName("Mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath() with custom derivation path invalid inputs vector") + @DisplayName( + "Mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath() with custom derivation path invalid inputs vector") void toStandardECDSAsecp256k1PrivateKeyCustomDpathInvalidInputs() throws BadMnemonicException { final String DPATH_1 = "XYZ/44'/60'/0'/0/0"; // invalid derivation path final String PASSPHRASE_1 = ""; @@ -699,39 +682,37 @@ void toStandardECDSAsecp256k1PrivateKeyCustomDpathInvalidInputs() throws BadMnem final String PRIVATE_KEY_3 = "31c24292eac951279b659c335e44a2e812d0f1a228b1d4d87034874d376e605a"; final String PUBLIC_KEY_3 = "0207ff3faf4055c1aa7a5ad94d6ff561fac35b9ae695ef486706243667d2b4d10e"; - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->{ - Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); - mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath( - PASSPHRASE_1, DPATH_1); - }).satisfies( - (iae) -> { - assertThat(iae.getMessage()).isEqualTo("Invalid derivation path format"); - } - ); - - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->{ - Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); - mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath( - PASSPHRASE_2, DPATH_2); - }).satisfies( - (iae) -> { - assertThat(iae.getMessage()).isEqualTo("Derivation path cannot be null or empty"); - } - ); - - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->{ - Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); - mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath( - PASSPHRASE_3, DPATH_3); - }).satisfies( - (iae) -> { - assertThat(iae.getMessage()).isEqualTo("Invalid derivation path format"); - } - ); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> { + Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); + mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath(PASSPHRASE_1, DPATH_1); + }) + .satisfies((iae) -> { + assertThat(iae.getMessage()).isEqualTo("Invalid derivation path format"); + }); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> { + Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); + mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath(PASSPHRASE_2, DPATH_2); + }) + .satisfies((iae) -> { + assertThat(iae.getMessage()).isEqualTo("Derivation path cannot be null or empty"); + }); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> { + Mnemonic mnemonic = Mnemonic.fromString(MNEMONIC_24_WORD_STRING); + mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath(PASSPHRASE_3, DPATH_3); + }) + .satisfies((iae) -> { + assertThat(iae.getMessage()).isEqualTo("Invalid derivation path format"); + }); } @Test - @DisplayName("Mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath() with custom derivation path test vector") + @DisplayName( + "Mnemonic.toStandardECDSAsecp256k1PrivateKeyCustomDerivationPath() with custom derivation path test vector") void toStandardECDSAsecp256k1PrivateKeyCustomDpath() throws BadMnemonicException { final String DPATH_1 = "m/44'/60'/0'/0/0"; final String PASSPHRASE_1 = ""; @@ -771,5 +752,4 @@ void toStandardECDSAsecp256k1PrivateKeyCustomDpath() throws BadMnemonicException assertThat(key3.toStringRaw()).isEqualTo(PRIVATE_KEY_3); assertThat(key3.getPublicKey().toStringRaw()).isSubstringOf(PUBLIC_KEY_3); } - } diff --git a/sdk/src/test/java/com/hiero/sdk/Mocker.java b/sdk/src/test/java/com/hiero/sdk/Mocker.java index 77d0618c54..e4258df4d4 100644 --- a/sdk/src/test/java/com/hiero/sdk/Mocker.java +++ b/sdk/src/test/java/com/hiero/sdk/Mocker.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.PrivateKey; import com.hiero.sdk.logger.LogLevel; import com.hiero.sdk.logger.Logger; import com.hiero.sdk.proto.ConsensusServiceGrpc; @@ -37,7 +16,6 @@ import io.grpc.Status; import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.ServerCalls; - import java.io.IOException; import java.time.Duration; import java.util.ArrayList; @@ -47,15 +25,15 @@ import java.util.concurrent.atomic.AtomicInteger; public class Mocker implements AutoCloseable { - private static final PrivateKey PRIVATE_KEY = PrivateKey.fromString("302e020100300506032b657004220420d45e1557156908c967804615af59a000be88c7aa7058bfcbe0f46b16c28f887d"); + private static final PrivateKey PRIVATE_KEY = PrivateKey.fromString( + "302e020100300506032b657004220420d45e1557156908c967804615af59a000be88c7aa7058bfcbe0f46b16c28f887d"); public final Client client; private final List services = List.of( - CryptoServiceGrpc.getServiceDescriptor(), - FileServiceGrpc.getServiceDescriptor(), - SmartContractServiceGrpc.getServiceDescriptor(), - ConsensusServiceGrpc.getServiceDescriptor(), - TokenServiceGrpc.getServiceDescriptor() - ); + CryptoServiceGrpc.getServiceDescriptor(), + FileServiceGrpc.getServiceDescriptor(), + SmartContractServiceGrpc.getServiceDescriptor(), + ConsensusServiceGrpc.getServiceDescriptor(), + TokenServiceGrpc.getServiceDescriptor()); private final List> responses; private final List servers = new ArrayList<>(); @@ -77,33 +55,36 @@ public class Mocker implements AutoCloseable { var descriptor = ServerServiceDefinition.builder(service); for (MethodDescriptor method : service.getMethods()) { - var methodDefinition = ServerMethodDefinition.create((MethodDescriptor) method, - ServerCalls.asyncUnaryCall((request, responseObserver) -> { - var responseIndex = index.getAndIncrement(); - - if (responseIndex >= response.size()) { - responseObserver.onError(Status.Code.ABORTED.toStatus().asRuntimeException()); - return; - } - - var r = response.get(responseIndex); - - if (r instanceof Function) { - try { - r = ((Function) r).apply(request); - } catch (Throwable e) { - r = Status.ABORTED.withDescription(e.getMessage()).asRuntimeException(); + var methodDefinition = ServerMethodDefinition.create( + (MethodDescriptor) method, + ServerCalls.asyncUnaryCall((request, responseObserver) -> { + var responseIndex = index.getAndIncrement(); + + if (responseIndex >= response.size()) { + responseObserver.onError( + Status.Code.ABORTED.toStatus().asRuntimeException()); + return; + } + + var r = response.get(responseIndex); + + if (r instanceof Function) { + try { + r = ((Function) r).apply(request); + } catch (Throwable e) { + r = Status.ABORTED + .withDescription(e.getMessage()) + .asRuntimeException(); + } + } + + if (r instanceof Throwable) { + responseObserver.onError((Throwable) r); + } else { + responseObserver.onNext(r); + responseObserver.onCompleted(); } - } - - if (r instanceof Throwable) { - responseObserver.onError((Throwable) r); - } else { - responseObserver.onNext(r); - responseObserver.onCompleted(); - } - }) - ); + })); descriptor.addMethod(methodDefinition); } @@ -118,14 +99,14 @@ public class Mocker implements AutoCloseable { } this.client = Client.forNetwork(network) - .setOperator(new AccountId(1800), PRIVATE_KEY) - .setMinBackoff(Duration.ofMillis(0)) - .setMaxBackoff(Duration.ofMillis(0)) - .setNodeMinBackoff(Duration.ofMillis(0)) - .setNodeMaxBackoff(Duration.ofMillis(0)) - .setMinNodeReadmitTime(Duration.ofMillis(0)) - .setMaxNodeReadmitTime(Duration.ofMillis(0)) - .setLogger(new Logger(LogLevel.SILENT)); + .setOperator(new AccountId(1800), PRIVATE_KEY) + .setMinBackoff(Duration.ofMillis(0)) + .setMaxBackoff(Duration.ofMillis(0)) + .setNodeMinBackoff(Duration.ofMillis(0)) + .setNodeMaxBackoff(Duration.ofMillis(0)) + .setMinNodeReadmitTime(Duration.ofMillis(0)) + .setMaxNodeReadmitTime(Duration.ofMillis(0)) + .setLogger(new Logger(LogLevel.SILENT)); } public static Mocker withResponses(List> responses) { diff --git a/sdk/src/test/java/com/hiero/sdk/MockingTest.java b/sdk/src/test/java/com/hiero/sdk/MockingTest.java index 92709f5e89..9afa0a2e25 100644 --- a/sdk/src/test/java/com/hiero/sdk/MockingTest.java +++ b/sdk/src/test/java/com/hiero/sdk/MockingTest.java @@ -1,46 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountBalance; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountInfoFlow; -import com.hiero.sdk.ContractCreateFlow; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.FileAppendTransaction; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxAttemptsExceededException; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionReceiptQuery; import com.hiero.sdk.proto.AccountID; import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse; import com.hiero.sdk.proto.CryptoGetInfoResponse; @@ -61,13 +23,6 @@ import com.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; import io.grpc.stub.StreamObserver; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.ArrayList; @@ -77,27 +32,36 @@ import java.util.Objects; import java.util.concurrent.TimeoutException; import java.util.function.Supplier; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; public class MockingTest { @Test void testSucceedsWithCorrectHbars() throws PrecheckStatusException, TimeoutException, InterruptedException { List responses1 = List.of( - Status.Code.UNAVAILABLE.toStatus().asRuntimeException(), - (Function) o -> Status.Code.UNAVAILABLE.toStatus().asRuntimeException(), - Response.newBuilder() - .setCryptogetAccountBalance( - CryptoGetAccountBalanceResponse.newBuilder() - .setHeader(ResponseHeader.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.OK).build()) - .setAccountID(AccountID.newBuilder().setAccountNum(10).build()) - .setBalance(100) - .build() - ).build() - ); + Status.Code.UNAVAILABLE.toStatus().asRuntimeException(), + (Function) + o -> Status.Code.UNAVAILABLE.toStatus().asRuntimeException(), + Response.newBuilder() + .setCryptogetAccountBalance(CryptoGetAccountBalanceResponse.newBuilder() + .setHeader(ResponseHeader.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) + .build()) + .setAccountID( + AccountID.newBuilder().setAccountNum(10).build()) + .setBalance(100) + .build()) + .build()); var responses = List.of(responses1); try (var mocker = Mocker.withResponses(responses)) { - var balance = new AccountBalanceQuery().setAccountId(new AccountId(10)).execute(mocker.client); + var balance = + new AccountBalanceQuery().setAccountId(new AccountId(10)).execute(mocker.client); Assertions.assertEquals(balance.hbars, Hbar.fromTinybars(100)); } @@ -123,20 +87,22 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetReceipt(St if (sync.equals("sync")) { transactionResponse = new AccountCreateTransaction().execute(server.client); } else { - transactionResponse = new AccountCreateTransaction().executeAsync(server.client).get(); + transactionResponse = + new AccountCreateTransaction().executeAsync(server.client).get(); } service.buffer - .enqueueResponse(TestResponse.query( - Response.newBuilder().setTransactionGetReceipt( - TransactionGetReceiptResponse.newBuilder() - .setHeader(ResponseHeader.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.PLATFORM_NOT_ACTIVE)) - .setReceipt(TransactionReceipt.newBuilder().setStatus(ResponseCodeEnum.SUCCESS).build()) - .build() - ).build() - )) - .enqueueResponse(TestResponse.receipt(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)) - .enqueueResponse(TestResponse.successfulReceipt()); + .enqueueResponse(TestResponse.query(Response.newBuilder() + .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() + .setHeader(ResponseHeader.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.PLATFORM_NOT_ACTIVE)) + .setReceipt(TransactionReceipt.newBuilder() + .setStatus(ResponseCodeEnum.SUCCESS) + .build()) + .build()) + .build())) + .enqueueResponse(TestResponse.receipt(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)) + .enqueueResponse(TestResponse.successfulReceipt()); if (sync.equals("sync")) { transactionResponse.getReceipt(server.client); @@ -159,40 +125,43 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetRecord(Str if (sync.equals("sync")) { transactionResponse = new AccountCreateTransaction().execute(server.client); } else { - transactionResponse = new AccountCreateTransaction().executeAsync(server.client).get(); + transactionResponse = + new AccountCreateTransaction().executeAsync(server.client).get(); } service.buffer - .enqueueResponse(TestResponse.successfulReceipt()) // for inner getReceipt - .enqueueResponse(TestResponse.successfulReceipt()) // for inner getCost - .enqueueResponse(TestResponse.query( - Response.newBuilder().setTransactionGetRecord( - TransactionGetRecordResponse.newBuilder() - .setHeader(ResponseHeader.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.PLATFORM_NOT_ACTIVE).build()) - .setTransactionRecord(TransactionRecord.newBuilder().setReceipt( - TransactionReceipt.newBuilder().setStatus(ResponseCodeEnum.SUCCESS).build() - ).build() - ).build() - ).build() - )) - .enqueueResponse(TestResponse.query( - Response.newBuilder().setTransactionGetRecord( - TransactionGetRecordResponse.newBuilder() - .setTransactionRecord(TransactionRecord.newBuilder().setReceipt( - TransactionReceipt.newBuilder().setStatus(ResponseCodeEnum.PLATFORM_NOT_ACTIVE).build() - ).build() - ).build() - ).build() - )) - .enqueueResponse(TestResponse.query( - Response.newBuilder().setTransactionGetRecord( - TransactionGetRecordResponse.newBuilder() - .setTransactionRecord(TransactionRecord.newBuilder().setReceipt( - TransactionReceipt.newBuilder().setStatus(ResponseCodeEnum.SUCCESS).build() - ).build() - ).build() - ).build() - )); + .enqueueResponse(TestResponse.successfulReceipt()) // for inner getReceipt + .enqueueResponse(TestResponse.successfulReceipt()) // for inner getCost + .enqueueResponse(TestResponse.query(Response.newBuilder() + .setTransactionGetRecord(TransactionGetRecordResponse.newBuilder() + .setHeader(ResponseHeader.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.PLATFORM_NOT_ACTIVE) + .build()) + .setTransactionRecord(TransactionRecord.newBuilder() + .setReceipt(TransactionReceipt.newBuilder() + .setStatus(ResponseCodeEnum.SUCCESS) + .build()) + .build()) + .build()) + .build())) + .enqueueResponse(TestResponse.query(Response.newBuilder() + .setTransactionGetRecord(TransactionGetRecordResponse.newBuilder() + .setTransactionRecord(TransactionRecord.newBuilder() + .setReceipt(TransactionReceipt.newBuilder() + .setStatus(ResponseCodeEnum.PLATFORM_NOT_ACTIVE) + .build()) + .build()) + .build()) + .build())) + .enqueueResponse(TestResponse.query(Response.newBuilder() + .setTransactionGetRecord(TransactionGetRecordResponse.newBuilder() + .setTransactionRecord(TransactionRecord.newBuilder() + .setReceipt(TransactionReceipt.newBuilder() + .setStatus(ResponseCodeEnum.SUCCESS) + .build()) + .build()) + .build()) + .build())); if (sync.equals("sync")) { transactionResponse.getRecord(server.client); @@ -215,7 +184,8 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws var cryptoService = new TestCryptoService(); var fileService = new TestFileService(); var contractService = new TestContractService(); - var server = new TestServer("contractCreateFlow" + versionToTest + stakeType, cryptoService, fileService, contractService); + var server = new TestServer( + "contractCreateFlow" + versionToTest + stakeType, cryptoService, fileService, contractService); var fileId = FileId.fromString("1.2.3"); var maxAutomaticTokenAssociations = 101; @@ -223,31 +193,36 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws var stakedNode = 13L; var declineStakingReward = true; - - cryptoService.buffer.enqueueResponse(TestResponse.query( - Response.newBuilder().setTransactionGetReceipt( - TransactionGetReceiptResponse.newBuilder().setReceipt( - TransactionReceipt.newBuilder().setFileID(fileId.toProtobuf()).setStatus(ResponseCodeEnum.SUCCESS).build() - ).build() - ).build() - )).enqueueResponse(TestResponse.successfulReceipt()).enqueueResponse(TestResponse.successfulReceipt()); - fileService.buffer - .enqueueResponse(TestResponse.transactionOk()) - .enqueueResponse(TestResponse.transactionOk()) - .enqueueResponse(TestResponse.transactionOk()); + cryptoService + .buffer + .enqueueResponse(TestResponse.query(Response.newBuilder() + .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() + .setReceipt(TransactionReceipt.newBuilder() + .setFileID(fileId.toProtobuf()) + .setStatus(ResponseCodeEnum.SUCCESS) + .build()) + .build()) + .build())) + .enqueueResponse(TestResponse.successfulReceipt()) + .enqueueResponse(TestResponse.successfulReceipt()); + fileService + .buffer + .enqueueResponse(TestResponse.transactionOk()) + .enqueueResponse(TestResponse.transactionOk()) + .enqueueResponse(TestResponse.transactionOk()); contractService.buffer.enqueueResponse(TestResponse.transactionOk()); var flow = new ContractCreateFlow() - .setBytecode(BIG_BYTECODE) - .setContractMemo("memo goes here") - .setConstructorParameters(new byte[]{1, 2, 3}) - .setAutoRenewPeriod(Duration.ofMinutes(1)) - .setAdminKey(adminKey) - .setGas(100) - .setInitialBalance(new Hbar(3)) - .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) - .setDeclineStakingReward(declineStakingReward); + .setBytecode(BIG_BYTECODE) + .setContractMemo("memo goes here") + .setConstructorParameters(new byte[] {1, 2, 3}) + .setAutoRenewPeriod(Duration.ofMinutes(1)) + .setAdminKey(adminKey) + .setGas(100) + .setInitialBalance(new Hbar(3)) + .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) + .setDeclineStakingReward(declineStakingReward); if (stakeType.equals("stakedAccount")) { flow.setStakedAccountId(stakedAccountId); @@ -271,14 +246,12 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws transactions.add(com.hiero.sdk.Transaction.fromBytes(request.toByteArray())); } transactions.add(com.hiero.sdk.Transaction.fromBytes( - contractService.buffer.transactionRequestsReceived.get(0).toByteArray() - )); + contractService.buffer.transactionRequestsReceived.get(0).toByteArray())); Assertions.assertInstanceOf(FileCreateTransaction.class, transactions.get(0)); Assertions.assertEquals( - ContractCreateFlow.FILE_CREATE_MAX_BYTES, - ((FileCreateTransaction) transactions.get(0)).getContents().size() - ); + ContractCreateFlow.FILE_CREATE_MAX_BYTES, + ((FileCreateTransaction) transactions.get(0)).getContents().size()); Assertions.assertTrue(cryptoService.buffer.queryRequestsReceived.get(0).hasTransactionGetReceipt()); @@ -286,15 +259,14 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws var fileAppendTx = (FileAppendTransaction) transactions.get(1); Assertions.assertEquals(fileId, fileAppendTx.getFileId()); Assertions.assertEquals( - BIG_BYTECODE.length() - ContractCreateFlow.FILE_CREATE_MAX_BYTES, - fileAppendTx.getContents().size() - ); + BIG_BYTECODE.length() - ContractCreateFlow.FILE_CREATE_MAX_BYTES, + fileAppendTx.getContents().size()); Assertions.assertInstanceOf(ContractCreateTransaction.class, transactions.get(3)); var contractCreateTx = (ContractCreateTransaction) transactions.get(3); Assertions.assertEquals("memo goes here", contractCreateTx.getContractMemo()); Assertions.assertEquals(fileId, contractCreateTx.getBytecodeFileId()); - Assertions.assertEquals(ByteString.copyFrom(new byte[]{1, 2, 3}), contractCreateTx.getConstructorParameters()); + Assertions.assertEquals(ByteString.copyFrom(new byte[] {1, 2, 3}), contractCreateTx.getConstructorParameters()); Assertions.assertEquals(Duration.ofMinutes(1), contractCreateTx.getAutoRenewPeriod()); Assertions.assertEquals(adminKey, contractCreateTx.getAdminKey()); Assertions.assertEquals(100, contractCreateTx.getGas()); @@ -313,7 +285,6 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws server.close(); } - @Test void accountInfoFlowFunctions() throws Throwable { var BIG_BYTES = makeBigString(1000).getBytes(StandardCharsets.UTF_8); @@ -323,11 +294,11 @@ void accountInfoFlowFunctions() throws Throwable { var cost = Hbar.from(1); Supplier makeTx = () -> new TokenMintTransaction() - .setTokenId(TokenId.fromString("1.2.3")) - .setAmount(5) - .setTransactionId(TransactionId.generate(accountId)) - .setNodeAccountIds(List.of(AccountId.fromString("0.0.3"))) - .freeze(); + .setTokenId(TokenId.fromString("1.2.3")) + .setAmount(5) + .setTransactionId(TransactionId.generate(accountId)) + .setNodeAccountIds(List.of(AccountId.fromString("0.0.3"))) + .freeze(); var properlySignedTx = makeTx.get().sign(privateKey); var improperlySignedTx = makeTx.get().sign(otherPrivateKey); @@ -338,56 +309,41 @@ void accountInfoFlowFunctions() throws Throwable { var server = new TestServer("accountInfoFlow", cryptoService); for (int i = 0; i < 8; i++) { - cryptoService.buffer.enqueueResponse( - TestResponse.query( - Response.newBuilder().setCryptoGetInfo( - CryptoGetInfoResponse.newBuilder() - .setHeader( - ResponseHeader.newBuilder() + cryptoService.buffer.enqueueResponse(TestResponse.query(Response.newBuilder() + .setCryptoGetInfo(CryptoGetInfoResponse.newBuilder() + .setHeader(ResponseHeader.newBuilder() .setCost(cost.toTinybars()) - .build() - ).build() - ).build() - ) - ); - cryptoService.buffer.enqueueResponse( - TestResponse.query( - Response.newBuilder().setCryptoGetInfo( - CryptoGetInfoResponse.newBuilder() - .setAccountInfo( - CryptoGetInfoResponse.AccountInfo.newBuilder() + .build()) + .build()) + .build())); + cryptoService.buffer.enqueueResponse(TestResponse.query(Response.newBuilder() + .setCryptoGetInfo(CryptoGetInfoResponse.newBuilder() + .setAccountInfo(CryptoGetInfoResponse.AccountInfo.newBuilder() .setKey(privateKey.getPublicKey().toProtobufKey()) - .build() - ).build() - ).build() - ) - ); + .build()) + .build()) + .build())); } - Assertions.assertTrue( - AccountInfoFlow.verifyTransactionSignature(server.client, accountId, properlySignedTx) - ); + Assertions.assertTrue(AccountInfoFlow.verifyTransactionSignature(server.client, accountId, properlySignedTx)); Assertions.assertFalse( - AccountInfoFlow.verifyTransactionSignature(server.client, accountId, improperlySignedTx) - ); + AccountInfoFlow.verifyTransactionSignature(server.client, accountId, improperlySignedTx)); Assertions.assertTrue( - AccountInfoFlow.verifySignature(server.client, accountId, BIG_BYTES, properBigBytesSignature) - ); + AccountInfoFlow.verifySignature(server.client, accountId, BIG_BYTES, properBigBytesSignature)); Assertions.assertFalse( - AccountInfoFlow.verifySignature(server.client, accountId, BIG_BYTES, improperBigBytesSignature) - ); + AccountInfoFlow.verifySignature(server.client, accountId, BIG_BYTES, improperBigBytesSignature)); Assertions.assertTrue( - AccountInfoFlow.verifyTransactionSignatureAsync(server.client, accountId, properlySignedTx).get() - ); + AccountInfoFlow.verifyTransactionSignatureAsync(server.client, accountId, properlySignedTx) + .get()); Assertions.assertFalse( - AccountInfoFlow.verifyTransactionSignatureAsync(server.client, accountId, improperlySignedTx).get() - ); + AccountInfoFlow.verifyTransactionSignatureAsync(server.client, accountId, improperlySignedTx) + .get()); Assertions.assertTrue( - AccountInfoFlow.verifySignatureAsync(server.client, accountId, BIG_BYTES, properBigBytesSignature).get() - ); + AccountInfoFlow.verifySignatureAsync(server.client, accountId, BIG_BYTES, properBigBytesSignature) + .get()); Assertions.assertFalse( - AccountInfoFlow.verifySignatureAsync(server.client, accountId, BIG_BYTES, improperBigBytesSignature).get() - ); + AccountInfoFlow.verifySignatureAsync(server.client, accountId, BIG_BYTES, improperBigBytesSignature) + .get()); Assertions.assertEquals(16, cryptoService.buffer.queryRequestsReceived.size()); for (int i = 0; i < 16; i += 2) { @@ -396,11 +352,14 @@ void accountInfoFlowFunctions() throws Throwable { Assertions.assertTrue(costQueryRequest.hasCryptoGetInfo()); Assertions.assertTrue(costQueryRequest.getCryptoGetInfo().hasHeader()); - Assertions.assertTrue(costQueryRequest.getCryptoGetInfo().getHeader().hasPayment()); + Assertions.assertTrue( + costQueryRequest.getCryptoGetInfo().getHeader().hasPayment()); Assertions.assertTrue(queryRequest.hasCryptoGetInfo()); Assertions.assertTrue(queryRequest.getCryptoGetInfo().hasAccountID()); - Assertions.assertEquals(accountId, AccountId.fromProtobuf(queryRequest.getCryptoGetInfo().getAccountID())); + Assertions.assertEquals( + accountId, + AccountId.fromProtobuf(queryRequest.getCryptoGetInfo().getAccountID())); } server.close(); } @@ -412,7 +371,9 @@ void exitOnAborted() throws PrecheckStatusException, TimeoutException, Interrupt var responses = List.of(responses1); try (var mocker = Mocker.withResponses(responses)) { - Assertions.assertThrows(RuntimeException.class, () -> new AccountBalanceQuery().setAccountId(new AccountId(10)).execute(mocker.client)); + Assertions.assertThrows(RuntimeException.class, () -> new AccountBalanceQuery() + .setAccountId(new AccountId(10)) + .execute(mocker.client)); } } @@ -427,27 +388,26 @@ void exitOnAborted() throws PrecheckStatusException, TimeoutException, Interrupt "RESOURCE_EXHAUSTED, , async", "UNAVAILABLE, , async" }) - void shouldRetryExceptionallyFunctionsCorrectly(Status.Code code, String description, String sync) throws Exception { + void shouldRetryExceptionallyFunctionsCorrectly(Status.Code code, String description, String sync) + throws Exception { var service = new TestCryptoService(); - var server = new TestServer("executableRetry" + code + (description != null ? description.replace(" ", "") : "NULL") + sync, service); + var server = new TestServer( + "executableRetry" + code + (description != null ? description.replace(" ", "") : "NULL") + sync, + service); - var exception = Status.fromCode(code) - .withDescription(description) - .asRuntimeException(); + var exception = Status.fromCode(code).withDescription(description).asRuntimeException(); - service.buffer - .enqueueResponse(TestResponse.error(exception)) - .enqueueResponse(TestResponse.transactionOk()); + service.buffer.enqueueResponse(TestResponse.error(exception)).enqueueResponse(TestResponse.transactionOk()); if (sync.equals("sync")) { new AccountCreateTransaction() - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .execute(server.client); + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .execute(server.client); } else { new AccountCreateTransaction() - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .executeAsync(server.client) - .get(); + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .executeAsync(server.client) + .get(); } Assertions.assertEquals(2, service.buffer.transactionRequestsReceived.size()); @@ -456,12 +416,8 @@ void shouldRetryExceptionallyFunctionsCorrectly(Status.Code code, String descrip server.close(); } - @ParameterizedTest(name = "[{2}] Executable should make max {1} attempts when there are {0} errors, and error") - @CsvSource({ - "2, 2, sync", - "2, 2, async" - }) + @CsvSource({"2, 2, sync", "2, 2, async"}) void hitsTxMaxAttemptsCorrectly(Integer numberOfErrors, Integer maxAttempts, String sync) throws Exception { var service = new TestCryptoService(); var server = new TestServer("executableMaxAttemptsSync" + numberOfErrors + maxAttempts + sync, service); @@ -477,23 +433,23 @@ void hitsTxMaxAttemptsCorrectly(Integer numberOfErrors, Integer maxAttempts, Str if (sync.equals("sync")) { Assertions.assertThrows(MaxAttemptsExceededException.class, () -> { new AccountCreateTransaction() - .setMaxAttempts(maxAttempts) - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .execute(server.client); + .setMaxAttempts(maxAttempts) + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .execute(server.client); }); } else { new AccountCreateTransaction() - .setMaxAttempts(maxAttempts) - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .executeAsync(server.client) - .handle((response, error) -> { - Assertions.assertNotNull(error); - System.out.println(error); - Assertions.assertTrue(error.getCause() instanceof MaxAttemptsExceededException); + .setMaxAttempts(maxAttempts) + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .executeAsync(server.client) + .handle((response, error) -> { + Assertions.assertNotNull(error); + System.out.println(error); + Assertions.assertTrue(error.getCause() instanceof MaxAttemptsExceededException); - return null; - }) - .get(); + return null; + }) + .get(); } Assertions.assertEquals(2, service.buffer.transactionRequestsReceived.size()); @@ -530,13 +486,13 @@ void shouldRetryFunctionsCorrectly(com.hiero.sdk.Status status, int numberOfErro if (sync.equals("sync")) { new AccountCreateTransaction() - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .execute(server.client); + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .execute(server.client); } else { new AccountCreateTransaction() - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .executeAsync(server.client) - .get(); + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .executeAsync(server.client) + .get(); } Assertions.assertEquals(numberOfErrors + 1, service.buffer.transactionRequestsReceived.size()); @@ -567,20 +523,20 @@ void hitsClientMaxAttemptsCorrectly(com.hiero.sdk.Status status, String sync) th if (sync.equals("sync")) { Assertions.assertThrows(MaxAttemptsExceededException.class, () -> { new AccountCreateTransaction() - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .execute(server.client); + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .execute(server.client); }); } else { new AccountCreateTransaction() - .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) - .executeAsync(server.client) - .handle((response, error) -> { - Assertions.assertNotNull(error); - Assertions.assertTrue(error.getCause() instanceof MaxAttemptsExceededException); + .setNodeAccountIds(List.of(AccountId.fromString("1.1.1"), AccountId.fromString("2.2.2"))) + .executeAsync(server.client) + .handle((response, error) -> { + Assertions.assertNotNull(error); + Assertions.assertTrue(error.getCause() instanceof MaxAttemptsExceededException); - return null; - }) - .get(); + return null; + }) + .get(); } Assertions.assertEquals(2, service.buffer.transactionRequestsReceived.size()); assertFirstTwoRequestsNotDirectedAtSameNode(service); @@ -588,7 +544,8 @@ void hitsClientMaxAttemptsCorrectly(com.hiero.sdk.Status status, String sync) th server.close(); } - private static void assertFirstTwoRequestsNotDirectedAtSameNode(TestCryptoService service) throws InvalidProtocolBufferException { + private static void assertFirstTwoRequestsNotDirectedAtSameNode(TestCryptoService service) + throws InvalidProtocolBufferException { var requests = service.buffer.transactionRequestsReceived; var signedTx0 = SignedTransaction.parseFrom(requests.get(0).getSignedTransactionBytes()); var signedTx1 = SignedTransaction.parseFrom(requests.get(1).getSignedTransactionBytes()); @@ -604,26 +561,20 @@ void defaultMaxTransactionFeeTest() throws Exception { var server = new TestServer("maxTransactionFee", service); service.buffer - .enqueueResponse(TestResponse.transactionOk()) - .enqueueResponse(TestResponse.transactionOk()) - .enqueueResponse(TestResponse.transactionOk()) - .enqueueResponse(TestResponse.transactionOk()); + .enqueueResponse(TestResponse.transactionOk()) + .enqueueResponse(TestResponse.transactionOk()) + .enqueueResponse(TestResponse.transactionOk()) + .enqueueResponse(TestResponse.transactionOk()); - new AccountDeleteTransaction() - .execute(server.client); + new AccountDeleteTransaction().execute(server.client); - new AccountDeleteTransaction() - .setMaxTransactionFee(new Hbar(5)) - .execute(server.client); + new AccountDeleteTransaction().setMaxTransactionFee(new Hbar(5)).execute(server.client); server.client.setDefaultMaxTransactionFee(new Hbar(1)); - new AccountDeleteTransaction() - .execute(server.client); + new AccountDeleteTransaction().execute(server.client); - new AccountDeleteTransaction() - .setMaxTransactionFee(new Hbar(3)) - .execute(server.client); + new AccountDeleteTransaction().setMaxTransactionFee(new Hbar(3)).execute(server.client); Assertions.assertEquals(4, service.buffer.transactionRequestsReceived.size()); var transactions = new ArrayList>(); @@ -646,18 +597,15 @@ void defaultMaxQueryPaymentTest() throws Exception { var server = new TestServer("queryPayment", service); var response = Response.newBuilder() - .setCryptogetAccountBalance( - new AccountBalance( - new Hbar(0), - new HashMap(), - new HashMap() - ).toProtobuf() - ).build(); + .setCryptogetAccountBalance( + new AccountBalance(new Hbar(0), new HashMap(), new HashMap()) + .toProtobuf()) + .build(); service.buffer - .enqueueResponse(TestResponse.query(response)) - .enqueueResponse(TestResponse.query(response)) - .enqueueResponse(TestResponse.query(response)); + .enqueueResponse(TestResponse.query(response)) + .enqueueResponse(TestResponse.query(response)) + .enqueueResponse(TestResponse.query(response)); // TODO: this will take some work, since I have to contend with Query's getCost behavior // TODO: actually, because AccountBalanceQuery is free, I'll need some other query type to test this. @@ -677,10 +625,10 @@ void signerDoesNotSignTwice() throws Exception { var aliceKey = PrivateKey.generateED25519(); var transaction = new AccountCreateTransaction() - .setTransactionId(TransactionId.generate(Objects.requireNonNull(server.client.getOperatorAccountId()))) - .setNodeAccountIds(server.client.network.getNodeAccountIdsForExecute()) - .freeze() - .sign(aliceKey); + .setTransactionId(TransactionId.generate(Objects.requireNonNull(server.client.getOperatorAccountId()))) + .setNodeAccountIds(server.client.network.getNodeAccountIdsForExecute()) + .freeze() + .sign(aliceKey); // This will cause the SDK Transaction to populate the sigPairLists list transaction.getTransactionHashPerNode(); @@ -695,11 +643,13 @@ void signerDoesNotSignTwice() throws Exception { // Now we must go through the laborious process of digging info out of the response. =( Assertions.assertEquals(1, service.buffer.transactionRequestsReceived.size()); var request = service.buffer.transactionRequestsReceived.get(0); - var sigPairList = SignedTransaction.parseFrom(request.getSignedTransactionBytes()).getSigMap().getSigPairList(); + var sigPairList = SignedTransaction.parseFrom(request.getSignedTransactionBytes()) + .getSigMap() + .getSigPairList(); Assertions.assertEquals(2, sigPairList.size()); Assertions.assertNotEquals( - sigPairList.get(0).getEd25519().toString(), - sigPairList.get(1).getEd25519().toString()); + sigPairList.get(0).getEd25519().toString(), + sigPairList.get(1).getEd25519().toString()); server.close(); } @@ -713,16 +663,11 @@ void canCancelExecuteAsync() throws Exception { server.client.setMaxBackoff(Duration.ofSeconds(8)); server.client.setMinBackoff(Duration.ofSeconds(1)); - var noReceiptResponse = TestResponse.query( - Response.newBuilder() - .setTransactionGetReceipt( - TransactionGetReceiptResponse.newBuilder() - .setHeader( - ResponseHeader.newBuilder() - .setNodeTransactionPrecheckCode(com.hiero.sdk.Status.RECEIPT_NOT_FOUND.code) - ) - ).build() - ); + var noReceiptResponse = TestResponse.query(Response.newBuilder() + .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() + .setHeader(ResponseHeader.newBuilder() + .setNodeTransactionPrecheckCode(com.hiero.sdk.Status.RECEIPT_NOT_FOUND.code))) + .build()); service.buffer.enqueueResponse(noReceiptResponse); service.buffer.enqueueResponse(noReceiptResponse); @@ -801,7 +746,8 @@ public void deleteFile(Transaction request, StreamObserver } } - private static class TestContractService extends SmartContractServiceGrpc.SmartContractServiceImplBase implements TestService { + private static class TestContractService extends SmartContractServiceGrpc.SmartContractServiceImplBase + implements TestService { public Buffer buffer = new Buffer(); @Override @@ -815,4 +761,3 @@ public void createContract(Transaction request, StreamObserver TEST_GOSSIP_ENDPOINTS = List.of( - spawnTestEndpoint((byte) 0), - spawnTestEndpoint((byte) 1), - spawnTestEndpoint((byte) 2) - ); + private static final List TEST_GOSSIP_ENDPOINTS = + List.of(spawnTestEndpoint((byte) 0), spawnTestEndpoint((byte) 1), spawnTestEndpoint((byte) 2)); private static final List TEST_SERVICE_ENDPOINTS = List.of( - spawnTestEndpoint((byte) 3), - spawnTestEndpoint((byte) 4), - spawnTestEndpoint((byte) 5), - spawnTestEndpoint((byte) 6) - ); + spawnTestEndpoint((byte) 3), + spawnTestEndpoint((byte) 4), + spawnTestEndpoint((byte) 5), + spawnTestEndpoint((byte) 6)); - private static final byte[] TEST_GOSSIP_CA_CERTIFICATE = new byte[]{0, 1, 2, 3, 4}; + private static final byte[] TEST_GOSSIP_CA_CERTIFICATE = new byte[] {0, 1, 2, 3, 4}; - private static final byte[] TEST_GRPC_CERTIFICATE_HASH = new byte[]{5, 6, 7, 8, 9}; + private static final byte[] TEST_GRPC_CERTIFICATE_HASH = new byte[] {5, 6, 7, 8, 9}; private static final PublicKey TEST_ADMIN_KEY = PrivateKey.fromString( - "302e020100300506032b65700422042062c4b69e9f45a554e5424fb5a6fe5e6ac1f19ead31dc7718c2d980fd1f998d4b") - .getPublicKey(); + "302e020100300506032b65700422042062c4b69e9f45a554e5424fb5a6fe5e6ac1f19ead31dc7718c2d980fd1f998d4b") + .getPublicKey(); final Instant TEST_VALID_START = Instant.ofEpochSecond(1554158542); @@ -91,26 +61,25 @@ void shouldSerialize() { private static Endpoint spawnTestEndpoint(byte offset) { return new Endpoint() - .setAddress(new byte[]{0x00, 0x01, 0x02, 0x03}) - .setDomainName(offset + "unit.test.com") - .setPort(42 + offset); + .setAddress(new byte[] {0x00, 0x01, 0x02, 0x03}) + .setDomainName(offset + "unit.test.com") + .setPort(42 + offset); } private NodeCreateTransaction spawnTestTransaction() { return new NodeCreateTransaction() - .setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) - .setAccountId(TEST_ACCOUNT_ID) - .setDescription(TEST_DESCRIPTION) - .setGossipEndpoints(TEST_GOSSIP_ENDPOINTS) - .setServiceEndpoints(TEST_SERVICE_ENDPOINTS) - .setGossipCaCertificate(TEST_GOSSIP_CA_CERTIFICATE) - .setGrpcCertificateHash(TEST_GRPC_CERTIFICATE_HASH) - .setAdminKey(TEST_ADMIN_KEY) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(TEST_PRIVATE_KEY); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) + .setAccountId(TEST_ACCOUNT_ID) + .setDescription(TEST_DESCRIPTION) + .setGossipEndpoints(TEST_GOSSIP_ENDPOINTS) + .setServiceEndpoints(TEST_SERVICE_ENDPOINTS) + .setGossipCaCertificate(TEST_GOSSIP_CA_CERTIFICATE) + .setGrpcCertificateHash(TEST_GRPC_CERTIFICATE_HASH) + .setAdminKey(TEST_ADMIN_KEY) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(TEST_PRIVATE_KEY); } @Test @@ -123,14 +92,14 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setNodeCreate(NodeCreateTransactionBody.newBuilder().build()).build(); + .setNodeCreate(NodeCreateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); assertThat(tx).isInstanceOf(NodeCreateTransaction.class); } - @Test void shouldBytesNoSetters() throws Exception { var tx = new NodeCreateTransaction(); @@ -141,11 +110,10 @@ void shouldBytesNoSetters() throws Exception { @Test void testUnrecognizedServicePort() throws Exception { var tx = new NodeCreateTransaction() - .setServiceEndpoints( - List.of(new Endpoint() - .setAddress(new byte[]{0x00, 0x01, 0x02, 0x03}) - .setDomainName("unit.test.com") - .setPort(50111))); + .setServiceEndpoints(List.of(new Endpoint() + .setAddress(new byte[] {0x00, 0x01, 0x02, 0x03}) + .setDomainName("unit.test.com") + .setPort(50111))); var tx2 = NodeCreateTransaction.fromBytes(tx.toBytes()); assertThat(tx2.toString()).isEqualTo(tx.toString()); } @@ -153,11 +121,11 @@ void testUnrecognizedServicePort() throws Exception { @Test void testSetNull() { new NodeCreateTransaction() - .setDescription(null) - .setAccountId(null) - .setGossipCaCertificate(null) - .setGrpcCertificateHash(null) - .setAdminKey(null); + .setDescription(null) + .setAccountId(null) + .setGossipCaCertificate(null) + .setGrpcCertificateHash(null) + .setAdminKey(null); } @Test @@ -179,7 +147,9 @@ void constructNodeCreateTransactionFromTransactionBodyProtobuf() { transactionBodyBuilder.setGrpcCertificateHash(ByteString.copyFrom(TEST_GRPC_CERTIFICATE_HASH)); transactionBodyBuilder.setAdminKey(TEST_ADMIN_KEY.toProtobufKey()); - var tx = TransactionBody.newBuilder().setNodeCreate(transactionBodyBuilder.build()).build(); + var tx = TransactionBody.newBuilder() + .setNodeCreate(transactionBodyBuilder.build()) + .build(); var nodeCreateTransaction = new NodeCreateTransaction(tx); assertThat(nodeCreateTransaction.getAccountId()).isEqualTo(TEST_ACCOUNT_ID); diff --git a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java index 1164e4d2e6..f88478486a 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java @@ -1,33 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NodeDeleteTransaction; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.NodeDeleteTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TransactionBody; @@ -41,7 +17,7 @@ public class NodeDeleteTransactionTest { private static final PrivateKey TEST_PRIVATE_KEY = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final long TEST_NODE_ID = 420; @@ -64,13 +40,12 @@ void shouldSerialize() { private NodeDeleteTransaction spawnTestTransaction() { return new NodeDeleteTransaction() - .setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) - .setNodeId(TEST_NODE_ID) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(TEST_PRIVATE_KEY); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) + .setNodeId(TEST_NODE_ID) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(TEST_PRIVATE_KEY); } @Test @@ -90,7 +65,8 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setNodeDelete(NodeDeleteTransactionBody.newBuilder().build()).build(); + .setNodeDelete(NodeDeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -103,7 +79,9 @@ void constructNodeDeleteTransactionFromTransactionBodyProtobuf() { transactionBodyBuilder.setNodeId(TEST_NODE_ID); - var tx = TransactionBody.newBuilder().setNodeDelete(transactionBodyBuilder.build()).build(); + var tx = TransactionBody.newBuilder() + .setNodeDelete(transactionBodyBuilder.build()) + .build(); var nodeDeleteTransaction = new NodeDeleteTransaction(tx); assertThat(nodeDeleteTransaction.getNodeId()).isEqualTo(TEST_NODE_ID); diff --git a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java index 46330c7de5..27380fadeb 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -25,14 +7,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Endpoint; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NodeUpdateTransaction; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.NodeUpdateTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TransactionBody; @@ -47,7 +21,7 @@ public class NodeUpdateTransactionTest { private static final PrivateKey TEST_PRIVATE_KEY = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final long TEST_NODE_ID = 420; @@ -55,26 +29,22 @@ public class NodeUpdateTransactionTest { private static final String TEST_DESCRIPTION = "Test description"; - private static final List TEST_GOSSIP_ENDPOINTS = List.of( - spawnTestEndpoint((byte) 0), - spawnTestEndpoint((byte) 1), - spawnTestEndpoint((byte) 2) - ); + private static final List TEST_GOSSIP_ENDPOINTS = + List.of(spawnTestEndpoint((byte) 0), spawnTestEndpoint((byte) 1), spawnTestEndpoint((byte) 2)); private static final List TEST_SERVICE_ENDPOINTS = List.of( - spawnTestEndpoint((byte) 3), - spawnTestEndpoint((byte) 4), - spawnTestEndpoint((byte) 5), - spawnTestEndpoint((byte) 6) - ); + spawnTestEndpoint((byte) 3), + spawnTestEndpoint((byte) 4), + spawnTestEndpoint((byte) 5), + spawnTestEndpoint((byte) 6)); - private static final byte[] TEST_GOSSIP_CA_CERTIFICATE = new byte[]{0, 1, 2, 3, 4}; + private static final byte[] TEST_GOSSIP_CA_CERTIFICATE = new byte[] {0, 1, 2, 3, 4}; - private static final byte[] TEST_GRPC_CERTIFICATE_HASH = new byte[]{5, 6, 7, 8, 9}; + private static final byte[] TEST_GRPC_CERTIFICATE_HASH = new byte[] {5, 6, 7, 8, 9}; private static final PublicKey TEST_ADMIN_KEY = PrivateKey.fromString( - "302e020100300506032b65700422042062c4b69e9f45a554e5424fb5a6fe5e6ac1f19ead31dc7718c2d980fd1f998d4b") - .getPublicKey(); + "302e020100300506032b65700422042062c4b69e9f45a554e5424fb5a6fe5e6ac1f19ead31dc7718c2d980fd1f998d4b") + .getPublicKey(); final Instant TEST_VALID_START = Instant.ofEpochSecond(1554158542); @@ -95,27 +65,26 @@ void shouldSerialize() { private static Endpoint spawnTestEndpoint(byte offset) { return new Endpoint() - .setAddress(new byte[]{0x00, 0x01, 0x02, 0x03}) - .setDomainName(offset + "unit.test.com") - .setPort(42 + offset); + .setAddress(new byte[] {0x00, 0x01, 0x02, 0x03}) + .setDomainName(offset + "unit.test.com") + .setPort(42 + offset); } private NodeUpdateTransaction spawnTestTransaction() { return new NodeUpdateTransaction() - .setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) - .setNodeId(TEST_NODE_ID) - .setAccountId(TEST_ACCOUNT_ID) - .setDescription(TEST_DESCRIPTION) - .setGossipEndpoints(TEST_GOSSIP_ENDPOINTS) - .setServiceEndpoints(TEST_SERVICE_ENDPOINTS) - .setGossipCaCertificate(TEST_GOSSIP_CA_CERTIFICATE) - .setGrpcCertificateHash(TEST_GRPC_CERTIFICATE_HASH) - .setAdminKey(TEST_ADMIN_KEY) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(TEST_PRIVATE_KEY); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) + .setNodeId(TEST_NODE_ID) + .setAccountId(TEST_ACCOUNT_ID) + .setDescription(TEST_DESCRIPTION) + .setGossipEndpoints(TEST_GOSSIP_ENDPOINTS) + .setServiceEndpoints(TEST_SERVICE_ENDPOINTS) + .setGossipCaCertificate(TEST_GOSSIP_CA_CERTIFICATE) + .setGrpcCertificateHash(TEST_GRPC_CERTIFICATE_HASH) + .setAdminKey(TEST_ADMIN_KEY) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(TEST_PRIVATE_KEY); } @Test @@ -135,11 +104,10 @@ void shouldBytesNoSetters() throws Exception { @Test void testUnrecognizedServicePort() throws Exception { var tx = new NodeUpdateTransaction() - .setServiceEndpoints( - List.of(new Endpoint() - .setAddress(new byte[]{0x00, 0x01, 0x02, 0x03}) - .setDomainName("unit.test.com") - .setPort(50111))); + .setServiceEndpoints(List.of(new Endpoint() + .setAddress(new byte[] {0x00, 0x01, 0x02, 0x03}) + .setDomainName("unit.test.com") + .setPort(50111))); var tx2 = NodeUpdateTransaction.fromBytes(tx.toBytes()); assertThat(tx2.toString()).isEqualTo(tx.toString()); } @@ -147,28 +115,29 @@ void testUnrecognizedServicePort() throws Exception { @Test void testEmptyCertificates() throws Exception { var tx = new NodeUpdateTransaction() - .setGossipCaCertificate(new byte[]{}) - .setGrpcCertificateHash(new byte[]{}); + .setGossipCaCertificate(new byte[] {}) + .setGrpcCertificateHash(new byte[] {}); var tx2Bytes = tx.toBytes(); NodeUpdateTransaction deserializedTx = (NodeUpdateTransaction) Transaction.fromBytes(tx2Bytes); - assertThat(deserializedTx.getGossipCaCertificate()).isEqualTo(new byte[]{}); - assertThat(deserializedTx.getGrpcCertificateHash()).isEqualTo(new byte[]{}); + assertThat(deserializedTx.getGossipCaCertificate()).isEqualTo(new byte[] {}); + assertThat(deserializedTx.getGrpcCertificateHash()).isEqualTo(new byte[] {}); } @Test void testSetNull() { new NodeUpdateTransaction() - .setDescription(null) - .setAccountId(null) - .setGossipCaCertificate(null) - .setGrpcCertificateHash(null) - .setAdminKey(null); + .setDescription(null) + .setAccountId(null) + .setGossipCaCertificate(null) + .setGrpcCertificateHash(null) + .setAdminKey(null); } @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setNodeUpdate(NodeUpdateTransactionBody.newBuilder().build()).build(); + .setNodeUpdate(NodeUpdateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -195,7 +164,9 @@ void constructNodeUpdateTransactionFromTransactionBodyProtobuf() { transactionBodyBuilder.setGrpcCertificateHash(BytesValue.of(ByteString.copyFrom(TEST_GRPC_CERTIFICATE_HASH))); transactionBodyBuilder.setAdminKey(TEST_ADMIN_KEY.toProtobufKey()); - var tx = TransactionBody.newBuilder().setNodeUpdate(transactionBodyBuilder.build()).build(); + var tx = TransactionBody.newBuilder() + .setNodeUpdate(transactionBodyBuilder.build()) + .build(); var nodeUpdateTransaction = new NodeUpdateTransaction(tx); assertThat(nodeUpdateTransaction.getNodeId()).isEqualTo(TEST_NODE_ID); diff --git a/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java b/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java index aae431a4ff..f6d05c0105 100644 --- a/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -25,10 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PendingAirdropId; -import com.hiero.sdk.TokenId; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -123,10 +100,10 @@ void testToProtobufWithNftId() { @Test void testFromProtobufWithTokenId() { com.hiero.sdk.proto.PendingAirdropId proto = com.hiero.sdk.proto.PendingAirdropId.newBuilder() - .setSenderId(sender.toProtobuf()) - .setReceiverId(receiver.toProtobuf()) - .setFungibleTokenType(tokenId.toProtobuf()) - .build(); + .setSenderId(sender.toProtobuf()) + .setReceiverId(receiver.toProtobuf()) + .setFungibleTokenType(tokenId.toProtobuf()) + .build(); PendingAirdropId pendingAirdropId = PendingAirdropId.fromProtobuf(proto); @@ -140,10 +117,10 @@ void testFromProtobufWithTokenId() { @Test void testFromProtobufWithNftId() { com.hiero.sdk.proto.PendingAirdropId proto = com.hiero.sdk.proto.PendingAirdropId.newBuilder() - .setSenderId(sender.toProtobuf()) - .setReceiverId(receiver.toProtobuf()) - .setNonFungibleToken(nftId.toProtobuf()) - .build(); + .setSenderId(sender.toProtobuf()) + .setReceiverId(receiver.toProtobuf()) + .setNonFungibleToken(nftId.toProtobuf()) + .build(); PendingAirdropId pendingAirdropId = PendingAirdropId.fromProtobuf(proto); diff --git a/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java b/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java index c575079c2e..5d2b2a0c54 100644 --- a/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java +++ b/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java @@ -1,58 +1,33 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; +import com.google.protobuf.InvalidProtocolBufferException; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.Collections; - -import static org.assertj.core.api.Assertions.assertThat; +import org.bouncycastle.util.encoders.Hex; +import org.junit.jupiter.api.Test; public class PrivateKeyTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @Test void signTransactionWorks() throws InvalidProtocolBufferException { byte[] bytes = new AccountCreateTransaction() - .setNodeAccountIds(Collections.singletonList(AccountId.fromString("0.0.5005"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setKey(unusedPrivateKey) - .setInitialBalance(Hbar.fromTinybars(450)) - .setProxyAccountId(AccountId.fromString("0.0.1001")) - .setReceiverSignatureRequired(true) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .toBytes(); + .setNodeAccountIds(Collections.singletonList(AccountId.fromString("0.0.5005"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setKey(unusedPrivateKey) + .setInitialBalance(Hbar.fromTinybars(450)) + .setProxyAccountId(AccountId.fromString("0.0.1001")) + .setReceiverSignatureRequired(true) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .toBytes(); AccountCreateTransaction transaction = (AccountCreateTransaction) Transaction.fromBytes(bytes); unusedPrivateKey.signTransaction(transaction); @@ -64,7 +39,9 @@ void ecdsa() { var key = PrivateKey.fromStringECDSA("8776c6b831a1b61ac10dac0304a2843de4716f54b1919bb91a2685d0fe3f3048"); var signature = key.sign(message); - assertThat(Hex.toHexString(signature)).isEqualTo("f3a13a555f1f8cd6532716b8f388bd4e9d8ed0b252743e923114c0c6cbfe414cf791c8e859afd3c12009ecf2cb20dacf01636d80823bcdbd9ec1ce59afe008f0"); + assertThat(Hex.toHexString(signature)) + .isEqualTo( + "f3a13a555f1f8cd6532716b8f388bd4e9d8ed0b252743e923114c0c6cbfe414cf791c8e859afd3c12009ecf2cb20dacf01636d80823bcdbd9ec1ce59afe008f0"); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java index a471e4d447..d1759ff697 100644 --- a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java @@ -1,41 +1,17 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PrngTransaction; -import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - public class PrngTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -51,34 +27,30 @@ public static void afterAll() { private PrngTransaction spawnTestTransaction() { return new PrngTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } private PrngTransaction spawnTestTransaction2() { return new PrngTransaction() - .setRange(100) - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setRange(100) + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test void shouldSerialize2() { - SnapshotMatcher.expect(spawnTestTransaction2() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction2().toString()).toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java b/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java index 69490dd5a6..c96038e5d7 100644 --- a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java @@ -1,6 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; import com.hiero.sdk.proto.ProxyStaker; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -9,9 +9,9 @@ public class ProxyStakerTest { private static final ProxyStaker proxyStaker = ProxyStaker.newBuilder() - .setAccountID(new AccountId(100).toProtobuf()) - .setAmount(10) - .build(); + .setAccountID(new AccountId(100).toProtobuf()) + .setAmount(10) + .build(); @BeforeAll public static void beforeAll() { @@ -25,7 +25,8 @@ public static void afterAll() { @Test void fromProtobuf() { - SnapshotMatcher.expect(com.hiero.sdk.ProxyStaker.fromProtobuf(proxyStaker).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect( + com.hiero.sdk.ProxyStaker.fromProtobuf(proxyStaker).toString()) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java b/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java index 9b7a4fa4ff..cb58373d94 100644 --- a/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java @@ -1,15 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionReceipt; -import com.hiero.sdk.proto.ResponseCodeEnum; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; +import com.hiero.sdk.proto.ResponseCodeEnum; import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; class ReceiptStatusExceptionTest { @@ -17,18 +13,12 @@ class ReceiptStatusExceptionTest { void shouldHaveMessage() { var validStart = Instant.ofEpochSecond(1554158542); var txId = new TransactionId(new AccountId(0, 0, 100), validStart); - var txReceipt = TransactionReceipt.fromProtobuf( - com.hiero.sdk.proto.TransactionReceipt - .newBuilder() + var txReceipt = TransactionReceipt.fromProtobuf(com.hiero.sdk.proto.TransactionReceipt.newBuilder() .setStatusValue(ResponseCodeEnum.INSUFFICIENT_TX_FEE_VALUE) .build()); - var e = new ReceiptStatusException( - txId, - txReceipt - ); + var e = new ReceiptStatusException(txId, txReceipt); - assertThat(e.getMessage()).isEqualTo( - "receipt for transaction 0.0.100@1554158542.000000000 raised status INSUFFICIENT_TX_FEE" - ); + assertThat(e.getMessage()) + .isEqualTo("receipt for transaction 0.0.100@1554158542.000000000 raised status INSUFFICIENT_TX_FEE"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java b/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java index 953df0dd07..0f002c169a 100644 --- a/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java +++ b/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java @@ -1,52 +1,38 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.ResponseCodeEnum; import com.hiero.sdk.proto.SignedTransaction; import com.hiero.sdk.proto.Transaction; import com.hiero.sdk.proto.TransactionBody; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; -import org.junit.jupiter.api.Test; - import java.util.HashSet; import java.util.List; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; public class RegenerateTransactionIdsTest { @Test - void regeneratesTransactionIdsWhenTransactionExpiredIsReturned() throws PrecheckStatusException, TimeoutException, InterruptedException { + void regeneratesTransactionIdsWhenTransactionExpiredIsReturned() + throws PrecheckStatusException, TimeoutException, InterruptedException { var transactionIds = new HashSet(); AtomicInteger count = new AtomicInteger(0); var responses = List.of( - TransactionResponse.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.TRANSACTION_EXPIRED).build(), - TransactionResponse.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.TRANSACTION_EXPIRED).build(), - TransactionResponse.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.TRANSACTION_EXPIRED).build(), - TransactionResponse.newBuilder().setNodeTransactionPrecheckCode(ResponseCodeEnum.OK).build() - ); + TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.TRANSACTION_EXPIRED) + .build(), + TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.TRANSACTION_EXPIRED) + .build(), + TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.TRANSACTION_EXPIRED) + .build(), + TransactionResponse.newBuilder() + .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) + .build()); var call = (Function) o -> { try { @@ -67,9 +53,7 @@ void regeneratesTransactionIdsWhenTransactionExpiredIsReturned() throws Precheck } }; - List responses1 = List.of( - call, call, call, call - ); + List responses1 = List.of(call, call, call, call); try (var mocker = Mocker.withResponses(List.of(responses1))) { new FileCreateTransaction().execute(mocker.client); diff --git a/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java b/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java index 290a8e28f4..a5a0ce980d 100644 --- a/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java @@ -1,14 +1,13 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.RequestType; -import com.hiero.sdk.proto.HederaFunctionality; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; +import com.hiero.sdk.proto.HederaFunctionality; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; class RequestTypeTest { @@ -16,9 +15,9 @@ class RequestTypeTest { void valueOf() { var codeValues = HederaFunctionality.values(); var requestTypeValues = RequestType.values(); - var pair = IntStream.range(0, codeValues.length-1) - .mapToObj(i -> Map.entry(codeValues[i], requestTypeValues[i])) - .collect(Collectors.toList()); + var pair = IntStream.range(0, codeValues.length - 1) + .mapToObj(i -> Map.entry(codeValues[i], requestTypeValues[i])) + .collect(Collectors.toList()); pair.forEach((a) -> { var code = a.getKey(); diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java index 3d9e1231f1..3aea7051f2 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java @@ -1,44 +1,18 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ScheduleCreateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class ScheduleCreateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -52,28 +26,26 @@ public static void afterAll() { SnapshotMatcher.validateSnapshots(); } - @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private ScheduleCreateTransaction spawnTestTransaction() { var transferTransaction = new TransferTransaction() - .addHbarTransfer(AccountId.fromString("0.0.555"), new Hbar(-10)) - .addHbarTransfer(AccountId.fromString("0.0.333"), new Hbar(10)); - return transferTransaction.schedule() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAdminKey(unusedPrivateKey) - .setPayerAccountId(AccountId.fromString("0.0.222")) - .setScheduleMemo("hi") - .setMaxTransactionFee(new Hbar(1)) - .setExpirationTime(validStart) - .freeze() - .sign(unusedPrivateKey); + .addHbarTransfer(AccountId.fromString("0.0.555"), new Hbar(-10)) + .addHbarTransfer(AccountId.fromString("0.0.333"), new Hbar(10)); + return transferTransaction + .schedule() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAdminKey(unusedPrivateKey) + .setPayerAccountId(AccountId.fromString("0.0.222")) + .setScheduleMemo("hi") + .setMaxTransactionFee(new Hbar(1)) + .setExpirationTime(validStart) + .freeze() + .sign(unusedPrivateKey); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java index 70b0917ce7..214f754325 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ScheduleDeleteTransaction; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.ScheduleDeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class ScheduleDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,19 +30,17 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private ScheduleDeleteTransaction spawnTestTransaction() { return new ScheduleDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setScheduleId(ScheduleId.fromString("0.0.444")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setScheduleId(ScheduleId.fromString("0.0.444")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -88,8 +60,8 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setScheduleDelete(ScheduleDeleteTransactionBody.newBuilder().build()) - .build(); + .setScheduleDelete(ScheduleDeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java index c8fe4949c0..6f6a5e237b 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java @@ -1,27 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.ScheduleInfoQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -43,9 +22,10 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new ScheduleInfoQuery() - .setScheduleId(ScheduleId.fromString("0.0.5005")) - .setMaxQueryPayment(Hbar.fromTinybars(100_000)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setScheduleId(ScheduleId.fromString("0.0.5005")) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java index a4f58e8fd2..4ff7b7fdf4 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java @@ -1,28 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.ScheduleInfo; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.CryptoDeleteTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; - public class ScheduleInfoTest { private static final PublicKey unusedPublicKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10" - ).getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10") + .getPublicKey(); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -38,42 +30,46 @@ public static void afterAll() { ScheduleInfo spawnScheduleInfoExample() { return new ScheduleInfo( - ScheduleId.fromString("1.2.3"), - AccountId.fromString("4.5.6"), - AccountId.fromString("2.3.4"), - SchedulableTransactionBody.newBuilder() - .setCryptoDelete(CryptoDeleteTransactionBody.newBuilder() - .setDeleteAccountID(AccountId.fromString("6.6.6").toProtobuf()).build()).build(), - KeyList.of(unusedPublicKey), - unusedPublicKey, - TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart), - "memo", - validStart, - validStart, - null, - LedgerId.TESTNET, - true - ); + ScheduleId.fromString("1.2.3"), + AccountId.fromString("4.5.6"), + AccountId.fromString("2.3.4"), + SchedulableTransactionBody.newBuilder() + .setCryptoDelete(CryptoDeleteTransactionBody.newBuilder() + .setDeleteAccountID( + AccountId.fromString("6.6.6").toProtobuf()) + .build()) + .build(), + KeyList.of(unusedPublicKey), + unusedPublicKey, + TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart), + "memo", + validStart, + validStart, + null, + LedgerId.TESTNET, + true); } ScheduleInfo spawnScheduleInfoDeletedExample() { return new ScheduleInfo( - ScheduleId.fromString("1.2.3"), - AccountId.fromString("4.5.6"), - AccountId.fromString("2.3.4"), - SchedulableTransactionBody.newBuilder() - .setCryptoDelete(CryptoDeleteTransactionBody.newBuilder() - .setDeleteAccountID(AccountId.fromString("6.6.6").toProtobuf()).build()).build(), - KeyList.of(unusedPublicKey), - unusedPublicKey, - TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart), - "memo", - validStart, - null, - validStart, - LedgerId.TESTNET, - true - ); + ScheduleId.fromString("1.2.3"), + AccountId.fromString("4.5.6"), + AccountId.fromString("2.3.4"), + SchedulableTransactionBody.newBuilder() + .setCryptoDelete(CryptoDeleteTransactionBody.newBuilder() + .setDeleteAccountID( + AccountId.fromString("6.6.6").toProtobuf()) + .build()) + .build(), + KeyList.of(unusedPublicKey), + unusedPublicKey, + TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart), + "memo", + validStart, + null, + validStart, + LedgerId.TESTNET, + true); } @Test @@ -82,8 +78,9 @@ void shouldSerialize() throws Exception { byte[] scheduleInfoBytes = originalScheduleInfo.toBytes(); var copyScheduleInfo = ScheduleInfo.fromBytes(scheduleInfoBytes); assertThat(copyScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test @@ -92,7 +89,8 @@ void shouldSerializeDeleted() throws Exception { byte[] scheduleInfoBytes = originalScheduleInfo.toBytes(); var copyScheduleInfo = ScheduleInfo.fromBytes(scheduleInfoBytes); assertThat(copyScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalScheduleInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java index 60bbee85c5..c409628c00 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java @@ -1,44 +1,18 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.ScheduleSignTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class ScheduleSignTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -54,9 +28,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -68,12 +40,12 @@ void shouldBytesNoSetters() throws Exception { private ScheduleSignTransaction spawnTestTransaction() { return new ScheduleSignTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setScheduleId(ScheduleId.fromString("0.0.444")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setScheduleId(ScheduleId.fromString("0.0.444")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/Snapshot.java b/sdk/src/test/java/com/hiero/sdk/Snapshot.java index 50255565d7..c2366e744f 100644 --- a/sdk/src/test/java/com/hiero/sdk/Snapshot.java +++ b/sdk/src/test/java/com/hiero/sdk/Snapshot.java @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.fasterxml.jackson.annotation.JsonAutoDetect; @@ -7,13 +8,11 @@ import com.fasterxml.jackson.core.PrettyPrinter; import com.fasterxml.jackson.core.util.DefaultIndenter; import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; -import com.fasterxml.jackson.core.util.Separators; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - -import javax.annotation.Nonnull; import java.io.IOException; import java.io.UncheckedIOException; +import javax.annotation.Nonnull; final class Snapshot { private static final ObjectMapper objectMapper = buildObjectMapper(); @@ -40,8 +39,7 @@ private static ObjectMapper buildObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - objectMapper.setVisibility( - objectMapper + objectMapper.setVisibility(objectMapper .getSerializationConfig() .getDefaultVisibilityChecker() .withFieldVisibility(JsonAutoDetect.Visibility.ANY) @@ -55,18 +53,18 @@ private static ObjectMapper buildObjectMapper() { * Modified copy of {@code io.github.jsonSnapshot.SnapshotMatcher#buildDefaultPrettyPrinter} */ private static PrettyPrinter buildDefaultPrettyPrinter() { - DefaultPrettyPrinter pp = - new DefaultPrettyPrinter() { - @Override - @Nonnull - public DefaultPrettyPrinter createInstance() { - return this; - } - @Override - public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException { - jg.writeRaw(": "); - } - }; + DefaultPrettyPrinter pp = new DefaultPrettyPrinter() { + @Override + @Nonnull + public DefaultPrettyPrinter createInstance() { + return this; + } + + @Override + public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException { + jg.writeRaw(": "); + } + }; DefaultPrettyPrinter.Indenter lfOnlyIndenter = new DefaultIndenter(" ", "\n"); pp.indentArraysWith(lfOnlyIndenter); pp.indentObjectsWith(lfOnlyIndenter); diff --git a/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java b/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java index a699493fc9..1d025ee94a 100644 --- a/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java @@ -1,17 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.StakingInfo; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; - public class StakingInfoTest { final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -26,25 +23,11 @@ public static void afterAll() { } StakingInfo spawnStakingInfoAccountExample() { - return new StakingInfo( - true, - validStart, - Hbar.from(5), - Hbar.from(10), - AccountId.fromString("1.2.3"), - null - ); + return new StakingInfo(true, validStart, Hbar.from(5), Hbar.from(10), AccountId.fromString("1.2.3"), null); } StakingInfo spawnStakingInfoNodeExample() { - return new StakingInfo( - true, - validStart, - Hbar.from(5), - Hbar.from(10), - null, - 3L - ); + return new StakingInfo(true, validStart, Hbar.from(5), Hbar.from(10), null, 3L); } @Test @@ -53,8 +36,9 @@ void shouldSerializeAccount() throws Exception { byte[] stakingInfoBytes = originalStakingInfo.toBytes(); var copyStakingInfo = StakingInfo.fromBytes(stakingInfoBytes); assertThat(copyStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test @@ -63,7 +47,8 @@ void shouldSerializeNode() throws Exception { byte[] stakingInfoBytes = originalStakingInfo.toBytes(); var copyStakingInfo = StakingInfo.fromBytes(stakingInfoBytes); assertThat(copyStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalStakingInfo.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/StatusTest.java b/sdk/src/test/java/com/hiero/sdk/StatusTest.java index 3e846477a4..b04c7fce89 100644 --- a/sdk/src/test/java/com/hiero/sdk/StatusTest.java +++ b/sdk/src/test/java/com/hiero/sdk/StatusTest.java @@ -1,32 +1,13 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.Status; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.proto.ResponseCodeEnum; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class StatusTest { @Test @DisplayName("Status can be constructed from any ResponseCode") @@ -47,8 +28,8 @@ void statusToResponseCode() { @Test @DisplayName("Status throws on Unrecognized") void statusUnrecognized() { - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> Status.valueOf(ResponseCodeEnum.UNRECOGNIZED) - ).withMessage("network returned unrecognized response code; your SDK may be out of date"); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Status.valueOf(ResponseCodeEnum.UNRECOGNIZED)) + .withMessage("network returned unrecognized response code; your SDK may be out of date"); } } diff --git a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java index 1788a4aee1..e094597c95 100644 --- a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java @@ -1,53 +1,25 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ScheduleDeleteTransaction; -import com.hiero.sdk.SystemDeleteTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.SystemDeleteTransactionBody; import com.hiero.sdk.proto.TimestampSeconds; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class SystemDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final FileId testFileId = FileId.fromString("4.2.0"); private static final ContractId testContractId = ContractId.fromString("0.6.9"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -68,11 +40,14 @@ void shouldSerializeFile() { } private SystemDeleteTransaction spawnTestTransactionFile() { - return new SystemDeleteTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(FileId.fromString("0.0.444")).setExpirationTime(validStart).setMaxTransactionFee(new Hbar(1)) - .freeze().sign(unusedPrivateKey); + return new SystemDeleteTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(FileId.fromString("0.0.444")) + .setExpirationTime(validStart) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -88,11 +63,14 @@ void shouldBytesNoSetters() throws Exception { } private SystemDeleteTransaction spawnTestTransactionContract() { - return new SystemDeleteTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContractId(ContractId.fromString("0.0.444")).setExpirationTime(validStart) - .setMaxTransactionFee(new Hbar(1)).freeze().sign(unusedPrivateKey); + return new SystemDeleteTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContractId(ContractId.fromString("0.0.444")) + .setExpirationTime(validStart) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -112,7 +90,8 @@ void shouldBytesFile() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setSystemDelete(SystemDeleteTransactionBody.newBuilder().build()).build(); + .setSystemDelete(SystemDeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -121,30 +100,35 @@ void fromScheduledTransaction() { @Test void constructSystemDeleteTransactionFromTransactionBodyProtobuf() { - var transactionBodyWithFileId = SystemDeleteTransactionBody.newBuilder().setFileID(testFileId.toProtobuf()) - .setExpirationTime(TimestampSeconds.newBuilder().setSeconds(validStart.getEpochSecond())); + var transactionBodyWithFileId = SystemDeleteTransactionBody.newBuilder() + .setFileID(testFileId.toProtobuf()) + .setExpirationTime(TimestampSeconds.newBuilder().setSeconds(validStart.getEpochSecond())); var transactionBodyWithContractId = SystemDeleteTransactionBody.newBuilder() - .setContractID(testContractId.toProtobuf()) - .setExpirationTime(TimestampSeconds.newBuilder().setSeconds(validStart.getEpochSecond())); + .setContractID(testContractId.toProtobuf()) + .setExpirationTime(TimestampSeconds.newBuilder().setSeconds(validStart.getEpochSecond())); - var txWithFileId = TransactionBody.newBuilder().setSystemDelete(transactionBodyWithFileId).build(); + var txWithFileId = TransactionBody.newBuilder() + .setSystemDelete(transactionBodyWithFileId) + .build(); var systemDeleteTransactionWithFileId = new SystemDeleteTransaction(txWithFileId); - var txWithContractId = TransactionBody.newBuilder().setSystemDelete(transactionBodyWithContractId).build(); + var txWithContractId = TransactionBody.newBuilder() + .setSystemDelete(transactionBodyWithContractId) + .build(); var systemDeleteTransactionWithContractId = new SystemDeleteTransaction(txWithContractId); assertNotNull(systemDeleteTransactionWithFileId.getFileId()); assertThat(systemDeleteTransactionWithFileId.getFileId()).isEqualTo(testFileId); assertNull(systemDeleteTransactionWithFileId.getContractId()); - assertThat(systemDeleteTransactionWithFileId.getExpirationTime().getEpochSecond()).isEqualTo( - validStart.getEpochSecond()); + assertThat(systemDeleteTransactionWithFileId.getExpirationTime().getEpochSecond()) + .isEqualTo(validStart.getEpochSecond()); assertNull(systemDeleteTransactionWithContractId.getFileId()); assertNotNull(systemDeleteTransactionWithContractId.getContractId()); assertThat(systemDeleteTransactionWithContractId.getContractId()).isEqualTo(testContractId); - assertThat(systemDeleteTransactionWithContractId.getExpirationTime().getEpochSecond()).isEqualTo( - validStart.getEpochSecond()); + assertThat(systemDeleteTransactionWithContractId.getExpirationTime().getEpochSecond()) + .isEqualTo(validStart.getEpochSecond()); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java index 4ecff01844..e1ab07e19c 100644 --- a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java @@ -1,48 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ScheduleDeleteTransaction; -import com.hiero.sdk.SystemUndeleteTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.SystemUndeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class SystemUndeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -58,9 +30,7 @@ public static void afterAll() { @Test void shouldSerializeFile() { - SnapshotMatcher.expect(spawnTestTransactionFile() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransactionFile().toString()).toMatchSnapshot(); } @Test @@ -72,29 +42,27 @@ void shouldBytesNoSetters() throws Exception { private SystemUndeleteTransaction spawnTestTransactionFile() { return new SystemUndeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFileId(FileId.fromString("0.0.444")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFileId(FileId.fromString("0.0.444")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test void shouldSerializeContract() { - SnapshotMatcher.expect(spawnTestTransactionContract() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransactionContract().toString()).toMatchSnapshot(); } private SystemUndeleteTransaction spawnTestTransactionContract() { return new SystemUndeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setContractId(ContractId.fromString("0.0.444")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setContractId(ContractId.fromString("0.0.444")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -114,8 +82,8 @@ void shouldBytesFile() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setSystemUndelete(SystemUndeleteTransactionBody.newBuilder().build()) - .build(); + .setSystemUndelete(SystemUndeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TestResponse.java b/sdk/src/test/java/com/hiero/sdk/TestResponse.java index b7672793ad..982beda8cd 100644 --- a/sdk/src/test/java/com/hiero/sdk/TestResponse.java +++ b/sdk/src/test/java/com/hiero/sdk/TestResponse.java @@ -1,47 +1,27 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.Status; import com.hiero.sdk.proto.Response; import com.hiero.sdk.proto.TransactionGetReceiptResponse; import com.hiero.sdk.proto.TransactionReceipt; import com.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; - import javax.annotation.Nullable; public class TestResponse { @Nullable public final TransactionResponse transactionResponse; + @Nullable public final Response queryResponse; + @Nullable public final StatusRuntimeException errorResponse; private TestResponse( - @Nullable TransactionResponse transactionResponse, - @Nullable Response queryResponse, - @Nullable StatusRuntimeException errorResponse - ) { + @Nullable TransactionResponse transactionResponse, + @Nullable Response queryResponse, + @Nullable StatusRuntimeException errorResponse) { this.transactionResponse = transactionResponse; this.queryResponse = queryResponse; this.errorResponse = errorResponse; @@ -68,11 +48,13 @@ public static TestResponse query(Response queryResponse) { } public static TestResponse receipt(Status status) { - var response = Response.newBuilder().setTransactionGetReceipt( - TransactionGetReceiptResponse.newBuilder().setReceipt( - TransactionReceipt.newBuilder().setStatus(status.code).build() - ).build() - ).build(); + var response = Response.newBuilder() + .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() + .setReceipt(TransactionReceipt.newBuilder() + .setStatus(status.code) + .build()) + .build()) + .build(); return new TestResponse(null, response, null); } @@ -86,8 +68,8 @@ public static TestResponse error(StatusRuntimeException exception) { public static TransactionResponse buildTransactionResponse(Status status, Hbar cost) { return TransactionResponse.newBuilder() - .setNodeTransactionPrecheckCode(status.code) - .setCost(cost.toTinybars()) - .build(); + .setNodeTransactionPrecheckCode(status.code) + .setCost(cost.toTinybars()) + .build(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TestServer.java b/sdk/src/test/java/com/hiero/sdk/TestServer.java index 70a8ad325e..7ee4279846 100644 --- a/sdk/src/test/java/com/hiero/sdk/TestServer.java +++ b/sdk/src/test/java/com/hiero/sdk/TestServer.java @@ -1,31 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.PrivateKey; import io.grpc.BindableService; import io.grpc.Server; import io.grpc.inprocess.InProcessServerBuilder; - import java.io.IOException; import java.time.Duration; import java.util.HashMap; @@ -52,9 +30,9 @@ public TestServer(String name, BindableService... services) throws IOException { network.put("in-process:" + name + "[0]", AccountId.fromString("1.1.1")); network.put("in-process:" + name + "[1]", AccountId.fromString("2.2.2")); client = Client.forNetwork(network) - .setNodeMinBackoff(Duration.ofMillis(500)) - .setNodeMaxBackoff(Duration.ofMillis(500)) - .setOperator(AccountId.fromString("2.2.2"), PrivateKey.generate()); + .setNodeMinBackoff(Duration.ofMillis(500)) + .setNodeMaxBackoff(Duration.ofMillis(500)) + .setOperator(AccountId.fromString("2.2.2"), PrivateKey.generate()); } public void close() throws TimeoutException, InterruptedException { diff --git a/sdk/src/test/java/com/hiero/sdk/TestService.java b/sdk/src/test/java/com/hiero/sdk/TestService.java index 74a06b5ebd..e6ce483819 100644 --- a/sdk/src/test/java/com/hiero/sdk/TestService.java +++ b/sdk/src/test/java/com/hiero/sdk/TestService.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.Query; @@ -25,21 +7,19 @@ import com.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; - -import javax.annotation.Nullable; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; import java.util.Queue; +import javax.annotation.Nullable; public interface TestService { private static void respond( - StreamObserver streamObserver, - @Nullable ResponseTypeT normalResponse, - @Nullable StatusRuntimeException errorResponse, - String exceptionString - ) { + StreamObserver streamObserver, + @Nullable ResponseTypeT normalResponse, + @Nullable StatusRuntimeException errorResponse, + String exceptionString) { if (normalResponse != null) { streamObserver.onNext(normalResponse); streamObserver.onCompleted(); @@ -52,7 +32,8 @@ private static void respond( Buffer getBuffer(); - default void respondToTransaction(Transaction request, StreamObserver streamObserver, TestResponse response) { + default void respondToTransaction( + Transaction request, StreamObserver streamObserver, TestResponse response) { getBuffer().transactionRequestsReceived.add(request); var exceptionString = "TestService tried to respond to transaction with query response"; @@ -66,8 +47,10 @@ default void respondToQuery(Query request, StreamObserver streamObserv respond(streamObserver, response.queryResponse, response.errorResponse, exceptionString); } - default void respondToTransactionFromQueue(Transaction request, StreamObserver streamObserver) { - respondToTransaction(request, streamObserver, getBuffer().responsesToSend.remove()); + default void respondToTransactionFromQueue( + Transaction request, StreamObserver streamObserver) { + respondToTransaction( + request, streamObserver, getBuffer().responsesToSend.remove()); } default void respondToQueryFromQueue(Query request, StreamObserver streamObserver) { diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java index 31448216ce..6a26285003 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -25,15 +7,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenAirdropTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenNftTransfer; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenAirdropTransactionBody; import com.hiero.sdk.proto.TokenServiceGrpc; @@ -49,7 +22,7 @@ class TokenAirdropTransactionTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); private TokenAirdropTransaction transaction; @@ -71,9 +44,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -85,23 +56,41 @@ void shouldBytesNoSetters() throws Exception { private TokenAirdropTransaction spawnTestTransaction() { return new TokenAirdropTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .addTokenTransfer(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5008"), 400) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5006"), -800, 3) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5007"), 400, 3) - .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5008"), 1) - .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), -1) - .addNftTransfer(TokenId.fromString("0.0.3").nft(2), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5007")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(1), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5007")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(3), AccountId.fromString("0.0.5008"), AccountId.fromString("0.0.5006")) - .addNftTransfer(TokenId.fromString("0.0.3").nft(4), AccountId.fromString("0.0.5007"), AccountId.fromString("0.0.5006")) - .addNftTransfer(TokenId.fromString("0.0.2").nft(4), AccountId.fromString("0.0.5007"), AccountId.fromString("0.0.5006")) - .addApprovedTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), 123) - .addApprovedNftTransfer(new NftId(TokenId.fromString("0.0.4"), 4), AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006")) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .addTokenTransfer(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5008"), 400) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5006"), -800, 3) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.5007"), 400, 3) + .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5008"), 1) + .addTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), -1) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(2), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5007")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(1), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5007")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(3), + AccountId.fromString("0.0.5008"), + AccountId.fromString("0.0.5006")) + .addNftTransfer( + TokenId.fromString("0.0.3").nft(4), + AccountId.fromString("0.0.5007"), + AccountId.fromString("0.0.5006")) + .addNftTransfer( + TokenId.fromString("0.0.2").nft(4), + AccountId.fromString("0.0.5007"), + AccountId.fromString("0.0.5006")) + .addApprovedTokenTransfer(TokenId.fromString("0.0.4"), AccountId.fromString("0.0.5006"), 123) + .addApprovedNftTransfer( + new NftId(TokenId.fromString("0.0.4"), 4), + AccountId.fromString("0.0.5005"), + AccountId.fromString("0.0.5006")) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(privateKey); } @Test @@ -115,8 +104,8 @@ void shouldBytes() throws Exception { void decimalsMustBeConsistent() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { new TokenAirdropTransaction() - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.8"), 100, 2) - .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.7"), -100, 3); + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.8"), 100, 2) + .addTokenTransferWithDecimals(TokenId.fromString("0.0.5"), AccountId.fromString("0.0.7"), -100, 3); }); } @@ -133,8 +122,8 @@ void canGetDecimals() { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenAirdrop(TokenAirdropTransactionBody.newBuilder().build()) - .build(); + .setTokenAirdrop(TokenAirdropTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -143,7 +132,8 @@ void fromScheduledTransaction() { @Test void testDefaultMaxTransactionFeeIsSet() { - assertEquals(new Hbar(1), transaction.getDefaultMaxTransactionFee(), "Default max transaction fee should be 1 Hbar"); + assertEquals( + new Hbar(1), transaction.getDefaultMaxTransactionFee(), "Default max transaction fee should be 1 Hbar"); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java index 45dfcf3868..65f206951b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java @@ -1,13 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.TokenAllowance; -import com.hiero.sdk.TokenId; -import org.junit.jupiter.api.Test; - import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; + public class TokenAllowanceTest { private static final TokenId testTokenId = TokenId.fromString("0.6.9"); @@ -17,8 +15,8 @@ public class TokenAllowanceTest { @Test void constructWithTokenIdOwnerSpenderAmount() { - TokenAllowance tokenAllowance = new TokenAllowance(testTokenId, testOwnerAccountId, testSpenderAccountId, - testAmount); + TokenAllowance tokenAllowance = + new TokenAllowance(testTokenId, testOwnerAccountId, testSpenderAccountId, testAmount); assertThat(tokenAllowance.tokenId).isEqualTo(testTokenId); assertThat(tokenAllowance.ownerAccountId).isEqualTo(testOwnerAccountId); @@ -28,8 +26,8 @@ void constructWithTokenIdOwnerSpenderAmount() { @Test void fromProtobuf() { - var tokenAllowanceProtobuf = new TokenAllowance(testTokenId, testOwnerAccountId, testSpenderAccountId, - testAmount).toProtobuf(); + var tokenAllowanceProtobuf = + new TokenAllowance(testTokenId, testOwnerAccountId, testSpenderAccountId, testAmount).toProtobuf(); var tokenAllowance = TokenAllowance.fromProtobuf(tokenAllowanceProtobuf); assertThat(tokenAllowance.tokenId).isEqualTo(testTokenId); @@ -40,8 +38,8 @@ void fromProtobuf() { @Test void toProtobuf() { - var tokenAllowanceProtobuf = new TokenAllowance(testTokenId, testOwnerAccountId, testSpenderAccountId, - testAmount).toProtobuf(); + var tokenAllowanceProtobuf = + new TokenAllowance(testTokenId, testOwnerAccountId, testSpenderAccountId, testAmount).toProtobuf(); assertTrue(tokenAllowanceProtobuf.hasTokenId()); assertThat(TokenId.fromProtobuf(tokenAllowanceProtobuf.getTokenId())).isEqualTo(testTokenId); @@ -51,6 +49,5 @@ void toProtobuf() { assertTrue(tokenAllowanceProtobuf.hasSpender()); assertThat(AccountId.fromProtobuf(tokenAllowanceProtobuf.getSpender())).isEqualTo(testSpenderAccountId); - } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java index a416d40d1e..0b5253438d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java @@ -1,54 +1,27 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenAssociateTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TokenAssociateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final AccountId accountId = AccountId.fromString("1.2.3"); - private static final List tokenIds = List.of(TokenId.fromString("4.5.6"), - TokenId.fromString("7.8.9"), - TokenId.fromString("10.11.12")); + private static final List tokenIds = + List.of(TokenId.fromString("4.5.6"), TokenId.fromString("7.8.9"), TokenId.fromString("10.11.12")); final Instant validStart = Instant.ofEpochSecond(1554158542); @BeforeAll @@ -63,9 +36,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -77,13 +48,13 @@ void shouldBytesNoSetters() throws Exception { private TokenAssociateTransaction spawnTestTransaction() { return new TokenAssociateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.222")) - .setTokenIds(Collections.singletonList(TokenId.fromString("0.0.666"))) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.222")) + .setTokenIds(Collections.singletonList(TokenId.fromString("0.0.666"))) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -96,8 +67,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenAssociate(TokenAssociateTransactionBody.newBuilder().build()) - .build(); + .setTokenAssociate(TokenAssociateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -107,9 +78,11 @@ void fromScheduledTransaction() { @Test void constructTokenDeleteTransactionFromTransactionBodyProtobuf() { var transactionBody = TokenAssociateTransactionBody.newBuilder() - .addAllTokens(tokenIds.stream().map(TokenId::toProtobuf).toList()) - .setAccount(accountId.toProtobuf()).build(); - var txBody = TransactionBody.newBuilder().setTokenAssociate(transactionBody).build(); + .addAllTokens(tokenIds.stream().map(TokenId::toProtobuf).toList()) + .setAccount(accountId.toProtobuf()) + .build(); + var txBody = + TransactionBody.newBuilder().setTokenAssociate(transactionBody).build(); var tokenAssociateTransaction = new TokenAssociateTransaction(txBody); assertThat(tokenAssociateTransaction.getAccountId()).isEqualTo(accountId); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java index b17332940a..3e05345be0 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java @@ -1,18 +1,15 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.TokenAssociation; -import com.hiero.sdk.TokenId; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; - - public class TokenAssociationTest { private static final AccountId testAccountId = AccountId.fromString("4.2.0"); private static final TokenId testTokenId = TokenId.fromString("0.6.9"); @@ -28,10 +25,7 @@ public static void afterAll() { } TokenAssociation spawnTokenAssociationExample() { - return new TokenAssociation( - TokenId.fromString("1.2.3"), - AccountId.fromString("4.5.6") - ); + return new TokenAssociation(TokenId.fromString("1.2.3"), AccountId.fromString("4.5.6")); } @Test @@ -40,8 +34,9 @@ void shouldSerializeAccount() throws Exception { byte[] tokenAssociationBytes = originalTokenAssociation.toBytes(); var copyTokenAssociation = TokenAssociation.fromBytes(tokenAssociationBytes); assertThat(copyTokenAssociation.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalTokenAssociation.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalTokenAssociation.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalTokenAssociation.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalTokenAssociation.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test @@ -62,12 +57,9 @@ void toProtobuf() { assertThat(tokenAssociationProtobuf.getAccountId().getRealmNum()).isEqualTo(testAccountId.realm); assertThat(tokenAssociationProtobuf.getAccountId().getAccountNum()).isEqualTo(testAccountId.num); assertTrue(tokenAssociationProtobuf.hasTokenId()); - assertThat(tokenAssociationProtobuf.getTokenId().getShardNum()).isEqualTo( - testTokenId.shard); - assertThat(tokenAssociationProtobuf.getTokenId().getRealmNum()).isEqualTo( - testTokenId.realm); - assertThat(tokenAssociationProtobuf.getTokenId().getTokenNum()).isEqualTo( - testTokenId.num); + assertThat(tokenAssociationProtobuf.getTokenId().getShardNum()).isEqualTo(testTokenId.shard); + assertThat(tokenAssociationProtobuf.getTokenId().getRealmNum()).isEqualTo(testTokenId.realm); + assertThat(tokenAssociationProtobuf.getTokenId().getTokenNum()).isEqualTo(testTokenId.num); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java index 75d5b2b679..56b9b2800d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java @@ -1,50 +1,24 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenBurnTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenBurnTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TokenBurnTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final long testAmount = 69L; private static final List testSerials = Collections.singletonList(420L); @@ -66,11 +40,14 @@ void shouldSerializeFungible() { } private TokenBurnTransaction spawnTestTransaction() { - return new TokenBurnTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId).setAmount(testAmount).setMaxTransactionFee(new Hbar(1)).freeze() - .sign(unusedPrivateKey); + return new TokenBurnTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setAmount(testAmount) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -86,11 +63,14 @@ void shouldSerializeNft() { } private TokenBurnTransaction spawnTestTransactionNft() { - return new TokenBurnTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId).setSerials(testSerials).setMaxTransactionFee(new Hbar(1)).freeze() - .sign(unusedPrivateKey); + return new TokenBurnTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setSerials(testSerials) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -110,7 +90,8 @@ void shouldBytesNft() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenBurn(TokenBurnTransactionBody.newBuilder().build()).build(); + .setTokenBurn(TokenBurnTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -119,8 +100,11 @@ void fromScheduledTransaction() { @Test void constructTokenBurnTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenBurnTransactionBody.newBuilder().setToken(testTokenId.toProtobuf()) - .setAmount(testAmount).addAllSerialNumbers(testSerials).build(); + var transactionBody = TokenBurnTransactionBody.newBuilder() + .setToken(testTokenId.toProtobuf()) + .setAmount(testAmount) + .addAllSerialNumbers(testSerials) + .build(); var tx = TransactionBody.newBuilder().setTokenBurn(transactionBody).build(); var tokenBurnTransaction = new TokenBurnTransaction(tx); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java index fa996c0fab..dd82329d4f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java @@ -1,35 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PendingAirdropId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenCancelAirdropTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenCancelAirdropTransactionBody; import com.hiero.sdk.proto.TokenServiceGrpc; @@ -48,7 +21,7 @@ class TokenCancelAirdropTransactionTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); private TokenCancelAirdropTransaction transaction; @@ -64,26 +37,25 @@ public static void afterAll() { private TokenCancelAirdropTransaction spawnTestTransaction() { List pendingAirdropIds = new ArrayList<>(); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123))); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new NftId(new TokenId(0, 0, 1234), 123))); + pendingAirdropIds.add( + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123))); + pendingAirdropIds.add(new PendingAirdropId( + new AccountId(0, 0, 457), new AccountId(0, 0, 456), new NftId(new TokenId(0, 0, 1234), 123))); return new TokenCancelAirdropTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setPendingAirdropIds(pendingAirdropIds) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setPendingAirdropIds(pendingAirdropIds) + .freeze() + .sign(privateKey); } @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } + @Test void shouldBytesNoSetters() throws Exception { var tx = new TokenCancelAirdropTransaction(); @@ -104,10 +76,10 @@ void testConstructorSetsDefaultMaxTransactionFee() { @Test void testGetAndSetPendingAirdropIds() { List pendingAirdropIds = new ArrayList<>(); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123))); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new NftId(new TokenId(0, 0, 1234), 123))); + pendingAirdropIds.add( + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123))); + pendingAirdropIds.add(new PendingAirdropId( + new AccountId(0, 0, 457), new AccountId(0, 0, 456), new NftId(new TokenId(0, 0, 1234), 123))); transaction.setPendingAirdropIds(pendingAirdropIds); @@ -122,8 +94,8 @@ void testSetPendingAirdropIdsNullThrowsException() { @Test void testClearPendingAirdropIds() { List pendingAirdropIds = new ArrayList<>(); - PendingAirdropId pendingAirdropId = new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123)); + PendingAirdropId pendingAirdropId = + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123)); pendingAirdropIds.add(pendingAirdropId); transaction.setPendingAirdropIds(pendingAirdropIds); @@ -134,10 +106,10 @@ void testClearPendingAirdropIds() { @Test void testAddAllPendingAirdrops() { - PendingAirdropId pendingAirdropId1 = new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123)); - PendingAirdropId pendingAirdropId2 = new PendingAirdropId(new AccountId(0, 0, 458), new AccountId(0, 0, 459), - new TokenId(0, 0, 123)); + PendingAirdropId pendingAirdropId1 = + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123)); + PendingAirdropId pendingAirdropId2 = + new PendingAirdropId(new AccountId(0, 0, 458), new AccountId(0, 0, 459), new TokenId(0, 0, 123)); transaction.addPendingAirdrop(pendingAirdropId1); transaction.addPendingAirdrop(pendingAirdropId2); @@ -154,8 +126,8 @@ void testAddAllPendingAirdropsNullThrowsException() { @Test void testBuildTransactionBody() { - PendingAirdropId pendingAirdropId = new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new NftId(new TokenId(0, 0, 1234), 123)); + PendingAirdropId pendingAirdropId = new PendingAirdropId( + new AccountId(0, 0, 457), new AccountId(0, 0, 456), new NftId(new TokenId(0, 0, 1234), 123)); transaction.addPendingAirdrop(pendingAirdropId); TokenCancelAirdropTransactionBody.Builder builder = transaction.build(); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java index 1cdb201e52..6d7c2c72d5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java @@ -1,35 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PendingAirdropId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenClaimAirdropTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenClaimAirdropTransactionBody; import com.hiero.sdk.proto.TokenServiceGrpc; @@ -48,7 +21,7 @@ class TokenClaimAirdropTransactionTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); private TokenClaimAirdropTransaction transaction; @@ -64,25 +37,23 @@ public static void afterAll() { private TokenClaimAirdropTransaction spawnTestTransaction() { List pendingAirdropIds = new ArrayList<>(); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123))); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new NftId(new TokenId(0, 0, 1234), 123))); + pendingAirdropIds.add( + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123))); + pendingAirdropIds.add(new PendingAirdropId( + new AccountId(0, 0, 457), new AccountId(0, 0, 456), new NftId(new TokenId(0, 0, 1234), 123))); return new TokenClaimAirdropTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setPendingAirdropIds(pendingAirdropIds) - .freeze() - .sign(privateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setPendingAirdropIds(pendingAirdropIds) + .freeze() + .sign(privateKey); } @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -105,10 +76,10 @@ void testConstructorSetsDefaultMaxTransactionFee() { @Test void testGetAndSetPendingAirdropIds() { List pendingAirdropIds = new ArrayList<>(); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123))); - pendingAirdropIds.add(new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new NftId(new TokenId(0, 0, 1234), 123))); + pendingAirdropIds.add( + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123))); + pendingAirdropIds.add(new PendingAirdropId( + new AccountId(0, 0, 457), new AccountId(0, 0, 456), new NftId(new TokenId(0, 0, 1234), 123))); transaction.setPendingAirdropIds(pendingAirdropIds); @@ -123,8 +94,8 @@ void testSetPendingAirdropIdsNullThrowsException() { @Test void testClearPendingAirdropIds() { List pendingAirdropIds = new ArrayList<>(); - PendingAirdropId pendingAirdropId = new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123)); + PendingAirdropId pendingAirdropId = + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123)); pendingAirdropIds.add(pendingAirdropId); transaction.setPendingAirdropIds(pendingAirdropIds); @@ -135,10 +106,10 @@ void testClearPendingAirdropIds() { @Test void testAddAllPendingAirdrops() { - PendingAirdropId pendingAirdropId1 = new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new TokenId(0, 0, 123)); - PendingAirdropId pendingAirdropId2 = new PendingAirdropId(new AccountId(0, 0, 458), new AccountId(0, 0, 459), - new TokenId(0, 0, 123)); + PendingAirdropId pendingAirdropId1 = + new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), new TokenId(0, 0, 123)); + PendingAirdropId pendingAirdropId2 = + new PendingAirdropId(new AccountId(0, 0, 458), new AccountId(0, 0, 459), new TokenId(0, 0, 123)); transaction.addPendingAirdrop(pendingAirdropId1); transaction.addPendingAirdrop(pendingAirdropId2); @@ -155,8 +126,8 @@ void testAddAllPendingAirdropsNullThrowsException() { @Test void testBuildTransactionBody() { - PendingAirdropId pendingAirdropId = new PendingAirdropId(new AccountId(0, 0, 457), new AccountId(0, 0, 456), - new NftId(new TokenId(0, 0, 1234), 123)); + PendingAirdropId pendingAirdropId = new PendingAirdropId( + new AccountId(0, 0, 457), new AccountId(0, 0, 456), new NftId(new TokenId(0, 0, 1234), 123)); transaction.addPendingAirdrop(pendingAirdropId); TokenClaimAirdropTransactionBody.Builder builder = transaction.build(); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java index 7161a8e4d8..a097317070 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -24,18 +6,6 @@ import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.Timestamp; import com.hiero.sdk.proto.TokenCreateTransactionBody; @@ -52,31 +22,31 @@ public class TokenCreateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final PublicKey testAdminKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") + .getPublicKey(); private static final PublicKey testKycKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") + .getPublicKey(); private static final PublicKey testFreezeKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e13") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e13") + .getPublicKey(); private static final PublicKey testWipeKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e14") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e14") + .getPublicKey(); private static final PublicKey testSupplyKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e15") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e15") + .getPublicKey(); private static final PublicKey testFeeScheduleKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e16") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e16") + .getPublicKey(); private static final PublicKey testPauseKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e17") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e17") + .getPublicKey(); private static final PublicKey testMetadataKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e18") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e18") + .getPublicKey(); private static final AccountId testTreasuryAccountId = AccountId.fromString("7.7.7"); private static final AccountId testAutoRenewAccountId = AccountId.fromString("8.8.8"); private static final long testInitialSupply = 30; @@ -88,10 +58,11 @@ public class TokenCreateTransactionTest { private static final String testTokenMemo = "test memo"; private static final Duration testAutoRenewPeriod = Duration.ofHours(10); private static final Instant testExpirationTime = Instant.now(); - private static final List testCustomFees = Collections.singletonList( - new CustomFixedFee().setFeeCollectorAccountId(AccountId.fromString("0.0.543")).setAmount(3) + private static final List testCustomFees = Collections.singletonList(new CustomFixedFee() + .setFeeCollectorAccountId(AccountId.fromString("0.0.543")) + .setAmount(3) .setDenominatingTokenId(TokenId.fromString("4.3.2"))); - private static final byte[] testMetadata = new byte[]{1, 2, 3, 4, 5}; + private static final byte[] testMetadata = new byte[] {1, 2, 3, 4, 5}; final Instant validStart = Instant.ofEpochSecond(1554158542); @BeforeAll @@ -122,17 +93,32 @@ void shouldSerializeNft() { } private TokenCreateTransaction spawnTestTransactionFungible() { - return new TokenCreateTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setInitialSupply(testInitialSupply).setFeeScheduleKey(testFeeScheduleKey).setSupplyKey(testSupplyKey) - .setAdminKey(testAdminKey).setAutoRenewAccountId(testAutoRenewAccountId) - .setAutoRenewPeriod(testAutoRenewPeriod).setDecimals(testDecimals).setFreezeDefault(testFreezeDefault) - .setFreezeKey(testFreezeKey).setWipeKey(testWipeKey).setTokenSymbol(testTokenSymbol).setKycKey(testKycKey) - .setPauseKey(testPauseKey).setMetadataKey(testMetadataKey).setExpirationTime(validStart) - .setTreasuryAccountId(testTreasuryAccountId).setTokenName(testTokenName).setTokenMemo(testTokenMemo) - .setCustomFees(testCustomFees).setMaxTransactionFee(new Hbar(1)).setTokenMetadata(testMetadata).freeze() - .sign(unusedPrivateKey); + return new TokenCreateTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setInitialSupply(testInitialSupply) + .setFeeScheduleKey(testFeeScheduleKey) + .setSupplyKey(testSupplyKey) + .setAdminKey(testAdminKey) + .setAutoRenewAccountId(testAutoRenewAccountId) + .setAutoRenewPeriod(testAutoRenewPeriod) + .setDecimals(testDecimals) + .setFreezeDefault(testFreezeDefault) + .setFreezeKey(testFreezeKey) + .setWipeKey(testWipeKey) + .setTokenSymbol(testTokenSymbol) + .setKycKey(testKycKey) + .setPauseKey(testPauseKey) + .setMetadataKey(testMetadataKey) + .setExpirationTime(validStart) + .setTreasuryAccountId(testTreasuryAccountId) + .setTokenName(testTokenName) + .setTokenMemo(testTokenMemo) + .setCustomFees(testCustomFees) + .setMaxTransactionFee(new Hbar(1)) + .setTokenMetadata(testMetadata) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -143,17 +129,31 @@ void shouldBytesFungible() throws Exception { } private TokenCreateTransaction spawnTestTransactionNft() { - return new TokenCreateTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setFeeScheduleKey(testFeeScheduleKey).setSupplyKey(testSupplyKey).setMaxSupply(testMaxSupply) - .setAdminKey(testAdminKey).setAutoRenewAccountId(testAutoRenewAccountId) - .setAutoRenewPeriod(testAutoRenewPeriod).setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setSupplyType(TokenSupplyType.FINITE).setFreezeKey(testFreezeKey).setWipeKey(testWipeKey) - .setTokenSymbol(testTokenSymbol).setKycKey(testKycKey).setPauseKey(testPauseKey) - .setMetadataKey(testMetadataKey).setExpirationTime(validStart).setTreasuryAccountId(testTreasuryAccountId) - .setTokenName(testTokenName).setTokenMemo(testTokenMemo).setMaxTransactionFee(new Hbar(1)) - .setTokenMetadata(testMetadata).freeze().sign(unusedPrivateKey); + return new TokenCreateTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setFeeScheduleKey(testFeeScheduleKey) + .setSupplyKey(testSupplyKey) + .setMaxSupply(testMaxSupply) + .setAdminKey(testAdminKey) + .setAutoRenewAccountId(testAutoRenewAccountId) + .setAutoRenewPeriod(testAutoRenewPeriod) + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setSupplyType(TokenSupplyType.FINITE) + .setFreezeKey(testFreezeKey) + .setWipeKey(testWipeKey) + .setTokenSymbol(testTokenSymbol) + .setKycKey(testKycKey) + .setPauseKey(testPauseKey) + .setMetadataKey(testMetadataKey) + .setExpirationTime(validStart) + .setTreasuryAccountId(testTreasuryAccountId) + .setTokenName(testTokenName) + .setTokenMemo(testTokenMemo) + .setMaxTransactionFee(new Hbar(1)) + .setTokenMetadata(testMetadata) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -166,7 +166,8 @@ void shouldBytesNft() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenCreation(TokenCreateTransactionBody.newBuilder().build()).build(); + .setTokenCreation(TokenCreateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -175,19 +176,33 @@ void fromScheduledTransaction() { @Test void constructTokenCreateTransactionFungibleFromTransactionBodyProtobuf() { - var transactionBody = TokenCreateTransactionBody.newBuilder().setInitialSupply(testInitialSupply) - .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()).setSupplyKey(testSupplyKey.toProtobufKey()) - .setAdminKey(testAdminKey.toProtobufKey()).setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) - .setAutoRenewPeriod( - com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) - .build()).setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) - .setDecimals(testDecimals).setFreezeDefault(testFreezeDefault).setFreezeKey(testFreezeKey.toProtobufKey()) - .setWipeKey(testWipeKey.toProtobufKey()).setSymbol(testTokenSymbol).setKycKey(testKycKey.toProtobufKey()) - .setPauseKey(testPauseKey.toProtobufKey()).setMetadataKey(testMetadataKey.toProtobufKey()) - .setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond())) - .setTreasury(testTreasuryAccountId.toProtobuf()).setName(testTokenName).setMemo(testTokenMemo) - .addCustomFees(Iterables.getLast(testCustomFees).toProtobuf()) - .setMetadata(ByteString.copyFrom(testMetadata)).build(); + var transactionBody = TokenCreateTransactionBody.newBuilder() + .setInitialSupply(testInitialSupply) + .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()) + .setSupplyKey(testSupplyKey.toProtobufKey()) + .setAdminKey(testAdminKey.toProtobufKey()) + .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) + .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setSeconds(testAutoRenewPeriod.toSeconds()) + .build()) + .setExpiry(Timestamp.newBuilder() + .setSeconds(testExpirationTime.getEpochSecond()) + .build()) + .setDecimals(testDecimals) + .setFreezeDefault(testFreezeDefault) + .setFreezeKey(testFreezeKey.toProtobufKey()) + .setWipeKey(testWipeKey.toProtobufKey()) + .setSymbol(testTokenSymbol) + .setKycKey(testKycKey.toProtobufKey()) + .setPauseKey(testPauseKey.toProtobufKey()) + .setMetadataKey(testMetadataKey.toProtobufKey()) + .setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond())) + .setTreasury(testTreasuryAccountId.toProtobuf()) + .setName(testTokenName) + .setMemo(testTokenMemo) + .addCustomFees(Iterables.getLast(testCustomFees).toProtobuf()) + .setMetadata(ByteString.copyFrom(testMetadata)) + .build(); var tx = TransactionBody.newBuilder().setTokenCreation(transactionBody).build(); var tokenCreateTransaction = new TokenCreateTransaction(tx); @@ -205,32 +220,44 @@ void constructTokenCreateTransactionFungibleFromTransactionBodyProtobuf() { assertThat(tokenCreateTransaction.getKycKey()).isEqualTo(testKycKey); assertThat(tokenCreateTransaction.getPauseKey()).isEqualTo(testPauseKey); assertThat(tokenCreateTransaction.getMetadataKey()).isEqualTo(testMetadataKey); - assertThat(tokenCreateTransaction.getExpirationTime().getEpochSecond()).isEqualTo( - testExpirationTime.getEpochSecond()); + assertThat(tokenCreateTransaction.getExpirationTime().getEpochSecond()) + .isEqualTo(testExpirationTime.getEpochSecond()); assertThat(tokenCreateTransaction.getTreasuryAccountId()).isEqualTo(testTreasuryAccountId); assertThat(tokenCreateTransaction.getTokenName()).isEqualTo(testTokenName); assertThat(tokenCreateTransaction.getTokenMemo()).isEqualTo(testTokenMemo); assertThat(tokenCreateTransaction.getTokenType()).isEqualTo(TokenType.FUNGIBLE_COMMON); - assertThat(Iterables.getLast(tokenCreateTransaction.getCustomFees()).toBytes()).isEqualTo( - Iterables.getLast(testCustomFees).toBytes()); + assertThat(Iterables.getLast(tokenCreateTransaction.getCustomFees()).toBytes()) + .isEqualTo(Iterables.getLast(testCustomFees).toBytes()); assertThat(tokenCreateTransaction.getTokenMetadata()).isEqualTo(testMetadata); } @Test void constructTokenCreateTransactionNftFromTransactionBodyProtobuf() { var transactionBody = TokenCreateTransactionBody.newBuilder() - .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()).setSupplyKey(testSupplyKey.toProtobufKey()) - .setMaxSupply(testMaxSupply).setAdminKey(testAdminKey.toProtobufKey()) - .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()).setAutoRenewPeriod( - com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) - .build()).setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) - .setTokenType(com.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE) - .setSupplyType(com.hiero.sdk.proto.TokenSupplyType.FINITE) - .setFreezeKey(testFreezeKey.toProtobufKey()).setWipeKey(testWipeKey.toProtobufKey()) - .setSymbol(testTokenSymbol).setKycKey(testKycKey.toProtobufKey()).setPauseKey(testPauseKey.toProtobufKey()) - .setMetadataKey(testMetadataKey.toProtobufKey()) - .setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond())) - .setTreasury(testTreasuryAccountId.toProtobuf()).setName(testTokenName).setMemo(testTokenMemo).build(); + .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()) + .setSupplyKey(testSupplyKey.toProtobufKey()) + .setMaxSupply(testMaxSupply) + .setAdminKey(testAdminKey.toProtobufKey()) + .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) + .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setSeconds(testAutoRenewPeriod.toSeconds()) + .build()) + .setExpiry(Timestamp.newBuilder() + .setSeconds(testExpirationTime.getEpochSecond()) + .build()) + .setTokenType(com.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE) + .setSupplyType(com.hiero.sdk.proto.TokenSupplyType.FINITE) + .setFreezeKey(testFreezeKey.toProtobufKey()) + .setWipeKey(testWipeKey.toProtobufKey()) + .setSymbol(testTokenSymbol) + .setKycKey(testKycKey.toProtobufKey()) + .setPauseKey(testPauseKey.toProtobufKey()) + .setMetadataKey(testMetadataKey.toProtobufKey()) + .setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond())) + .setTreasury(testTreasuryAccountId.toProtobuf()) + .setName(testTokenName) + .setMemo(testTokenMemo) + .build(); var tx = TransactionBody.newBuilder().setTokenCreation(transactionBody).build(); var tokenCreateTransaction = new TokenCreateTransaction(tx); @@ -249,8 +276,8 @@ void constructTokenCreateTransactionNftFromTransactionBodyProtobuf() { assertThat(tokenCreateTransaction.getKycKey()).isEqualTo(testKycKey); assertThat(tokenCreateTransaction.getPauseKey()).isEqualTo(testPauseKey); assertThat(tokenCreateTransaction.getMetadataKey()).isEqualTo(testMetadataKey); - assertThat(tokenCreateTransaction.getExpirationTime().getEpochSecond()).isEqualTo( - testExpirationTime.getEpochSecond()); + assertThat(tokenCreateTransaction.getExpirationTime().getEpochSecond()) + .isEqualTo(testExpirationTime.getEpochSecond()); assertThat(tokenCreateTransaction.getTreasuryAccountId()).isEqualTo(testTreasuryAccountId); assertThat(tokenCreateTransaction.getTokenName()).isEqualTo(testTokenName); assertThat(tokenCreateTransaction.getTokenMemo()).isEqualTo(testTokenMemo); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java index 2a04834b2e..624eb6ac73 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java @@ -1,48 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenDeleteTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class TokenDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -69,10 +43,13 @@ void shouldBytesNoSetters() throws Exception { } private TokenDeleteTransaction spawnTestTransaction() { - return new TokenDeleteTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(TokenId.fromString("1.2.3")).setMaxTransactionFee(new Hbar(1)).freeze().sign(unusedPrivateKey); + return new TokenDeleteTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(TokenId.fromString("1.2.3")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -85,7 +62,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenDeletion(TokenDeleteTransactionBody.newBuilder().build()).build(); + .setTokenDeletion(TokenDeleteTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -103,8 +81,11 @@ void constructTokenDeleteTransaction() { void ConstructTokenDeleteTransactionFromTransactionBodyProtobuf() { var tokenId = TokenId.fromString("1.2.3"); - var transactionBody = TokenDeleteTransactionBody.newBuilder().setToken(tokenId.toProtobuf()).build(); - var txBody = TransactionBody.newBuilder().setTokenDeletion(transactionBody).build(); + var transactionBody = TokenDeleteTransactionBody.newBuilder() + .setToken(tokenId.toProtobuf()) + .build(); + var txBody = + TransactionBody.newBuilder().setTokenDeletion(transactionBody).build(); var tokenDeleteTransaction = new TokenDeleteTransaction(txBody); assertThat(tokenDeleteTransaction.getTokenId()).isEqualTo(tokenId); @@ -127,5 +108,4 @@ void getSetTokenIdFrozen() { assertThrows(IllegalStateException.class, () -> tx.setTokenId(tokenId)); } - } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java index 5844d31fa0..308e9ec09d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java @@ -1,53 +1,27 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenDissociateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenDissociateTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.Arrays; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TokenDissociateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final AccountId testAccountId = AccountId.fromString("6.9.0"); - private static final List testTokenIds = Arrays.asList(TokenId.fromString("4.2.0"), - TokenId.fromString("4.2.1"), TokenId.fromString("4.2.2")); + private static final List testTokenIds = + Arrays.asList(TokenId.fromString("4.2.0"), TokenId.fromString("4.2.1"), TokenId.fromString("4.2.2")); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -74,11 +48,14 @@ void shouldBytesNoSetters() throws Exception { } private TokenDissociateTransaction spawnTestTransaction() { - return new TokenDissociateTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(testAccountId).setTokenIds(testTokenIds).setMaxTransactionFee(new Hbar(1)).freeze() - .sign(unusedPrivateKey); + return new TokenDissociateTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(testAccountId) + .setTokenIds(testTokenIds) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -91,7 +68,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenDissociate(TokenDissociateTransactionBody.newBuilder().build()).build(); + .setTokenDissociate(TokenDissociateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -100,10 +78,13 @@ void fromScheduledTransaction() { @Test void constructTokenDissociateTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenDissociateTransactionBody.newBuilder().setAccount(testAccountId.toProtobuf()) - .addAllTokens(testTokenIds.stream().map(TokenId::toProtobuf).toList()).build(); + var transactionBody = TokenDissociateTransactionBody.newBuilder() + .setAccount(testAccountId.toProtobuf()) + .addAllTokens(testTokenIds.stream().map(TokenId::toProtobuf).toList()) + .build(); - var tx = TransactionBody.newBuilder().setTokenDissociate(transactionBody).build(); + var tx = + TransactionBody.newBuilder().setTokenDissociate(transactionBody).build(); var tokenDissociateTransaction = new TokenDissociateTransaction(tx); assertThat(tokenDissociateTransaction.getAccountId()).isEqualTo(testAccountId); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java index 01e8709655..b62c484d05 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java @@ -1,46 +1,18 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.FeeAssessmentMethod; -import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TokenFeeScheduleUpdateTransactionTest { final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -58,25 +30,23 @@ public static void afterAll() { private TokenFeeScheduleUpdateTransaction spawnTestTransaction() { var customFees = new ArrayList(); customFees.add(new CustomFixedFee() - .setFeeCollectorAccountId(new AccountId(4322)) - .setDenominatingTokenId(new TokenId(483902)) - .setAmount(10) - ); + .setFeeCollectorAccountId(new AccountId(4322)) + .setDenominatingTokenId(new TokenId(483902)) + .setAmount(10)); customFees.add(new CustomFractionalFee() - .setFeeCollectorAccountId(new AccountId(389042)) - .setNumerator(3) - .setDenominator(7) - .setMin(3) - .setMax(100) - .setAssessmentMethod(FeeAssessmentMethod.EXCLUSIVE) - ); + .setFeeCollectorAccountId(new AccountId(389042)) + .setNumerator(3) + .setDenominator(7) + .setMin(3) + .setMax(100) + .setAssessmentMethod(FeeAssessmentMethod.EXCLUSIVE)); return new TokenFeeScheduleUpdateTransaction() - .setTokenId(new TokenId(8798)) - .setCustomFees(customFees) - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .freeze(); + .setTokenId(new TokenId(8798)) + .setCustomFees(customFees) + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .freeze(); } @Test @@ -98,8 +68,9 @@ void shouldSerialize() throws InvalidProtocolBufferException { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenFeeScheduleUpdate(TokenFeeScheduleUpdateTransactionBody.newBuilder().build()) - .build(); + .setTokenFeeScheduleUpdate( + TokenFeeScheduleUpdateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java index 4298c7a853..290abe4de5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenFreezeTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenFreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class TokenFreezeTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,20 +30,18 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private TokenFreezeTransaction spawnTestTransaction() { return new TokenFreezeTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.222")) - .setTokenId(TokenId.fromString("6.5.4")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.222")) + .setTokenId(TokenId.fromString("6.5.4")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -89,8 +61,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenFreeze(TokenFreezeAccountTransactionBody.newBuilder().build()) - .build(); + .setTokenFreeze(TokenFreezeAccountTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java index e9148b5963..ba109119be 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java @@ -1,48 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenGrantKycTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenGrantKycTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class TokenGrantKycTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final AccountId testAccountId = AccountId.fromString("6.9.0"); @@ -64,11 +38,14 @@ void shouldSerialize() { } private TokenGrantKycTransaction spawnTestTransaction() { - return new TokenGrantKycTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(testAccountId).setTokenId(testTokenId).setMaxTransactionFee(new Hbar(1)).freeze() - .sign(unusedPrivateKey); + return new TokenGrantKycTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(testAccountId) + .setTokenId(testTokenId) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -88,7 +65,8 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenGrantKyc(TokenGrantKycTransactionBody.newBuilder().build()).build(); + .setTokenGrantKyc(TokenGrantKycTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -97,8 +75,10 @@ void fromScheduledTransaction() { @Test void constructTokenGrantKycTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenGrantKycTransactionBody.newBuilder().setAccount(testAccountId.toProtobuf()) - .setToken(testTokenId.toProtobuf()).build(); + var transactionBody = TokenGrantKycTransactionBody.newBuilder() + .setAccount(testAccountId.toProtobuf()) + .setToken(testTokenId.toProtobuf()) + .build(); var tx = TransactionBody.newBuilder().setTokenGrantKyc(transactionBody).build(); var tokenGrantKycTransaction = new TokenGrantKycTransaction(tx); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java index 269b886d59..64158f37c2 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java @@ -1,35 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenInfoQuery; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class TokenInfoQueryTest { private static final TokenId testTokenId = TokenId.fromString("4.2.0"); @@ -46,9 +25,12 @@ public static void afterAll() { @Test void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); - new TokenInfoQuery().setTokenId(testTokenId).setMaxQueryPayment(Hbar.fromTinybars(100_000)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + new TokenInfoQuery() + .setTokenId(testTokenId) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java b/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java index 6ea17b1557..e3646eb591 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java @@ -1,82 +1,52 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenInfo; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Duration; import java.time.Instant; import java.util.Arrays; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; // TODO: update this, test deepClone() public class TokenInfoTest { /* - if we will init PrivateKey using method `PrivateKey.fromSeedECDSAsecp256k1(byte[] seed)` (like in C++ SDK, for example) - => we will get public key each time we run tests on different machines - => io.github.jsonSnapshot.SnapshotMatcher will fail tests - => we need to init PrivateKey fromString to get the same key each time - => `toProtobuf()` tests uses getEd25519() method to assert equality - */ + if we will init PrivateKey using method `PrivateKey.fromSeedECDSAsecp256k1(byte[] seed)` (like in C++ SDK, for example) + => we will get public key each time we run tests on different machines + => io.github.jsonSnapshot.SnapshotMatcher will fail tests + => we need to init PrivateKey fromString to get the same key each time + => `toProtobuf()` tests uses getEd25519() method to assert equality + */ private static final PublicKey testAdminKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") + .getPublicKey(); private static final PublicKey testKycKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") + .getPublicKey(); private static final PublicKey testFreezeKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e13") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e13") + .getPublicKey(); private static final PublicKey testWipeKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e14") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e14") + .getPublicKey(); private static final PublicKey testSupplyKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e15") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e15") + .getPublicKey(); private static final PublicKey testFeeScheduleKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e16") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e16") + .getPublicKey(); private static final PublicKey testPauseKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e17") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e17") + .getPublicKey(); private static final PublicKey testMetadataKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e18") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e18") + .getPublicKey(); private static final TokenId testTokenId = TokenId.fromString("0.6.9"); private static final AccountId testTreasuryAccountId = AccountId.fromString("7.7.7"); private static final AccountId testAutoRenewAccountId = AccountId.fromString("8.9.0"); @@ -89,10 +59,16 @@ public class TokenInfoTest { private static final Boolean testTokenKycStatus = true; private static final boolean testTokenIsDeleted = false; private static final List testTokenCustomFees = Arrays.asList( - new CustomFixedFee().setFeeCollectorAccountId(new AccountId(4322)).setDenominatingTokenId(new TokenId(483902)) - .setAmount(10), - new CustomFractionalFee().setFeeCollectorAccountId(new AccountId(389042)).setNumerator(3).setDenominator(7) - .setMin(3).setMax(100)); + new CustomFixedFee() + .setFeeCollectorAccountId(new AccountId(4322)) + .setDenominatingTokenId(new TokenId(483902)) + .setAmount(10), + new CustomFractionalFee() + .setFeeCollectorAccountId(new AccountId(389042)) + .setNumerator(3) + .setDenominator(7) + .setMin(3) + .setMax(100)); private static final TokenType testTokenType = TokenType.FUNGIBLE_COMMON; private static final TokenSupplyType testTokenSupplyType = TokenSupplyType.FINITE; private static final long testTokenMaxSupply = 1000000L; @@ -100,7 +76,7 @@ public class TokenInfoTest { private static final LedgerId testTokenLedgerId = LedgerId.MAINNET; private static final Duration testAutoRenewPeriod = Duration.ofHours(10); private static final Instant testExpirationTime = Instant.ofEpochSecond(1554158542); - private static final byte[] testMetadata = new byte[]{1, 2, 3, 4, 5}; + private static final byte[] testMetadata = new byte[] {1, 2, 3, 4, 5}; @BeforeAll public static void beforeAll() { @@ -113,12 +89,35 @@ public static void afterAll() { } private static TokenInfo spawnTokenInfoExample() { - return new TokenInfo(testTokenId, testTokenName, testTokenSymbol, testTokenDecimals, testTokenTotalSupply, - testTreasuryAccountId, testAdminKey, testKycKey, testFreezeKey, testWipeKey, testSupplyKey, - testFeeScheduleKey, testTokenFreezeStatus, testTokenKycStatus, testTokenIsDeleted, testAutoRenewAccountId, - testAutoRenewPeriod, testExpirationTime, testTokenMemo, testTokenCustomFees, testTokenType, - testTokenSupplyType, testTokenMaxSupply, testPauseKey, testTokenPauseStatus, testMetadata, testMetadataKey, - testTokenLedgerId); + return new TokenInfo( + testTokenId, + testTokenName, + testTokenSymbol, + testTokenDecimals, + testTokenTotalSupply, + testTreasuryAccountId, + testAdminKey, + testKycKey, + testFreezeKey, + testWipeKey, + testSupplyKey, + testFeeScheduleKey, + testTokenFreezeStatus, + testTokenKycStatus, + testTokenIsDeleted, + testAutoRenewAccountId, + testAutoRenewPeriod, + testExpirationTime, + testTokenMemo, + testTokenCustomFees, + testTokenType, + testTokenSupplyType, + testTokenMaxSupply, + testPauseKey, + testTokenPauseStatus, + testMetadata, + testMetadataKey, + testTokenLedgerId); } @Test @@ -216,48 +215,51 @@ void toProtobuf() { assertThat(tokenInfoProto.getTokenInfo().getTreasury().getShardNum()).isEqualTo(testTreasuryAccountId.shard); assertThat(tokenInfoProto.getTokenInfo().getTreasury().getRealmNum()).isEqualTo(testTreasuryAccountId.realm); assertThat(tokenInfoProto.getTokenInfo().getTreasury().getAccountNum()).isEqualTo(testTreasuryAccountId.num); - assertThat(tokenInfoProto.getTokenInfo().getAdminKey().getEd25519().toByteArray()).isEqualTo( - testAdminKey.toBytesRaw()); - assertThat(tokenInfoProto.getTokenInfo().getKycKey().getEd25519().toByteArray()).isEqualTo( - testKycKey.toBytesRaw()); - assertThat(tokenInfoProto.getTokenInfo().getFreezeKey().getEd25519().toByteArray()).isEqualTo( - testFreezeKey.toBytesRaw()); - assertThat(tokenInfoProto.getTokenInfo().getWipeKey().getEd25519().toByteArray()).isEqualTo( - testWipeKey.toBytesRaw()); - assertThat(tokenInfoProto.getTokenInfo().getSupplyKey().getEd25519().toByteArray()).isEqualTo( - testSupplyKey.toBytesRaw()); - assertThat(tokenInfoProto.getTokenInfo().getDefaultFreezeStatus()).isEqualTo( - TokenInfo.freezeStatusToProtobuf(testTokenFreezeStatus)); - assertThat(tokenInfoProto.getTokenInfo().getDefaultKycStatus()).isEqualTo( - TokenInfo.kycStatusToProtobuf(testTokenKycStatus)); + assertThat(tokenInfoProto.getTokenInfo().getAdminKey().getEd25519().toByteArray()) + .isEqualTo(testAdminKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getKycKey().getEd25519().toByteArray()) + .isEqualTo(testKycKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getFreezeKey().getEd25519().toByteArray()) + .isEqualTo(testFreezeKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getWipeKey().getEd25519().toByteArray()) + .isEqualTo(testWipeKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getSupplyKey().getEd25519().toByteArray()) + .isEqualTo(testSupplyKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getDefaultFreezeStatus()) + .isEqualTo(TokenInfo.freezeStatusToProtobuf(testTokenFreezeStatus)); + assertThat(tokenInfoProto.getTokenInfo().getDefaultKycStatus()) + .isEqualTo(TokenInfo.kycStatusToProtobuf(testTokenKycStatus)); assertThat(tokenInfoProto.getTokenInfo().getDeleted()).isEqualTo(testTokenIsDeleted); - assertThat(tokenInfoProto.getTokenInfo().getAutoRenewAccount().getShardNum()).isEqualTo( - testAutoRenewAccountId.shard); - assertThat(tokenInfoProto.getTokenInfo().getAutoRenewAccount().getRealmNum()).isEqualTo( - testAutoRenewAccountId.realm); - assertThat(tokenInfoProto.getTokenInfo().getAutoRenewAccount().getAccountNum()).isEqualTo( - testAutoRenewAccountId.num); - assertThat(tokenInfoProto.getTokenInfo().getAutoRenewPeriod().getSeconds()).isEqualTo( - testAutoRenewPeriod.toSeconds()); - assertThat(tokenInfoProto.getTokenInfo().getExpiry().getSeconds()).isEqualTo( - testExpirationTime.getEpochSecond()); + assertThat(tokenInfoProto.getTokenInfo().getAutoRenewAccount().getShardNum()) + .isEqualTo(testAutoRenewAccountId.shard); + assertThat(tokenInfoProto.getTokenInfo().getAutoRenewAccount().getRealmNum()) + .isEqualTo(testAutoRenewAccountId.realm); + assertThat(tokenInfoProto.getTokenInfo().getAutoRenewAccount().getAccountNum()) + .isEqualTo(testAutoRenewAccountId.num); + assertThat(tokenInfoProto.getTokenInfo().getAutoRenewPeriod().getSeconds()) + .isEqualTo(testAutoRenewPeriod.toSeconds()); + assertThat(tokenInfoProto.getTokenInfo().getExpiry().getSeconds()) + .isEqualTo(testExpirationTime.getEpochSecond()); assertThat(tokenInfoProto.getTokenInfo().getMemo()).isEqualTo(testTokenMemo); - assertThat(tokenInfoProto.getTokenInfo().getTokenType()).isEqualTo( - com.hiero.sdk.proto.TokenType.valueOf(testTokenType.name())); - assertThat(tokenInfoProto.getTokenInfo().getSupplyType()).isEqualTo( - com.hiero.sdk.proto.TokenSupplyType.valueOf(testTokenSupplyType.name())); + assertThat(tokenInfoProto.getTokenInfo().getTokenType()) + .isEqualTo(com.hiero.sdk.proto.TokenType.valueOf(testTokenType.name())); + assertThat(tokenInfoProto.getTokenInfo().getSupplyType()) + .isEqualTo(com.hiero.sdk.proto.TokenSupplyType.valueOf(testTokenSupplyType.name())); assertThat(tokenInfoProto.getTokenInfo().getMaxSupply()).isEqualTo(testTokenMaxSupply); - assertThat(tokenInfoProto.getTokenInfo().getFeeScheduleKey().getEd25519().toByteArray()).isEqualTo( - testFeeScheduleKey.toBytesRaw()); + assertThat(tokenInfoProto + .getTokenInfo() + .getFeeScheduleKey() + .getEd25519() + .toByteArray()) + .isEqualTo(testFeeScheduleKey.toBytesRaw()); assertThat(tokenInfoProto.getTokenInfo().getCustomFeesList()).hasSize(testTokenCustomFees.size()); - assertThat(tokenInfoProto.getTokenInfo().getPauseKey().getEd25519().toByteArray()).isEqualTo( - testPauseKey.toBytesRaw()); - assertThat(tokenInfoProto.getTokenInfo().getPauseStatus()).isEqualTo( - TokenInfo.pauseStatusToProtobuf(testTokenPauseStatus)); - assertThat(tokenInfoProto.getTokenInfo().getMetadata().toByteArray()).isEqualTo( - testMetadata); - assertThat(tokenInfoProto.getTokenInfo().getMetadataKey().getEd25519().toByteArray()).isEqualTo( - testMetadataKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getPauseKey().getEd25519().toByteArray()) + .isEqualTo(testPauseKey.toBytesRaw()); + assertThat(tokenInfoProto.getTokenInfo().getPauseStatus()) + .isEqualTo(TokenInfo.pauseStatusToProtobuf(testTokenPauseStatus)); + assertThat(tokenInfoProto.getTokenInfo().getMetadata().toByteArray()).isEqualTo(testMetadata); + assertThat(tokenInfoProto.getTokenInfo().getMetadataKey().getEd25519().toByteArray()) + .isEqualTo(testMetadataKey.toBytesRaw()); assertThat(tokenInfoProto.getTokenInfo().getLedgerId()).isEqualTo(testTokenLedgerId.toByteString()); } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java index b0ffc29a4a..8d6bd09243 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java @@ -1,37 +1,29 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenUpdateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenMintTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.Arrays; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TokenMintTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final Long testAmount = 10L; - private static final List testMetadataList = List.of(new byte[]{1, 2, 3, 4, 5}); - private static final ByteString testMetadataByteString = ByteString.copyFrom(new byte[]{1, 2, 3, 4, 5}); + private static final List testMetadataList = List.of(new byte[] {1, 2, 3, 4, 5}); + private static final ByteString testMetadataByteString = ByteString.copyFrom(new byte[] {1, 2, 3, 4, 5}); final Instant validStart = Instant.ofEpochSecond(1554158542); @BeforeAll @@ -46,16 +38,12 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test void shouldSerializeMetadata() { - SnapshotMatcher.expect(spawnMetadataTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnMetadataTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -67,24 +55,24 @@ void shouldBytesNoSetters() throws Exception { private TokenMintTransaction spawnTestTransaction() { return new TokenMintTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId) - .setAmount(testAmount) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setAmount(testAmount) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } private TokenMintTransaction spawnMetadataTestTransaction() { return new TokenMintTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(TokenId.fromString("1.2.3")) - .setMetadata(testMetadataList) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(TokenId.fromString("1.2.3")) + .setMetadata(testMetadataList) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -104,8 +92,8 @@ void shouldBytesMetadata() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenMint(TokenMintTransactionBody.newBuilder().build()) - .build(); + .setTokenMint(TokenMintTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -115,18 +103,18 @@ void fromScheduledTransaction() { @Test void constructTokenMintTransactionFromTransactionBodyProtobuf() { var transactionBody = TokenMintTransactionBody.newBuilder() - .setToken(testTokenId.toProtobuf()) - .setAmount(testAmount) - .addMetadata(testMetadataByteString) - .build(); + .setToken(testTokenId.toProtobuf()) + .setAmount(testAmount) + .addMetadata(testMetadataByteString) + .build(); var tx = TransactionBody.newBuilder().setTokenMint(transactionBody).build(); var tokenMintTransaction = new TokenMintTransaction(tx); assertThat(tokenMintTransaction.getTokenId()).isEqualTo(testTokenId); assertThat(tokenMintTransaction.getAmount()).isEqualTo(testAmount); - assertThat(Iterables.getLast(tokenMintTransaction.getMetadata())).isEqualTo( - testMetadataByteString.toByteArray()); + assertThat(Iterables.getLast(tokenMintTransaction.getMetadata())) + .isEqualTo(testMetadataByteString.toByteArray()); } @Test @@ -168,7 +156,7 @@ void getSetMetadataFrozen() { @Test void addMetadata() { var tokenMintTransaction = new TokenMintTransaction().addMetadata(Iterables.getLast(testMetadataList)); - assertThat(Iterables.getLast(tokenMintTransaction.getMetadata())).isEqualTo( - Iterables.getLast(testMetadataList)); + assertThat(Iterables.getLast(tokenMintTransaction.getMetadata())) + .isEqualTo(Iterables.getLast(testMetadataList)); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java index 4890920251..e5605e6cdc 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java @@ -1,17 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenNftInfoQuery; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class TokenNftInfoQueryTest { @BeforeAll public static void beforeAll() { @@ -27,22 +24,23 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new TokenNftInfoQuery() - .setNftId(TokenId.fromString("0.0.5005").nft(101)) - .setMaxQueryPayment(Hbar.fromTinybars(100_000)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setNftId(TokenId.fromString("0.0.5005").nft(101)) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } @Test void propertiesTest() { var tokenId = TokenId.fromString("0.0.5005"); var query = new TokenNftInfoQuery() - .byAccountId(AccountId.fromString("0.0.123")) - .byTokenId(tokenId) - .setStart(5) - .setEnd(8) - .setNftId(tokenId.nft(101)) - .setMaxQueryPayment(Hbar.fromTinybars(100_000)); + .byAccountId(AccountId.fromString("0.0.123")) + .byTokenId(tokenId) + .setStart(5) + .setEnd(8) + .setNftId(tokenId.nft(101)) + .setMaxQueryPayment(Hbar.fromTinybars(100_000)); assertThat(query.getNftId()).hasToString("0.0.5005/101"); assertThat(query.getTokenId()).isEqualTo(tokenId); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java index f190ebf480..9375a53cca 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java @@ -1,22 +1,18 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenNftInfo; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import javax.annotation.Nullable; -import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; - public class TokenNftInfoTest { - final static Instant creationTime = Instant.ofEpochSecond(1554158542); + static final Instant creationTime = Instant.ofEpochSecond(1554158542); @BeforeAll public static void beforeAll() { @@ -30,13 +26,12 @@ public static void afterAll() { private static TokenNftInfo spawnTokenNftInfoExample(@Nullable AccountId spenderAccountId) { return new TokenNftInfo( - TokenId.fromString("1.2.3").nft(4), - AccountId.fromString("5.6.7"), - creationTime, - Hex.decode("deadbeef"), - LedgerId.MAINNET, - spenderAccountId - ); + TokenId.fromString("1.2.3").nft(4), + AccountId.fromString("5.6.7"), + creationTime, + Hex.decode("deadbeef"), + LedgerId.MAINNET, + spenderAccountId); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java index 8c510c47ee..e9909a7291 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java @@ -1,48 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenPauseTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenPauseTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class TokenPauseTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -57,10 +31,13 @@ public static void afterAll() { } TokenPauseTransaction spawnTestTransaction() { - return new TokenPauseTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId).setMaxTransactionFee(new Hbar(1)).freeze().sign(unusedPrivateKey); + return new TokenPauseTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -85,7 +62,8 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenPause(TokenPauseTransactionBody.newBuilder().build()).build(); + .setTokenPause(TokenPauseTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -94,7 +72,9 @@ void fromScheduledTransaction() { @Test void constructTokenPauseTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenPauseTransactionBody.newBuilder().setToken(testTokenId.toProtobuf()).build(); + var transactionBody = TokenPauseTransactionBody.newBuilder() + .setToken(testTokenId.toProtobuf()) + .build(); var tx = TransactionBody.newBuilder().setTokenPause(transactionBody).build(); var tokenPauseTransaction = new TokenPauseTransaction(tx); @@ -113,5 +93,4 @@ void getSetTokenIdFrozen() { var tx = spawnTestTransaction(); assertThrows(IllegalStateException.class, () -> tx.setTokenId(testTokenId)); } - } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java index e57cc973d8..2904fc4be6 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java @@ -1,36 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenRejectTransaction; -import com.hiero.sdk.TokenUpdateNftsTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenReference; import com.hiero.sdk.proto.TokenRejectTransactionBody; @@ -46,18 +19,15 @@ public class TokenRejectTransactionTest { private static final PrivateKey TEST_PRIVATE_KEY = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final AccountId TEST_OWNER_ID = AccountId.fromString("0.6.9"); - private static final List TEST_TOKEN_IDS = List.of( - TokenId.fromString("1.2.3"), - TokenId.fromString("4.5.6"), - TokenId.fromString("7.8.9")); + private static final List TEST_TOKEN_IDS = + List.of(TokenId.fromString("1.2.3"), TokenId.fromString("4.5.6"), TokenId.fromString("7.8.9")); - private static final List TEST_NFT_IDS = List.of( - new NftId(TokenId.fromString("4.5.6"), 2), - new NftId(TokenId.fromString("7.8.9"), 3)); + private static final List TEST_NFT_IDS = + List.of(new NftId(TokenId.fromString("4.5.6"), 2), new NftId(TokenId.fromString("7.8.9"), 3)); final Instant TEST_VALID_START = Instant.ofEpochSecond(1554158542); @@ -77,11 +47,15 @@ void shouldSerialize() { } private TokenRejectTransaction spawnTestTransaction() { - return new TokenRejectTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) - .setOwnerId(TEST_OWNER_ID).setTokenIds(TEST_TOKEN_IDS).setNftIds(TEST_NFT_IDS) - .setMaxTransactionFee(new Hbar(1)).freeze().sign(TEST_PRIVATE_KEY); + return new TokenRejectTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START)) + .setOwnerId(TEST_OWNER_ID) + .setTokenIds(TEST_TOKEN_IDS) + .setNftIds(TEST_NFT_IDS) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(TEST_PRIVATE_KEY); } @Test @@ -101,7 +75,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenReject(TokenRejectTransactionBody.newBuilder().build()).build(); + .setTokenReject(TokenRejectTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -115,14 +90,19 @@ void constructTokenRejectTransactionFromTransactionBodyProtobuf() { transactionBodyBuilder.setOwner(TEST_OWNER_ID.toProtobuf()); for (TokenId tokenId : TEST_TOKEN_IDS) { - transactionBodyBuilder.addRejections(TokenReference.newBuilder().setFungibleToken(tokenId.toProtobuf()).build()); + transactionBodyBuilder.addRejections(TokenReference.newBuilder() + .setFungibleToken(tokenId.toProtobuf()) + .build()); } for (NftId nftId : TEST_NFT_IDS) { - transactionBodyBuilder.addRejections(TokenReference.newBuilder().setNft(nftId.toProtobuf()).build()); + transactionBodyBuilder.addRejections( + TokenReference.newBuilder().setNft(nftId.toProtobuf()).build()); } - var tx = TransactionBody.newBuilder().setTokenReject(transactionBodyBuilder.build()).build(); + var tx = TransactionBody.newBuilder() + .setTokenReject(transactionBodyBuilder.build()) + .build(); var tokenRejectTransaction = new TokenRejectTransaction(tx); assertThat(tokenRejectTransaction.getOwnerId()).isEqualTo(TEST_OWNER_ID); @@ -130,7 +110,6 @@ void constructTokenRejectTransactionFromTransactionBodyProtobuf() { assertThat(tokenRejectTransaction.getNftIds()).hasSize(TEST_NFT_IDS.size()); } - @Test void getSetOwnerId() { var transaction = new TokenRejectTransaction().setOwnerId(TEST_OWNER_ID); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java b/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java index 9a11b4c239..4982547dca 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java @@ -1,14 +1,13 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenRelationship; +import static org.assertj.core.api.Assertions.assertThat; + import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class TokenRelationshipTest { @BeforeAll public static void beforeAll() { @@ -21,15 +20,7 @@ public static void afterAll() { } TokenRelationship spawnTokenRelationshipExample() { - return new TokenRelationship( - TokenId.fromString("1.2.3"), - "ABC", - 55, - true, - true, - 4, - true - ); + return new TokenRelationship(TokenId.fromString("1.2.3"), "ABC", 55, true, true, 4, true); } @Test @@ -38,7 +29,8 @@ void shouldSerializeTokenRelationship() throws Exception { byte[] tokenRelationshipBytes = originalTokenRelationship.toBytes(); var copyTokenRelationship = TokenRelationship.fromBytes(tokenRelationshipBytes); assertThat(copyTokenRelationship.toString().replaceAll("@[A-Za-z0-9]+", "")) - .isEqualTo(originalTokenRelationship.toString().replaceAll("@[A-Za-z0-9]+", "")); - SnapshotMatcher.expect(originalTokenRelationship.toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .isEqualTo(originalTokenRelationship.toString().replaceAll("@[A-Za-z0-9]+", "")); + SnapshotMatcher.expect(originalTokenRelationship.toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java index e9eda529af..0d5f0f3dc3 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java @@ -1,48 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenRevokeKycTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenRevokeKycTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class TokenRevokeKycTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final AccountId testAccountId = AccountId.fromString("6.9.0"); @@ -64,11 +38,14 @@ void shouldSerialize() { } private TokenRevokeKycTransaction spawnTestTransaction() { - return new TokenRevokeKycTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(testAccountId).setTokenId(testTokenId).setMaxTransactionFee(new Hbar(1)).freeze() - .sign(unusedPrivateKey); + return new TokenRevokeKycTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(testAccountId) + .setTokenId(testTokenId) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -88,7 +65,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenRevokeKyc(TokenRevokeKycTransactionBody.newBuilder().build()).build(); + .setTokenRevokeKyc(TokenRevokeKycTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -97,8 +75,10 @@ void fromScheduledTransaction() { @Test void constructTokenRevokeKycTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenRevokeKycTransactionBody.newBuilder().setAccount(testAccountId.toProtobuf()) - .setToken(testTokenId.toProtobuf()).build(); + var transactionBody = TokenRevokeKycTransactionBody.newBuilder() + .setAccount(testAccountId.toProtobuf()) + .setToken(testTokenId.toProtobuf()) + .build(); var tx = TransactionBody.newBuilder().setTokenRevokeKyc(transactionBody).build(); var tokenRevokeKycTransaction = new TokenRevokeKycTransaction(tx); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java index bcf1964aa8..d60191f4f5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java @@ -1,13 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.TokenSupplyType; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class TokenSupplyTypeTest { private final TokenSupplyType tokenSupplyTypeInfinite = TokenSupplyType.INFINITE; private final TokenSupplyType tokenSupplyTypeFinite = TokenSupplyType.FINITE; @@ -25,17 +26,21 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite).toString(), - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite).toString()) - .toMatchSnapshot(); + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite) + .toString(), + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite) + .toString()) + .toMatchSnapshot(); } @Test void toProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite).toProtobuf(), - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite).toProtobuf()) - .toMatchSnapshot(); + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite) + .toProtobuf(), + com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite) + .toProtobuf()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java b/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java index 19faa8eb70..ccff0b4581 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.hiero.sdk.proto.TokenType; @@ -43,16 +25,16 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toString(), - com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toString()) - .toMatchSnapshot(); + com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toString(), + com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toString()) + .toMatchSnapshot(); } @Test void toProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toProtobuf(), - com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toProtobuf()) - .toMatchSnapshot(); + com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toProtobuf(), + com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toProtobuf()) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java index d8a4c87504..53fa492565 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenUnfreezeTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class TokenUnfreezeTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,9 +30,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -70,13 +42,13 @@ void shouldBytesNoSetters() throws Exception { private TokenUnfreezeTransaction spawnTestTransaction() { return new TokenUnfreezeTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setAccountId(AccountId.fromString("0.0.222")) - .setTokenId(TokenId.fromString("6.5.4")) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setAccountId(AccountId.fromString("0.0.222")) + .setTokenId(TokenId.fromString("6.5.4")) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -89,8 +61,9 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenUnfreeze(TokenUnfreezeAccountTransactionBody.newBuilder().build()) - .build(); + .setTokenUnfreeze( + TokenUnfreezeAccountTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java index a9121dab07..947a79988d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java @@ -1,49 +1,22 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenUnpauseTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenUnpauseTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class TokenUnpauseTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -59,10 +32,13 @@ public static void afterAll() { } TokenUnpauseTransaction spawnTestTransaction() { - return new TokenUnpauseTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId).setMaxTransactionFee(new Hbar(1)).freeze().sign(unusedPrivateKey); + return new TokenUnpauseTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -87,7 +63,8 @@ void shouldBytesNft() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenUnpause(TokenUnpauseTransactionBody.newBuilder().build()).build(); + .setTokenUnpause(TokenUnpauseTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -96,7 +73,9 @@ void fromScheduledTransaction() { @Test void constructTokenUnpauseTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenUnpauseTransactionBody.newBuilder().setToken(testTokenId.toProtobuf()).build(); + var transactionBody = TokenUnpauseTransactionBody.newBuilder() + .setToken(testTokenId.toProtobuf()) + .build(); var tx = TransactionBody.newBuilder().setTokenUnpause(transactionBody).build(); var tokenUnpauseTransaction = new TokenUnpauseTransaction(tx); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java index 65b8e0985e..4aa13d9768 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -24,13 +6,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenUpdateNftsTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenUpdateNftsTransactionBody; import com.hiero.sdk.proto.TransactionBody; @@ -44,10 +19,10 @@ public class TokenUpdateNftsTransactionTest { private static final PrivateKey testMetadataKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final List testSerialNumbers = Arrays.asList(8L, 9L, 10L); - private static final byte[] testMetadata = new byte[]{1, 2, 3, 4, 5}; + private static final byte[] testMetadata = new byte[] {1, 2, 3, 4, 5}; final Instant validStart = Instant.ofEpochSecond(1554158542); @BeforeAll @@ -66,11 +41,15 @@ void shouldSerialize() { } private TokenUpdateNftsTransaction spawnTestTransaction() { - return new TokenUpdateNftsTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId).setMetadata(testMetadata).setSerials(testSerialNumbers) - .setMaxTransactionFee(new Hbar(1)).freeze().sign(testMetadataKey); + return new TokenUpdateNftsTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setMetadata(testMetadata) + .setSerials(testSerialNumbers) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(testMetadataKey); } @Test @@ -90,7 +69,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenUpdateNfts(TokenUpdateNftsTransactionBody.newBuilder().build()).build(); + .setTokenUpdateNfts(TokenUpdateNftsTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -99,11 +79,14 @@ void fromScheduledTransaction() { @Test void constructTokenUpdateTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenUpdateNftsTransactionBody.newBuilder().setToken(testTokenId.toProtobuf()) - .setMetadata(BytesValue.of(ByteString.copyFrom(testMetadata))).addAllSerialNumbers(testSerialNumbers) - .build(); - - var tx = TransactionBody.newBuilder().setTokenUpdateNfts(transactionBody).build(); + var transactionBody = TokenUpdateNftsTransactionBody.newBuilder() + .setToken(testTokenId.toProtobuf()) + .setMetadata(BytesValue.of(ByteString.copyFrom(testMetadata))) + .addAllSerialNumbers(testSerialNumbers) + .build(); + + var tx = + TransactionBody.newBuilder().setTokenUpdateNfts(transactionBody).build(); var tokenUpdateNftsTransaction = new TokenUpdateNftsTransaction(tx); assertThat(tokenUpdateNftsTransaction.getTokenId()).isEqualTo(testTokenId); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java index abe79949f3..6dc653b2c5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -25,15 +7,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenKeyValidation; -import com.hiero.sdk.TokenUpdateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.Timestamp; import com.hiero.sdk.proto.TokenUpdateTransactionBody; @@ -46,34 +19,33 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; - public class TokenUpdateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final PublicKey testAdminKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") + .getPublicKey(); private static final PublicKey testKycKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") + .getPublicKey(); private static final PublicKey testFreezeKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e13") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e13") + .getPublicKey(); private static final PublicKey testWipeKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e14") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e14") + .getPublicKey(); private static final PublicKey testSupplyKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e15") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e15") + .getPublicKey(); private static final PublicKey testFeeScheduleKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e16") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e16") + .getPublicKey(); private static final PublicKey testPauseKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e17") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e17") + .getPublicKey(); private static final PublicKey testMetadataKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e18") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e18") + .getPublicKey(); private static final AccountId testTreasuryAccountId = AccountId.fromString("7.7.7"); private static final AccountId testAutoRenewAccountId = AccountId.fromString("8.8.8"); private static final String testTokenName = "test name"; @@ -82,7 +54,7 @@ public class TokenUpdateTransactionTest { private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final Duration testAutoRenewPeriod = Duration.ofHours(10); private static final Instant testExpirationTime = Instant.now(); - private static final byte[] testMetadata = new byte[]{1, 2, 3, 4, 5}; + private static final byte[] testMetadata = new byte[] {1, 2, 3, 4, 5}; final Instant validStart = Instant.ofEpochSecond(1554158542); @BeforeAll @@ -108,16 +80,30 @@ void shouldBytesNoSetters() throws Exception { } private TokenUpdateTransaction spawnTestTransaction() { - return new TokenUpdateTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(testTokenId).setFeeScheduleKey(testFeeScheduleKey).setSupplyKey(testSupplyKey) - .setAdminKey(testAdminKey).setAutoRenewAccountId(testAutoRenewAccountId) - .setAutoRenewPeriod(testAutoRenewPeriod).setFreezeKey(testFreezeKey).setWipeKey(testWipeKey) - .setTokenSymbol(testTokenSymbol).setKycKey(testKycKey).setPauseKey(testPauseKey) - .setMetadataKey(testMetadataKey).setExpirationTime(validStart).setTreasuryAccountId(testTreasuryAccountId) - .setTokenName(testTokenName).setTokenMemo(testTokenMemo).setMaxTransactionFee(new Hbar(1)) - .setTokenMetadata(testMetadata).setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION).freeze().sign(unusedPrivateKey); + return new TokenUpdateTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(testTokenId) + .setFeeScheduleKey(testFeeScheduleKey) + .setSupplyKey(testSupplyKey) + .setAdminKey(testAdminKey) + .setAutoRenewAccountId(testAutoRenewAccountId) + .setAutoRenewPeriod(testAutoRenewPeriod) + .setFreezeKey(testFreezeKey) + .setWipeKey(testWipeKey) + .setTokenSymbol(testTokenSymbol) + .setKycKey(testKycKey) + .setPauseKey(testPauseKey) + .setMetadataKey(testMetadataKey) + .setExpirationTime(validStart) + .setTreasuryAccountId(testTreasuryAccountId) + .setTokenName(testTokenName) + .setTokenMemo(testTokenMemo) + .setMaxTransactionFee(new Hbar(1)) + .setTokenMetadata(testMetadata) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -130,7 +116,8 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenUpdate(TokenUpdateTransactionBody.newBuilder().build()).build(); + .setTokenUpdate(TokenUpdateTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -139,19 +126,30 @@ void fromScheduledTransaction() { @Test void constructTokenUpdateTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenUpdateTransactionBody.newBuilder().setToken(testTokenId.toProtobuf()) - .setName(testTokenName).setSymbol(testTokenSymbol).setTreasury(testTreasuryAccountId.toProtobuf()) - .setAdminKey(testAdminKey.toProtobufKey()).setKycKey(testKycKey.toProtobufKey()) - .setFreezeKey(testFreezeKey.toProtobufKey()).setWipeKey(testWipeKey.toProtobufKey()) - .setSupplyKey(testSupplyKey.toProtobufKey()).setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) - .setAutoRenewPeriod( - com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) - .build()).setExpiry(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) - .setMemo(StringValue.newBuilder().setValue(testTokenMemo).build()) - .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()).setPauseKey(testPauseKey.toProtobufKey()) - .setMetadataKey(testMetadataKey.toProtobufKey()) - .setMetadata(BytesValue.of(ByteString.copyFrom(testMetadata))) - .setKeyVerificationMode(com.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION).build(); + var transactionBody = TokenUpdateTransactionBody.newBuilder() + .setToken(testTokenId.toProtobuf()) + .setName(testTokenName) + .setSymbol(testTokenSymbol) + .setTreasury(testTreasuryAccountId.toProtobuf()) + .setAdminKey(testAdminKey.toProtobufKey()) + .setKycKey(testKycKey.toProtobufKey()) + .setFreezeKey(testFreezeKey.toProtobufKey()) + .setWipeKey(testWipeKey.toProtobufKey()) + .setSupplyKey(testSupplyKey.toProtobufKey()) + .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) + .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setSeconds(testAutoRenewPeriod.toSeconds()) + .build()) + .setExpiry(Timestamp.newBuilder() + .setSeconds(testExpirationTime.getEpochSecond()) + .build()) + .setMemo(StringValue.newBuilder().setValue(testTokenMemo).build()) + .setFeeScheduleKey(testFeeScheduleKey.toProtobufKey()) + .setPauseKey(testPauseKey.toProtobufKey()) + .setMetadataKey(testMetadataKey.toProtobufKey()) + .setMetadata(BytesValue.of(ByteString.copyFrom(testMetadata))) + .setKeyVerificationMode(com.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION) + .build(); var tx = TransactionBody.newBuilder().setTokenUpdate(transactionBody).build(); var tokenUpdateTransaction = new TokenUpdateTransaction(tx); @@ -167,8 +165,8 @@ void constructTokenUpdateTransactionFromTransactionBodyProtobuf() { assertThat(tokenUpdateTransaction.getSupplyKey()).isEqualTo(testSupplyKey); assertThat(tokenUpdateTransaction.getAutoRenewAccountId()).isEqualTo(testAutoRenewAccountId); assertThat(tokenUpdateTransaction.getAutoRenewPeriod().toSeconds()).isEqualTo(testAutoRenewPeriod.toSeconds()); - assertThat(tokenUpdateTransaction.getExpirationTime().getEpochSecond()).isEqualTo( - testExpirationTime.getEpochSecond()); + assertThat(tokenUpdateTransaction.getExpirationTime().getEpochSecond()) + .isEqualTo(testExpirationTime.getEpochSecond()); assertThat(tokenUpdateTransaction.getTokenMemo()).isEqualTo(testTokenMemo); assertThat(tokenUpdateTransaction.getFeeScheduleKey()).isEqualTo(testFeeScheduleKey); assertThat(tokenUpdateTransaction.getPauseKey()).isEqualTo(testPauseKey); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java index c81d25c4a5..e8c404a210 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java @@ -1,51 +1,24 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenWipeTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TokenWipeAccountTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TokenWipeTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final AccountId testAccountId = AccountId.fromString("0.6.9"); private static final TokenId testTokenId = TokenId.fromString("4.2.0"); private static final long testAmount = 4L; @@ -64,9 +37,7 @@ public static void afterAll() { @Test void shouldSerializeFungible() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -78,34 +49,32 @@ void shouldBytesNoSetters() throws Exception { private TokenWipeTransaction spawnTestTransaction() { return new TokenWipeTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(TokenId.fromString("0.0.111")) - .setAccountId(testAccountId) - .setAmount(testAmount) - .setSerials(testSerialNumbers) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(TokenId.fromString("0.0.111")) + .setAccountId(testAccountId) + .setAmount(testAmount) + .setSerials(testSerialNumbers) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test void shouldSerializeNft() { - SnapshotMatcher.expect(spawnTestTransactionNft() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransactionNft().toString()).toMatchSnapshot(); } private TokenWipeTransaction spawnTestTransactionNft() { return new TokenWipeTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTokenId(TokenId.fromString("0.0.111")) - .setAccountId(testAccountId) - .setSerials(Collections.singletonList(444L)) - .setMaxTransactionFee(new Hbar(1)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTokenId(TokenId.fromString("0.0.111")) + .setAccountId(testAccountId) + .setSerials(Collections.singletonList(444L)) + .setMaxTransactionFee(new Hbar(1)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -125,8 +94,8 @@ void shouldBytesNft() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setTokenWipe(TokenWipeAccountTransactionBody.newBuilder().build()) - .build(); + .setTokenWipe(TokenWipeAccountTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -135,9 +104,12 @@ void fromScheduledTransaction() { @Test void constructTokenWipeTransactionFromTransactionBodyProtobuf() { - var transactionBody = TokenWipeAccountTransactionBody.newBuilder().setToken(testTokenId.toProtobuf()) - .setAccount(testAccountId.toProtobuf()).setAmount(testAmount).addAllSerialNumbers(testSerialNumbers) - .build(); + var transactionBody = TokenWipeAccountTransactionBody.newBuilder() + .setToken(testTokenId.toProtobuf()) + .setAccount(testAccountId.toProtobuf()) + .setAmount(testAmount) + .addAllSerialNumbers(testSerialNumbers) + .build(); var txBody = TransactionBody.newBuilder().setTokenWipe(transactionBody).build(); var tokenWipeTransaction = new TokenWipeTransaction(txBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java index e63402a4d6..e4e29307fc 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java @@ -1,46 +1,21 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Duration; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TopicCreateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,9 +31,7 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } @Test @@ -70,16 +43,16 @@ void shouldBytesNoSetters() throws Exception { private TopicCreateTransaction spawnTestTransaction() { return new TopicCreateTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setSubmitKey(unusedPrivateKey) - .setAdminKey(unusedPrivateKey) - .setAutoRenewAccountId(AccountId.fromString("0.0.5007")) - .setAutoRenewPeriod(Duration.ofHours(24)) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .setTopicMemo("hello memo") - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setSubmitKey(unusedPrivateKey) + .setAdminKey(unusedPrivateKey) + .setAutoRenewAccountId(AccountId.fromString("0.0.5007")) + .setAutoRenewPeriod(Duration.ofHours(24)) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .setTopicMemo("hello memo") + .freeze() + .sign(unusedPrivateKey); } @Test @@ -92,8 +65,9 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setConsensusCreateTopic(ConsensusCreateTopicTransactionBody.newBuilder().build()) - .build(); + .setConsensusCreateTopic( + ConsensusCreateTopicTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java index a74b220725..b53a39afa3 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java @@ -1,46 +1,20 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TopicDeleteTransaction; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; - public class TopicDeleteTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -56,19 +30,17 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(spawnTestTransaction() - .toString() - ).toMatchSnapshot(); + SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } private TopicDeleteTransaction spawnTestTransaction() { return new TopicDeleteTransaction() - .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTopicId(TopicId.fromString("0.0.5007")) - .setMaxTransactionFee(Hbar.fromTinybars(100_000)) - .freeze() - .sign(unusedPrivateKey); + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTopicId(TopicId.fromString("0.0.5007")) + .setMaxTransactionFee(Hbar.fromTinybars(100_000)) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -77,6 +49,7 @@ void shouldBytesNoSetters() throws Exception { var tx2 = Transaction.fromBytes(tx.toBytes()); assertThat(tx2.toString()).isEqualTo(tx.toString()); } + @Test void shouldBytes() throws Exception { var tx = spawnTestTransaction(); @@ -87,8 +60,9 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setConsensusDeleteTopic(ConsensusDeleteTopicTransactionBody.newBuilder().build()) - .build(); + .setConsensusDeleteTopic( + ConsensusDeleteTopicTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java index 0fa1a8159c..fe42306954 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java @@ -1,27 +1,7 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TopicId; import io.github.jsonSnapshot.SnapshotMatcher; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; @@ -51,12 +31,15 @@ void toBytes() throws InvalidProtocolBufferException { @Test void fromBytes() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(TopicId.fromBytes(new TopicId(5005).toBytes()).toString()).toMatchSnapshot(); + SnapshotMatcher.expect(TopicId.fromBytes(new TopicId(5005).toBytes()).toString()) + .toMatchSnapshot(); } @Test void fromSolidityAddress() { - SnapshotMatcher.expect(TokenId.fromSolidityAddress("000000000000000000000000000000000000138D").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(TokenId.fromSolidityAddress("000000000000000000000000000000000000138D") + .toString()) + .toMatchSnapshot(); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java index 4132bc3101..16da542aa5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java @@ -1,26 +1,6 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.TopicInfoQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; @@ -42,8 +22,9 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new TopicInfoQuery() - .setTopicId(TopicId.fromString("0.0.5005")) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setTopicId(TopicId.fromString("0.0.5005")) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java b/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java index b753a9f7cf..45dcd8b682 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java @@ -1,63 +1,36 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.DurationConverter; -import com.hiero.sdk.InstantConverter; -import com.hiero.sdk.LedgerId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TopicInfo; import com.hiero.sdk.proto.ConsensusGetTopicInfoResponse; import com.hiero.sdk.proto.ConsensusTopicInfo; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Duration; +import java.time.Instant; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Duration; -import java.time.Instant; - - public class TopicInfoTest { private static final PrivateKey privateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final byte[] hash = {2}; private static final ConsensusGetTopicInfoResponse info = ConsensusGetTopicInfoResponse.newBuilder() - .setTopicInfo(ConsensusTopicInfo.newBuilder() - .setMemo("1") - .setRunningHash(ByteString.copyFrom(hash)) - .setSequenceNumber(3) - .setExpirationTime(InstantConverter.toProtobuf(Instant.ofEpochMilli(4))) - .setAutoRenewPeriod(DurationConverter.toProtobuf(Duration.ofDays(5))) - .setAdminKey(privateKey.getPublicKey().toProtobufKey()) - .setSubmitKey(privateKey.getPublicKey().toProtobufKey()) - .setAutoRenewAccount(new AccountId(4).toProtobuf()) - .setLedgerId(LedgerId.TESTNET.toByteString())) - .build(); - + .setTopicInfo(ConsensusTopicInfo.newBuilder() + .setMemo("1") + .setRunningHash(ByteString.copyFrom(hash)) + .setSequenceNumber(3) + .setExpirationTime(InstantConverter.toProtobuf(Instant.ofEpochMilli(4))) + .setAutoRenewPeriod(DurationConverter.toProtobuf(Duration.ofDays(5))) + .setAdminKey(privateKey.getPublicKey().toProtobufKey()) + .setSubmitKey(privateKey.getPublicKey().toProtobufKey()) + .setAutoRenewAccount(new AccountId(4).toProtobuf()) + .setLedgerId(LedgerId.TESTNET.toByteString())) + .build(); @BeforeAll public static void beforeAll() { @@ -71,25 +44,24 @@ public static void afterAll() { @Test void fromProtobuf() throws InvalidProtocolBufferException { - SnapshotMatcher.expect(TopicInfo.fromProtobuf(info).toString()) - .toMatchSnapshot(); + SnapshotMatcher.expect(TopicInfo.fromProtobuf(info).toString()).toMatchSnapshot(); } @Test void toProtobuf() throws InvalidProtocolBufferException { SnapshotMatcher.expect(TopicInfo.fromProtobuf(info).toProtobuf().toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void fromBytes() throws InvalidProtocolBufferException { SnapshotMatcher.expect(TopicInfo.fromBytes(info.toByteArray()).toString()) - .toMatchSnapshot(); + .toMatchSnapshot(); } @Test void toBytes() { SnapshotMatcher.expect(Hex.toHexString(TopicInfo.fromProtobuf(info).toBytes())) - .toMatchSnapshot(); + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java index 9e20b5e416..77640ba671 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java @@ -1,34 +1,34 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.TopicMessageChunk; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.ConsensusMessageChunkInfo; import com.hiero.sdk.proto.Timestamp; -import org.junit.jupiter.api.Test; - +import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; public class TopicMessageChunkTest { private static final Instant testTimestamp = Instant.ofEpochSecond(1554158542); - private static final byte[] testContents = new byte[]{0x01, 0x02, 0x03}; - private static final byte[] testRunningHash = new byte[]{0x04, 0x05, 0x06}; + private static final byte[] testContents = new byte[] {0x01, 0x02, 0x03}; + private static final byte[] testRunningHash = new byte[] {0x04, 0x05, 0x06}; private static final long testSequenceNumber = 7L; private static final TransactionId testTransactionId = new TransactionId(new AccountId(1), testTimestamp); @Test void constructWithArgs() { var consensusTopicResponse = ConsensusTopicResponse.newBuilder() - .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) - .setMessage(ByteString.copyFrom(testContents)).setRunningHash(ByteString.copyFrom(testRunningHash)) - .setSequenceNumber(testSequenceNumber).setChunkInfo( - ConsensusMessageChunkInfo.newBuilder().setInitialTransactionID(testTransactionId.toProtobuf()).build()) - .build(); + .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) + .setMessage(ByteString.copyFrom(testContents)) + .setRunningHash(ByteString.copyFrom(testRunningHash)) + .setSequenceNumber(testSequenceNumber) + .setChunkInfo(ConsensusMessageChunkInfo.newBuilder() + .setInitialTransactionID(testTransactionId.toProtobuf()) + .build()) + .build(); TopicMessageChunk topicMessageChunk = new TopicMessageChunk(consensusTopicResponse); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java index 71de50efb7..d5e6f41d95 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java @@ -1,34 +1,13 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import com.google.common.base.Stopwatch; import com.google.common.primitives.Longs; import com.google.common.util.concurrent.Uninterruptibles; import com.google.protobuf.ByteString; -import com.hiero.sdk.Client; -import com.hiero.sdk.SubscriptionHandle; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.TopicMessage; -import com.hiero.sdk.TopicMessageChunk; -import com.hiero.sdk.TopicMessageQuery; import com.hiero.sdk.proto.AccountID; import com.hiero.sdk.proto.ConsensusMessageChunkInfo; import com.hiero.sdk.proto.Timestamp; @@ -43,16 +22,6 @@ import io.grpc.StatusRuntimeException; import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.StreamObserver; -import org.assertj.core.api.InstanceOfAssertFactories; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - import java.time.Duration; import java.time.Instant; import java.util.ArrayDeque; @@ -64,19 +33,25 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import org.assertj.core.api.InstanceOfAssertFactories; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; class TopicMessageQueryTest { private static final Instant START_TIME = Instant.now(); private Client client; - final private AtomicBoolean complete = new AtomicBoolean(false); - final private List errors = new ArrayList<>(); - final private List received = new ArrayList<>(); - final private ConsensusServiceStub consensusServiceStub = new ConsensusServiceStub(); + private final AtomicBoolean complete = new AtomicBoolean(false); + private final List errors = new ArrayList<>(); + private final List received = new ArrayList<>(); + private final ConsensusServiceStub consensusServiceStub = new ConsensusServiceStub(); private Server server; private TopicMessageQuery topicMessageQuery; @@ -95,10 +70,10 @@ void setup() throws Exception { client = Client.forNetwork(Collections.emptyMap()); client.setMirrorNetwork(List.of("in-process:test")); server = InProcessServerBuilder.forName("test") - .addService(consensusServiceStub) - .directExecutor() - .build() - .start(); + .addService(consensusServiceStub) + .directExecutor() + .build() + .start(); topicMessageQuery = new TopicMessageQuery(); topicMessageQuery.setCompletionHandler(() -> complete.set(true)); topicMessageQuery.setEndTime(START_TIME.plusSeconds(100L)); @@ -124,71 +99,71 @@ void teardown() throws Exception { @SuppressWarnings("NullAway") void setCompletionHandlerNull() { assertThatThrownBy(() -> topicMessageQuery.setCompletionHandler(null)) - .isInstanceOf(NullPointerException.class) - .hasMessage("completionHandler must not be null"); + .isInstanceOf(NullPointerException.class) + .hasMessage("completionHandler must not be null"); } @Test @SuppressWarnings("NullAway") void setEndTimeNull() { assertThatThrownBy(() -> topicMessageQuery.setEndTime(null)) - .isInstanceOf(NullPointerException.class) - .hasMessage("endTime must not be null"); + .isInstanceOf(NullPointerException.class) + .hasMessage("endTime must not be null"); } @Test @SuppressWarnings("NullAway") void setErrorHandlerNull() { assertThatThrownBy(() -> topicMessageQuery.setErrorHandler(null)) - .isInstanceOf(NullPointerException.class) - .hasMessage("errorHandler must not be null"); + .isInstanceOf(NullPointerException.class) + .hasMessage("errorHandler must not be null"); } @Test @SuppressWarnings("NullAway") void setMaxAttemptsNegative() { assertThatThrownBy(() -> topicMessageQuery.setMaxAttempts(-1)) - .isInstanceOf(IllegalArgumentException.class) - .hasMessage("maxAttempts must be positive"); + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("maxAttempts must be positive"); } @Test @SuppressWarnings("NullAway") void setMaxBackoffNull() { assertThatThrownBy(() -> topicMessageQuery.setMaxBackoff(null)) - .isInstanceOf(IllegalArgumentException.class) - .hasMessage("maxBackoff must be at least 500 ms"); + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("maxBackoff must be at least 500 ms"); } @Test void setMaxBackoffLow() { assertThatThrownBy(() -> topicMessageQuery.setMaxBackoff(Duration.ofMillis(499L))) - .isInstanceOf(IllegalArgumentException.class) - .hasMessage("maxBackoff must be at least 500 ms"); + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("maxBackoff must be at least 500 ms"); } @Test @SuppressWarnings("NullAway") void setRetryHandlerNull() { assertThatThrownBy(() -> topicMessageQuery.setRetryHandler(null)) - .isInstanceOf(NullPointerException.class) - .hasMessage("retryHandler must not be null"); + .isInstanceOf(NullPointerException.class) + .hasMessage("retryHandler must not be null"); } @Test @SuppressWarnings("NullAway") void setStartTimeNull() { assertThatThrownBy(() -> topicMessageQuery.setStartTime(null)) - .isInstanceOf(NullPointerException.class) - .hasMessage("startTime must not be null"); + .isInstanceOf(NullPointerException.class) + .hasMessage("startTime must not be null"); } @Test @SuppressWarnings("NullAway") void setTopicIdNull() { assertThatThrownBy(() -> topicMessageQuery.setTopicId(null)) - .isInstanceOf(NullPointerException.class) - .hasMessage("topicId must not be null"); + .isInstanceOf(NullPointerException.class) + .hasMessage("topicId must not be null"); } @Test @@ -215,21 +190,24 @@ void subscribeChunked() { subscribeToMirror(received::add); - var message = combine(response1.getMessage().toByteArray(), response2.getMessage().toByteArray()); + var message = combine( + response1.getMessage().toByteArray(), response2.getMessage().toByteArray()); assertThat(errors).isEmpty(); assertThat(received) - .hasSize(1) - .first() - .returns(toInstant(response2.getConsensusTimestamp()), t -> t.consensusTimestamp) - .returns(response2.getChunkInfo().getInitialTransactionID(), t -> Objects.requireNonNull(t.transactionId).toProtobuf()) - .returns(message, t -> t.contents) - .returns(response2.getRunningHash().toByteArray(), t -> t.runningHash) - .returns(response2.getSequenceNumber(), t -> t.sequenceNumber) - .extracting(t -> t.chunks) - .asInstanceOf(InstanceOfAssertFactories.ARRAY) - .hasSize(2) - .extracting(c -> ((TopicMessageChunk) c).sequenceNumber) - .contains(1L, 2L); + .hasSize(1) + .first() + .returns(toInstant(response2.getConsensusTimestamp()), t -> t.consensusTimestamp) + .returns( + response2.getChunkInfo().getInitialTransactionID(), + t -> Objects.requireNonNull(t.transactionId).toProtobuf()) + .returns(message, t -> t.contents) + .returns(response2.getRunningHash().toByteArray(), t -> t.runningHash) + .returns(response2.getSequenceNumber(), t -> t.sequenceNumber) + .extracting(t -> t.chunks) + .asInstanceOf(InstanceOfAssertFactories.ARRAY) + .hasSize(2) + .extracting(c -> ((TopicMessageChunk) c).sequenceNumber) + .contains(1L, 2L); } @Test @@ -272,9 +250,11 @@ void retryRecovers(Status.Code code, String description) { ConsensusTopicQuery.Builder request = request(); consensusServiceStub.requests.add(request.build()); - consensusServiceStub.requests.add(request.setConsensusStartTime(toTimestamp(nextTimestamp)).build()); + consensusServiceStub.requests.add( + request.setConsensusStartTime(toTimestamp(nextTimestamp)).build()); consensusServiceStub.responses.add(response); - consensusServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); + consensusServiceStub.responses.add( + code.toStatus().withDescription(description).asRuntimeException()); consensusServiceStub.responses.add(response(2L)); subscribeToMirror(received::add); @@ -284,25 +264,23 @@ void retryRecovers(Status.Code code, String description) { } @ParameterizedTest(name = "No retry w/ status {0} and description {1}") - @CsvSource({ - "INTERNAL, internal first_stream error", - "INTERNAL, internal error", - "INTERNAL, ", - "INVALID_ARGUMENT, " + @CsvSource({"INTERNAL, internal first_stream error", "INTERNAL, internal error", "INTERNAL, ", "INVALID_ARGUMENT, " }) @Timeout(3) void noRetry(Status.Code code, String description) { consensusServiceStub.requests.add(request().build()); - consensusServiceStub.responses.add(code.toStatus().withDescription(description).asRuntimeException()); + consensusServiceStub.responses.add( + code.toStatus().withDescription(description).asRuntimeException()); subscribeToMirror(received::add); assertThat(received).isEmpty(); - assertThat(errors).hasSize(1) - .first() - .isInstanceOf(StatusRuntimeException.class) - .extracting(t -> ((StatusRuntimeException) t).getStatus().getCode()) - .isEqualTo(code); + assertThat(errors) + .hasSize(1) + .first() + .isInstanceOf(StatusRuntimeException.class) + .extracting(t -> ((StatusRuntimeException) t).getStatus().getCode()) + .isEqualTo(code); } @Test @@ -329,7 +307,9 @@ void retryWithLimit() { topicMessageQuery.setLimit(2); consensusServiceStub.requests.add(request.setLimit(2L).build()); - consensusServiceStub.requests.add(request.setConsensusStartTime(toTimestamp(nextTimestamp)).setLimit(1L).build()); + consensusServiceStub.requests.add(request.setConsensusStartTime(toTimestamp(nextTimestamp)) + .setLimit(1L) + .build()); consensusServiceStub.responses.add(response); consensusServiceStub.responses.add(Status.RESOURCE_EXHAUSTED.asRuntimeException()); consensusServiceStub.responses.add(response(2L)); @@ -352,11 +332,12 @@ void retriesExhausted() { subscribeToMirror(received::add); assertThat(received).isEmpty(); - assertThat(errors).hasSize(1) - .first() - .isInstanceOf(StatusRuntimeException.class) - .extracting(t -> ((StatusRuntimeException) t).getStatus()) - .isEqualTo(Status.RESOURCE_EXHAUSTED); + assertThat(errors) + .hasSize(1) + .first() + .isInstanceOf(StatusRuntimeException.class) + .extracting(t -> ((StatusRuntimeException) t).getStatus()) + .isEqualTo(Status.RESOURCE_EXHAUSTED); } @Test @@ -368,11 +349,11 @@ void errorWhenCallIsCancelled() { subscribeToMirror(received::add); assertThat(errors) - .hasSize(1) - .first() - .isInstanceOf(StatusRuntimeException.class) - .extracting(t -> ((StatusRuntimeException)t).getStatus()) - .isEqualTo(Status.CANCELLED); + .hasSize(1) + .first() + .isInstanceOf(StatusRuntimeException.class) + .extracting(t -> ((StatusRuntimeException) t).getStatus()) + .isEqualTo(Status.CANCELLED); assertThat(received).isEmpty(); } @@ -388,51 +369,52 @@ private void subscribeToMirror(Consumer onNext) { subscriptionHandle.unsubscribe(); } - static private ConsensusTopicQuery.Builder request() { + private static ConsensusTopicQuery.Builder request() { return ConsensusTopicQuery.newBuilder() - .setConsensusEndTime(toTimestamp(START_TIME.plusSeconds(100L))) - .setConsensusStartTime(toTimestamp(START_TIME)) - .setTopicID(TopicID.newBuilder().setTopicNum(1000).build()); + .setConsensusEndTime(toTimestamp(START_TIME.plusSeconds(100L))) + .setConsensusStartTime(toTimestamp(START_TIME)) + .setTopicID(TopicID.newBuilder().setTopicNum(1000).build()); } - static private ConsensusTopicResponse response(long sequenceNumber) { + private static ConsensusTopicResponse response(long sequenceNumber) { return response(sequenceNumber, 0); } - static private ConsensusTopicResponse response(long sequenceNumber, int total) { + private static ConsensusTopicResponse response(long sequenceNumber, int total) { ConsensusTopicResponse.Builder consensusTopicResponseBuilder = ConsensusTopicResponse.newBuilder(); if (total > 0) { var chunkInfo = ConsensusMessageChunkInfo.newBuilder() - .setInitialTransactionID(TransactionID.newBuilder() - .setAccountID(AccountID.newBuilder().setAccountNum(3).build()) - .setTransactionValidStart(toTimestamp(START_TIME)) - .build()) - .setNumber((int) sequenceNumber) - .setTotal(total) - .build(); + .setInitialTransactionID(TransactionID.newBuilder() + .setAccountID( + AccountID.newBuilder().setAccountNum(3).build()) + .setTransactionValidStart(toTimestamp(START_TIME)) + .build()) + .setNumber((int) sequenceNumber) + .setTotal(total) + .build(); consensusTopicResponseBuilder.setChunkInfo(chunkInfo); } var message = ByteString.copyFrom(Longs.toByteArray(sequenceNumber)); return consensusTopicResponseBuilder - .setConsensusTimestamp(toTimestamp(START_TIME.plusSeconds(sequenceNumber))) - .setSequenceNumber(sequenceNumber) - .setMessage(message) - .setRunningHash(message) - .setRunningHashVersion(2L) - .build(); + .setConsensusTimestamp(toTimestamp(START_TIME.plusSeconds(sequenceNumber))) + .setSequenceNumber(sequenceNumber) + .setMessage(message) + .setRunningHash(message) + .setRunningHashVersion(2L) + .build(); } - static private Instant toInstant(Timestamp timestamp) { + private static Instant toInstant(Timestamp timestamp) { return Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos()); } - static private Timestamp toTimestamp(Instant instant) { + private static Timestamp toTimestamp(Instant instant) { return Timestamp.newBuilder() - .setSeconds(instant.getEpochSecond()) - .setNanos(instant.getNano()) - .build(); + .setSeconds(instant.getEpochSecond()) + .setNanos(instant.getNano()) + .build(); } private static class ConsensusServiceStub extends ConsensusServiceGrpc.ConsensusServiceImplBase { @@ -441,8 +423,8 @@ private static class ConsensusServiceStub extends ConsensusServiceGrpc.Consensus private final Queue responses = new ArrayDeque<>(); @Override - public void subscribeTopic(ConsensusTopicQuery consensusTopicQuery, - StreamObserver streamObserver) { + public void subscribeTopic( + ConsensusTopicQuery consensusTopicQuery, StreamObserver streamObserver) { var request = requests.poll(); assertThat(request).isNotNull(); assertThat(consensusTopicQuery).isEqualTo(request); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java index cf4f8476c4..c797a0be1d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java @@ -1,29 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.TopicMessageSubmitTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - public class TopicMessageSubmitTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final TopicId testTopicId = new TopicId(0, 6, 9); private static final byte[] testMessageBytes = {0x04, 0x05, 0x06}; private static final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -39,17 +33,23 @@ public static void afterAll() { } private TopicMessageSubmitTransaction spawnTestTransactionString() { - return new TopicMessageSubmitTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTopicId(testTopicId).setMessage(new String(testMessageBytes)).freeze().sign(unusedPrivateKey); + return new TopicMessageSubmitTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTopicId(testTopicId) + .setMessage(new String(testMessageBytes)) + .freeze() + .sign(unusedPrivateKey); } private TopicMessageSubmitTransaction spawnTestTransactionBytes() { - return new TopicMessageSubmitTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTopicId(testTopicId).setMessage(testMessageBytes).freeze().sign(unusedPrivateKey); + return new TopicMessageSubmitTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTopicId(testTopicId) + .setMessage(testMessageBytes) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -62,20 +62,25 @@ void shouldBytesNoSetters() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setConsensusSubmitMessage(ConsensusSubmitMessageTransactionBody.newBuilder().build()).build(); + .setConsensusSubmitMessage( + ConsensusSubmitMessageTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); assertThat(tx).isInstanceOf(TopicMessageSubmitTransaction.class); } - @Test void constructTopicMessageSubmitTransactionFromTransactionBodyProtobuf() { - var transactionBody = ConsensusSubmitMessageTransactionBody.newBuilder().setTopicID(testTopicId.toProtobuf()) - .setMessage(ByteString.copyFrom(testMessageBytes)).build(); + var transactionBody = ConsensusSubmitMessageTransactionBody.newBuilder() + .setTopicID(testTopicId.toProtobuf()) + .setMessage(ByteString.copyFrom(testMessageBytes)) + .build(); - var tx = TransactionBody.newBuilder().setConsensusSubmitMessage(transactionBody).build(); + var tx = TransactionBody.newBuilder() + .setConsensusSubmitMessage(transactionBody) + .build(); var topicSubmitMessageTransaction = new TopicMessageSubmitTransaction(tx); assertThat(topicSubmitMessageTransaction.getTopicId()).isEqualTo(testTopicId); @@ -95,20 +100,22 @@ void getSetTopicIdFrozen() { @Test void getSetMessage() { - var topicSubmitMessageTransactionString = new TopicMessageSubmitTransaction().setMessage( - new String(testMessageBytes)); + var topicSubmitMessageTransactionString = + new TopicMessageSubmitTransaction().setMessage(new String(testMessageBytes)); var topicSubmitMessageTransactionBytes = new TopicMessageSubmitTransaction().setMessage(testMessageBytes); - assertThat(topicSubmitMessageTransactionString.getMessage().toByteArray()).isEqualTo(testMessageBytes); - assertThat(topicSubmitMessageTransactionBytes.getMessage().toByteArray()).isEqualTo(testMessageBytes); + assertThat(topicSubmitMessageTransactionString.getMessage().toByteArray()) + .isEqualTo(testMessageBytes); + assertThat(topicSubmitMessageTransactionBytes.getMessage().toByteArray()) + .isEqualTo(testMessageBytes); } @Test void getSetMessageFrozen() { var topicSubmitMessageTransactionString = spawnTestTransactionString(); var topicSubmitMessageTransactionBytes = spawnTestTransactionBytes(); - assertThrows(IllegalStateException.class, - () -> topicSubmitMessageTransactionString.setMessage(testMessageBytes)); - assertThrows(IllegalStateException.class, - () -> topicSubmitMessageTransactionBytes.setMessage(testMessageBytes)); + assertThrows( + IllegalStateException.class, () -> topicSubmitMessageTransactionString.setMessage(testMessageBytes)); + assertThrows( + IllegalStateException.class, () -> topicSubmitMessageTransactionBytes.setMessage(testMessageBytes)); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java b/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java index 6111b538f9..d1fb8c0c3b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java @@ -1,38 +1,41 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.TopicMessage; -import com.hiero.sdk.TopicMessageChunk; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.ConsensusMessageChunkInfo; import com.hiero.sdk.proto.Timestamp; import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; public class TopicMessageTest { private static final Instant testTimestamp = Instant.ofEpochSecond(1554158542); - private static final byte[] testContents = new byte[]{0x01, 0x02, 0x03}; - private static final byte[] testRunningHash = new byte[]{0x04, 0x05, 0x06}; + private static final byte[] testContents = new byte[] {0x01, 0x02, 0x03}; + private static final byte[] testRunningHash = new byte[] {0x04, 0x05, 0x06}; private static final long testSequenceNumber = 7L; private static final TransactionId testTransactionId = new TransactionId(new AccountId(1), testTimestamp); @Test void constructWithArgs() { TopicMessageChunk topicMessageChunk = new TopicMessageChunk(ConsensusTopicResponse.newBuilder() - .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) - .setRunningHash(ByteString.copyFrom(testRunningHash)).setSequenceNumber(testSequenceNumber).build()); + .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) + .setRunningHash(ByteString.copyFrom(testRunningHash)) + .setSequenceNumber(testSequenceNumber) + .build()); TopicMessageChunk[] topicMessageChunkArr = {topicMessageChunk, topicMessageChunk, topicMessageChunk}; - TopicMessage topicMessage = new TopicMessage(testTimestamp, testContents, testRunningHash, testSequenceNumber, - topicMessageChunkArr, testTransactionId); + TopicMessage topicMessage = new TopicMessage( + testTimestamp, + testContents, + testRunningHash, + testSequenceNumber, + topicMessageChunkArr, + testTransactionId); assertThat(topicMessage.consensusTimestamp).isEqualTo(testTimestamp); assertThat(topicMessage.contents).isEqualTo(testContents); @@ -45,11 +48,14 @@ void constructWithArgs() { @Test void ofSingle() { var consensusTopicResponse = ConsensusTopicResponse.newBuilder() - .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) - .setMessage(ByteString.copyFrom(testContents)).setRunningHash(ByteString.copyFrom(testRunningHash)) - .setSequenceNumber(testSequenceNumber).setChunkInfo( - ConsensusMessageChunkInfo.newBuilder().setInitialTransactionID(testTransactionId.toProtobuf()).build()) - .build(); + .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) + .setMessage(ByteString.copyFrom(testContents)) + .setRunningHash(ByteString.copyFrom(testRunningHash)) + .setSequenceNumber(testSequenceNumber) + .setChunkInfo(ConsensusMessageChunkInfo.newBuilder() + .setInitialTransactionID(testTransactionId.toProtobuf()) + .build()) + .build(); TopicMessage topicMessage = TopicMessage.ofSingle(consensusTopicResponse); @@ -64,17 +70,27 @@ void ofSingle() { @Test void ofMany() { var consensusTopicResponse1 = ConsensusTopicResponse.newBuilder() - .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) - .setMessage(ByteString.copyFrom(testContents)).setRunningHash(ByteString.copyFrom(testRunningHash)) - .setSequenceNumber(testSequenceNumber).setChunkInfo( - ConsensusMessageChunkInfo.newBuilder().setInitialTransactionID(testTransactionId.toProtobuf()) - .setNumber(1).setTotal(2).build()).build(); + .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond())) + .setMessage(ByteString.copyFrom(testContents)) + .setRunningHash(ByteString.copyFrom(testRunningHash)) + .setSequenceNumber(testSequenceNumber) + .setChunkInfo(ConsensusMessageChunkInfo.newBuilder() + .setInitialTransactionID(testTransactionId.toProtobuf()) + .setNumber(1) + .setTotal(2) + .build()) + .build(); var consensusTopicResponse2 = ConsensusTopicResponse.newBuilder() - .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond() + 1)) - .setMessage(ByteString.copyFrom(testContents)).setRunningHash(ByteString.copyFrom(testRunningHash)) - .setSequenceNumber(testSequenceNumber + 1L) - .setChunkInfo(ConsensusMessageChunkInfo.newBuilder().setNumber(2).setTotal(2).build()).build(); + .setConsensusTimestamp(Timestamp.newBuilder().setSeconds(testTimestamp.getEpochSecond() + 1)) + .setMessage(ByteString.copyFrom(testContents)) + .setRunningHash(ByteString.copyFrom(testRunningHash)) + .setSequenceNumber(testSequenceNumber + 1L) + .setChunkInfo(ConsensusMessageChunkInfo.newBuilder() + .setNumber(2) + .setTotal(2) + .build()) + .build(); TopicMessage topicMessage = TopicMessage.ofMany(List.of(consensusTopicResponse1, consensusTopicResponse2)); diff --git a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java index 455ff33f17..d287989008 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java @@ -1,59 +1,32 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.protobuf.StringValue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.TopicUpdateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; import com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; import com.hiero.sdk.proto.CryptoDeleteTransactionBody; import com.hiero.sdk.proto.SchedulableTransactionBody; import com.hiero.sdk.proto.Timestamp; import com.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Duration; import java.time.Instant; import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TopicUpdateTransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); private static final PublicKey testAdminKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e11") + .getPublicKey(); private static final PublicKey testSubmitKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") - .getPublicKey(); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12") + .getPublicKey(); private static final TopicId testTopicId = TopicId.fromString("0.0.5007"); private static final String testTopicMemo = "test memo"; private static final Duration testAutoRenewPeriod = Duration.ofHours(10); @@ -73,30 +46,46 @@ public static void afterAll() { @Test void clearShouldSerialize() { - SnapshotMatcher.expect(new TopicUpdateTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTopicId(testTopicId).clearAdminKey().clearAutoRenewAccountId().clearSubmitKey().clearTopicMemo() - .freeze().sign(unusedPrivateKey).toString()).toMatchSnapshot(); + SnapshotMatcher.expect(new TopicUpdateTransaction() + .setNodeAccountIds( + Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTopicId(testTopicId) + .clearAdminKey() + .clearAutoRenewAccountId() + .clearSubmitKey() + .clearTopicMemo() + .freeze() + .sign(unusedPrivateKey) + .toString()) + .toMatchSnapshot(); } @Test void setShouldSerialize() { SnapshotMatcher.expect(spawnTestTransaction().toString()).toMatchSnapshot(); } + @Test void shouldBytesNoSetters() throws Exception { var tx = new TopicUpdateTransaction(); var tx2 = Transaction.fromBytes(tx.toBytes()); assertThat(tx2.toString()).isEqualTo(tx.toString()); } + private TopicUpdateTransaction spawnTestTransaction() { - return new TopicUpdateTransaction().setNodeAccountIds( - Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) - .setTopicId(testTopicId).setAdminKey(testAdminKey).setAutoRenewAccountId(testAutoRenewAccountId) - .setAutoRenewPeriod(testAutoRenewPeriod).setSubmitKey(testSubmitKey).setTopicMemo(testTopicMemo) - .setExpirationTime(validStart).freeze().sign(unusedPrivateKey); + return new TopicUpdateTransaction() + .setNodeAccountIds(Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006"))) + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), validStart)) + .setTopicId(testTopicId) + .setAdminKey(testAdminKey) + .setAutoRenewAccountId(testAutoRenewAccountId) + .setAutoRenewPeriod(testAutoRenewPeriod) + .setSubmitKey(testSubmitKey) + .setTopicMemo(testTopicMemo) + .setExpirationTime(validStart) + .freeze() + .sign(unusedPrivateKey); } @Test @@ -109,7 +98,9 @@ void shouldBytes() throws Exception { @Test void fromScheduledTransaction() { var transactionBody = SchedulableTransactionBody.newBuilder() - .setConsensusUpdateTopic(ConsensusUpdateTopicTransactionBody.newBuilder().build()).build(); + .setConsensusUpdateTopic( + ConsensusUpdateTopicTransactionBody.newBuilder().build()) + .build(); var tx = Transaction.fromScheduledTransaction(transactionBody); @@ -118,20 +109,29 @@ void fromScheduledTransaction() { @Test void constructTopicUpdateTransactionFromTransactionBodyProtobuf() { - var transactionBody = ConsensusUpdateTopicTransactionBody.newBuilder().setTopicID(testTopicId.toProtobuf()) - .setMemo(StringValue.newBuilder().setValue(testTopicMemo).build()) - .setExpirationTime(Timestamp.newBuilder().setSeconds(testExpirationTime.getEpochSecond()).build()) - .setAdminKey(testAdminKey.toProtobufKey()).setSubmitKey(testSubmitKey.toProtobufKey()).setAutoRenewPeriod( - com.hiero.sdk.proto.Duration.newBuilder().setSeconds(testAutoRenewPeriod.toSeconds()) - .build()).setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()).build(); - - var tx = TransactionBody.newBuilder().setConsensusUpdateTopic(transactionBody).build(); + var transactionBody = ConsensusUpdateTopicTransactionBody.newBuilder() + .setTopicID(testTopicId.toProtobuf()) + .setMemo(StringValue.newBuilder().setValue(testTopicMemo).build()) + .setExpirationTime(Timestamp.newBuilder() + .setSeconds(testExpirationTime.getEpochSecond()) + .build()) + .setAdminKey(testAdminKey.toProtobufKey()) + .setSubmitKey(testSubmitKey.toProtobufKey()) + .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setSeconds(testAutoRenewPeriod.toSeconds()) + .build()) + .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) + .build(); + + var tx = TransactionBody.newBuilder() + .setConsensusUpdateTopic(transactionBody) + .build(); var topicUpdateTransaction = new TopicUpdateTransaction(tx); assertThat(topicUpdateTransaction.getTopicId()).isEqualTo(testTopicId); assertThat(topicUpdateTransaction.getTopicMemo()).isEqualTo(testTopicMemo); - assertThat(topicUpdateTransaction.getExpirationTime().getEpochSecond()).isEqualTo( - testExpirationTime.getEpochSecond()); + assertThat(topicUpdateTransaction.getExpirationTime().getEpochSecond()) + .isEqualTo(testExpirationTime.getEpochSecond()); assertThat(topicUpdateTransaction.getAdminKey()).isEqualTo(testAdminKey); assertThat(topicUpdateTransaction.getSubmitKey()).isEqualTo(testSubmitKey); assertThat(topicUpdateTransaction.getAutoRenewPeriod().toSeconds()).isEqualTo(testAutoRenewPeriod.toSeconds()); diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java index 8ea60320d3..a16583b421 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java @@ -1,38 +1,17 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.TransactionId; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Objects; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class TransactionIdTest { @BeforeAll public static void beforeAll() { @@ -46,12 +25,16 @@ public static void afterAll() { @Test void shouldSerialize() { - SnapshotMatcher.expect(TransactionId.fromString("0.0.23847@1588539964.632521325").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(TransactionId.fromString("0.0.23847@1588539964.632521325") + .toString()) + .toMatchSnapshot(); } @Test void shouldSerialize2() { - SnapshotMatcher.expect(TransactionId.fromString("0.0.23847@1588539964.632521325?scheduled/3").toString()).toMatchSnapshot(); + SnapshotMatcher.expect(TransactionId.fromString("0.0.23847@1588539964.632521325?scheduled/3") + .toString()) + .toMatchSnapshot(); } @Test @@ -167,7 +150,6 @@ void compare() { transactionId2 = new TransactionId(null, Instant.ofEpochSecond(1588539965)); assertThat(transactionId1.compareTo(transactionId2)).isEqualTo(-1); - transactionId1 = new TransactionId(null, null); transactionId2 = new TransactionId(null, null); assertThat(transactionId1).isEqualByComparingTo(transactionId2); @@ -175,13 +157,11 @@ void compare() { @Test void shouldFail() { - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> TransactionId.fromString("0.0.23847.1588539964.632521325/4") - ); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> TransactionId.fromString("0.0.23847.1588539964.632521325/4")); - assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - () -> TransactionId.fromString("0.0.23847@1588539964/4") - ); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> TransactionId.fromString("0.0.23847@1588539964/4")); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java index 6ba61fc284..daf422ac65 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java @@ -1,39 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionReceiptQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - public class TransactionReceiptQueryTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -51,8 +28,9 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); new TransactionReceiptQuery() - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5005"), validStart)) - .onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5005"), validStart)) + .onMakeRequest(builder, QueryHeader.newBuilder().build()); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java index ff2816c02f..44fdcba574 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java @@ -1,31 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ExchangeRate; -import com.hiero.sdk.FileId; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TopicId; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionReceipt; import io.github.jsonSnapshot.SnapshotMatcher; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.ArrayList; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; - +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TransactionReceiptTest { - final static Instant time = Instant.ofEpochSecond(1554158542); + static final Instant time = Instant.ofEpochSecond(1554158542); @BeforeAll public static void beforeAll() { @@ -39,24 +28,23 @@ public static void afterAll() { static TransactionReceipt spawnReceiptExample() { return new TransactionReceipt( - null, - Status.SCHEDULE_ALREADY_DELETED, - new ExchangeRate(3, 4, time), - AccountId.fromString("1.2.3"), - FileId.fromString("4.5.6"), - ContractId.fromString("3.2.1"), - TopicId.fromString("9.8.7"), - TokenId.fromString("6.5.4"), - 3L, - ByteString.copyFrom("how now brown cow", StandardCharsets.UTF_8), - 30L, - ScheduleId.fromString("1.1.1"), - TransactionId.withValidStart(AccountId.fromString("3.3.3"), time), - List.of(1L, 2L, 3L), - 1, - new ArrayList<>(), - new ArrayList<>() - ); + null, + Status.SCHEDULE_ALREADY_DELETED, + new ExchangeRate(3, 4, time), + AccountId.fromString("1.2.3"), + FileId.fromString("4.5.6"), + ContractId.fromString("3.2.1"), + TopicId.fromString("9.8.7"), + TokenId.fromString("6.5.4"), + 3L, + ByteString.copyFrom("how now brown cow", StandardCharsets.UTF_8), + 30L, + ScheduleId.fromString("1.1.1"), + TransactionId.withValidStart(AccountId.fromString("3.3.3"), time), + List.of(1L, 2L, 3L), + 1, + new ArrayList<>(), + new ArrayList<>()); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java index f8dfc01de9..9eda9bae20 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java @@ -1,39 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionRecordQuery; import com.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import java.time.Instant; - public class TransactionRecordQueryTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); final Instant validStart = Instant.ofEpochSecond(1554158542); @@ -51,13 +28,14 @@ public static void afterAll() { void shouldSerialize() { var builder = com.hiero.sdk.proto.Query.newBuilder(); spawnQuery().onMakeRequest(builder, QueryHeader.newBuilder().build()); - SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")).toMatchSnapshot(); + SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) + .toMatchSnapshot(); } private TransactionRecordQuery spawnQuery() { return new TransactionRecordQuery() - .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5005"), validStart)) - .setIncludeChildren(true) - .setIncludeDuplicates(true); + .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5005"), validStart)) + .setIncludeChildren(true) + .setIncludeDuplicates(true); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java index 2b12ae979d..a90144a0df 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java @@ -1,62 +1,26 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static com.hiero.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; +import static com.hiero.sdk.TransactionReceiptTest.spawnReceiptExample; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AssessedCustomFee; -import com.hiero.sdk.ContractFunctionResult; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PendingAirdropId; -import com.hiero.sdk.PendingAirdropRecord; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.TokenAssociation; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenNftTransfer; -import com.hiero.sdk.TokenTransfer; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionRecord; -import com.hiero.sdk.Transfer; import io.github.jsonSnapshot.SnapshotMatcher; -import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import javax.annotation.Nullable; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Map; - -import static com.hiero.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; -import static com.hiero.sdk.TransactionReceiptTest.spawnReceiptExample; -import static org.assertj.core.api.Assertions.assertThat; +import javax.annotation.Nullable; +import org.bouncycastle.util.encoders.Hex; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class TransactionRecordTest { - final static Instant time = Instant.ofEpochSecond(1554158542); + static final Instant time = Instant.ofEpochSecond(1554158542); private static final byte[] callResult = Hex.decode(CALL_RESULT_HEX); @BeforeAll @@ -71,48 +35,65 @@ public static void afterAll() { private static TransactionRecord spawnRecordExample(@Nullable ByteString prngBytes, @Nullable Integer prngNumber) { return new TransactionRecord( - spawnReceiptExample(), - ByteString.copyFrom("hello", StandardCharsets.UTF_8), - time, - TransactionId.withValidStart(AccountId.fromString("3.3.3"), time), - "memo", - 3000L, - new ContractFunctionResult( - com.hiero.sdk.proto.ContractFunctionResult.newBuilder() - .setContractID(ContractId.fromString("1.2.3").toProtobuf()) - .setContractCallResult(ByteString.copyFrom(callResult)) - .setEvmAddress(BytesValue.newBuilder().setValue(ByteString.copyFrom(Hex.decode("98329e006610472e6B372C080833f6D79ED833cf"))).build()) - .setSenderId(AccountId.fromString("1.2.3").toProtobuf()) - ), - List.of(new Transfer(AccountId.fromString("4.4.4"), Hbar.from(5))), - Map.of(TokenId.fromString("6.6.6"), Map.of(AccountId.fromString("1.1.1"), 4L)), - List.of(new TokenTransfer(TokenId.fromString("8.9.10"), AccountId.fromString("1.2.3"), 4L, 3, true)), - Map.of(TokenId.fromString("4.4.4"), List.of(new TokenNftTransfer(TokenId.fromString("4.4.4"), AccountId.fromString("1.2.3"), AccountId.fromString("3.2.1"), 4L, true))), - ScheduleId.fromString("3.3.3"), - List.of(new AssessedCustomFee(4L, TokenId.fromString("4.5.6"), AccountId.fromString("8.6.5"), List.of(AccountId.fromString("3.3.3")))), - List.of(new TokenAssociation(TokenId.fromString("5.4.3"), AccountId.fromString("8.7.6"))), - PrivateKey.fromStringECDSA("8776c6b831a1b61ac10dac0304a2843de4716f54b1919bb91a2685d0fe3f3048").getPublicKey(), - new ArrayList<>(), - new ArrayList<>(), - time, - ByteString.copyFrom("Some hash", StandardCharsets.UTF_8), - List.of(new Transfer(AccountId.fromString("1.2.3"), Hbar.from(8))), - prngBytes, - prngNumber, - ByteString.copyFrom("0x00", StandardCharsets.UTF_8), - List.of( - new PendingAirdropRecord(new PendingAirdropId(AccountId.fromString("0.0.123"), AccountId.fromString("0.0.124"), NftId.fromString("0.0.5005/1234")), 123), - new PendingAirdropRecord(new PendingAirdropId(AccountId.fromString("0.0.123"), AccountId.fromString("0.0.124"), TokenId.fromString("0.0.12345")), 123) - ) - ); + spawnReceiptExample(), + ByteString.copyFrom("hello", StandardCharsets.UTF_8), + time, + TransactionId.withValidStart(AccountId.fromString("3.3.3"), time), + "memo", + 3000L, + new ContractFunctionResult(com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + .setContractID(ContractId.fromString("1.2.3").toProtobuf()) + .setContractCallResult(ByteString.copyFrom(callResult)) + .setEvmAddress(BytesValue.newBuilder() + .setValue(ByteString.copyFrom(Hex.decode("98329e006610472e6B372C080833f6D79ED833cf"))) + .build()) + .setSenderId(AccountId.fromString("1.2.3").toProtobuf())), + List.of(new Transfer(AccountId.fromString("4.4.4"), Hbar.from(5))), + Map.of(TokenId.fromString("6.6.6"), Map.of(AccountId.fromString("1.1.1"), 4L)), + List.of(new TokenTransfer(TokenId.fromString("8.9.10"), AccountId.fromString("1.2.3"), 4L, 3, true)), + Map.of( + TokenId.fromString("4.4.4"), + List.of(new TokenNftTransfer( + TokenId.fromString("4.4.4"), + AccountId.fromString("1.2.3"), + AccountId.fromString("3.2.1"), + 4L, + true))), + ScheduleId.fromString("3.3.3"), + List.of(new AssessedCustomFee( + 4L, + TokenId.fromString("4.5.6"), + AccountId.fromString("8.6.5"), + List.of(AccountId.fromString("3.3.3")))), + List.of(new TokenAssociation(TokenId.fromString("5.4.3"), AccountId.fromString("8.7.6"))), + PrivateKey.fromStringECDSA("8776c6b831a1b61ac10dac0304a2843de4716f54b1919bb91a2685d0fe3f3048") + .getPublicKey(), + new ArrayList<>(), + new ArrayList<>(), + time, + ByteString.copyFrom("Some hash", StandardCharsets.UTF_8), + List.of(new Transfer(AccountId.fromString("1.2.3"), Hbar.from(8))), + prngBytes, + prngNumber, + ByteString.copyFrom("0x00", StandardCharsets.UTF_8), + List.of( + new PendingAirdropRecord( + new PendingAirdropId( + AccountId.fromString("0.0.123"), + AccountId.fromString("0.0.124"), + NftId.fromString("0.0.5005/1234")), + 123), + new PendingAirdropRecord( + new PendingAirdropId( + AccountId.fromString("0.0.123"), + AccountId.fromString("0.0.124"), + TokenId.fromString("0.0.12345")), + 123))); } @Test void shouldSerialize() throws Exception { - var originalRecord = spawnRecordExample( - ByteString.copyFrom("very random bytes", StandardCharsets.UTF_8), - null - ); + var originalRecord = spawnRecordExample(ByteString.copyFrom("very random bytes", StandardCharsets.UTF_8), null); byte[] recordBytes = originalRecord.toBytes(); var copyRecord = TransactionRecord.fromBytes(recordBytes); assertThat(copyRecord.toString()).isEqualTo(originalRecord.toString()); @@ -121,10 +102,7 @@ void shouldSerialize() throws Exception { @Test void shouldSerialize2() throws Exception { - var originalRecord = spawnRecordExample( - null, - 4 /* chosen by fair dice roll. Guaranteed to be random */ - ); + var originalRecord = spawnRecordExample(null, 4 /* chosen by fair dice roll. Guaranteed to be random */); byte[] recordBytes = originalRecord.toBytes(); var copyRecord = TransactionRecord.fromBytes(recordBytes); assertThat(copyRecord.toString()).isEqualTo(originalRecord.toString()); diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionTest.java b/sdk/src/test/java/com/hiero/sdk/TransactionTest.java index 8017977954..eba0361ce2 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionTest.java +++ b/sdk/src/test/java/com/hiero/sdk/TransactionTest.java @@ -1,58 +1,31 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk; +import static com.hiero.sdk.Transaction.fromBytes; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; import com.hiero.sdk.proto.SignedTransaction; import com.hiero.sdk.proto.TokenAssociateTransactionBody; import com.hiero.sdk.proto.TransactionBody; -import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.util.Arrays; import java.util.List; - -import static com.hiero.sdk.Transaction.fromBytes; -import static org.assertj.core.api.Assertions.assertThat; - +import org.bouncycastle.util.encoders.Hex; +import org.junit.jupiter.api.Test; public class TransactionTest { private static final PrivateKey unusedPrivateKey = PrivateKey.fromString( - "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); - private static final List testNodeAccountIds = Arrays.asList(AccountId.fromString("0.0.5005"), - AccountId.fromString("0.0.5006")); + "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e10"); + private static final List testNodeAccountIds = + Arrays.asList(AccountId.fromString("0.0.5005"), AccountId.fromString("0.0.5006")); private static final AccountId testAccountId = AccountId.fromString("0.0.5006"); private static final Instant validStart = Instant.ofEpochSecond(1554158542); @Test void transactionFromBytesWorksWithProtobufTransactionBytes() throws InvalidProtocolBufferException { var bytes = Hex.decode( - "1acc010a640a2046fe5013b6f6fc796c3e65ec10d2a10d03c07188fc3de13d46caad6b8ec4dfb81a4045f1186be5746c9783f68cb71d6a71becd3ffb024906b855ac1fa3a2601273d41b58446e5d6a0aaf421c229885f9e70417353fab2ce6e9d8e7b162e9944e19020a640a20f102e75ff7dc3d72c9b7075bb246fcc54e714c59714814011e8f4b922d2a6f0a1a40f2e5f061349ab03fa21075020c75cf876d80498ae4bac767f35941b8e3c393b0e0a886ede328e44c1df7028ea1474722f2dcd493812d04db339480909076a10122500a180a0c08a1cc98830610c092d09e0312080800100018e4881d120608001000180418b293072202087872240a220a0f0a080800100018e4881d10ff83af5f0a0f0a080800100018eb881d108084af5f"); + "1acc010a640a2046fe5013b6f6fc796c3e65ec10d2a10d03c07188fc3de13d46caad6b8ec4dfb81a4045f1186be5746c9783f68cb71d6a71becd3ffb024906b855ac1fa3a2601273d41b58446e5d6a0aaf421c229885f9e70417353fab2ce6e9d8e7b162e9944e19020a640a20f102e75ff7dc3d72c9b7075bb246fcc54e714c59714814011e8f4b922d2a6f0a1a40f2e5f061349ab03fa21075020c75cf876d80498ae4bac767f35941b8e3c393b0e0a886ede328e44c1df7028ea1474722f2dcd493812d04db339480909076a10122500a180a0c08a1cc98830610c092d09e0312080800100018e4881d120608001000180418b293072202087872240a220a0f0a080800100018e4881d10ff83af5f0a0f0a080800100018eb881d108084af5f"); var transaction = (TransferTransaction) fromBytes(bytes); @@ -62,9 +35,11 @@ void transactionFromBytesWorksWithProtobufTransactionBytes() throws InvalidProto @Test void tokenAssociateTransactionFromTransactionBodyBytes() throws InvalidProtocolBufferException { - var tokenAssociateTransactionBodyProto = TokenAssociateTransactionBody.newBuilder().build(); - var transactionBodyProto = TransactionBody.newBuilder().setTokenAssociate(tokenAssociateTransactionBodyProto) - .build(); + var tokenAssociateTransactionBodyProto = + TokenAssociateTransactionBody.newBuilder().build(); + var transactionBodyProto = TransactionBody.newBuilder() + .setTokenAssociate(tokenAssociateTransactionBodyProto) + .build(); TokenAssociateTransaction tokenAssociateTransaction = spawnTestTransaction(transactionBodyProto); @@ -75,12 +50,15 @@ void tokenAssociateTransactionFromTransactionBodyBytes() throws InvalidProtocolB @Test void tokenAssociateTransactionFromSignedTransactionBytes() throws InvalidProtocolBufferException { - var tokenAssociateTransactionBodyProto = TokenAssociateTransactionBody.newBuilder().build(); - var transactionBodyProto = TransactionBody.newBuilder().setTokenAssociate(tokenAssociateTransactionBodyProto) - .build(); - - var signedTransactionProto = SignedTransaction.newBuilder().setBodyBytes(transactionBodyProto.toByteString()) - .build(); + var tokenAssociateTransactionBodyProto = + TokenAssociateTransactionBody.newBuilder().build(); + var transactionBodyProto = TransactionBody.newBuilder() + .setTokenAssociate(tokenAssociateTransactionBodyProto) + .build(); + + var signedTransactionProto = SignedTransaction.newBuilder() + .setBodyBytes(transactionBodyProto.toByteString()) + .build(); var signedTransactionBodyProto = TransactionBody.parseFrom(signedTransactionProto.getBodyBytes()); TokenAssociateTransaction tokenAssociateTransaction = spawnTestTransaction(signedTransactionBodyProto); @@ -92,16 +70,20 @@ void tokenAssociateTransactionFromSignedTransactionBytes() throws InvalidProtoco @Test void tokenAssociateTransactionFromTransactionBytes() throws InvalidProtocolBufferException { - var tokenAssociateTransactionBodyProto = TokenAssociateTransactionBody.newBuilder().build(); - var transactionBodyProto = TransactionBody.newBuilder().setTokenAssociate(tokenAssociateTransactionBodyProto) - .build(); - - var signedTransactionProto = SignedTransaction.newBuilder().setBodyBytes(transactionBodyProto.toByteString()) - .build(); + var tokenAssociateTransactionBodyProto = + TokenAssociateTransactionBody.newBuilder().build(); + var transactionBodyProto = TransactionBody.newBuilder() + .setTokenAssociate(tokenAssociateTransactionBodyProto) + .build(); + + var signedTransactionProto = SignedTransaction.newBuilder() + .setBodyBytes(transactionBodyProto.toByteString()) + .build(); var signedTransactionBodyProto = TransactionBody.parseFrom(signedTransactionProto.getBodyBytes()); var transactionSignedProto = com.hiero.sdk.proto.Transaction.newBuilder() - .setSignedTransactionBytes(signedTransactionBodyProto.toByteString()).build(); + .setSignedTransactionBytes(signedTransactionBodyProto.toByteString()) + .build(); var transactionSignedBodyProto = TransactionBody.parseFrom(transactionSignedProto.getSignedTransactionBytes()); TokenAssociateTransaction tokenAssociateTransaction = spawnTestTransaction(transactionSignedBodyProto); @@ -112,9 +94,10 @@ void tokenAssociateTransactionFromTransactionBytes() throws InvalidProtocolBuffe } private TokenAssociateTransaction spawnTestTransaction(TransactionBody txBody) { - return new TokenAssociateTransaction( - txBody).setNodeAccountIds(testNodeAccountIds) - .setTransactionId(TransactionId.withValidStart(testAccountId, validStart)).freeze().sign(unusedPrivateKey); + return new TokenAssociateTransaction(txBody) + .setNodeAccountIds(testNodeAccountIds) + .setTransactionId(TransactionId.withValidStart(testAccountId, validStart)) + .freeze() + .sign(unusedPrivateKey); } - } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java index f5ef05622f..58b9f4f6e4 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.AccountAllowanceApproveTransaction; import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.AccountDeleteTransaction; @@ -26,13 +10,10 @@ import com.hiero.sdk.PrivateKey; import com.hiero.sdk.TransactionId; import com.hiero.sdk.TransferTransaction; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; - public class AccountAllowanceIntegrationTest { @Test @DisplayName("Can spend hbar allowance") @@ -41,38 +22,38 @@ void canSpendHbarAllowance() throws Throwable { var aliceKey = PrivateKey.generateED25519(); var aliceId = new AccountCreateTransaction() - .setKey(aliceKey) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(aliceKey) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var bobKey = PrivateKey.generateED25519(); var bobId = new AccountCreateTransaction() - .setKey(bobKey) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(bobKey) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; Objects.requireNonNull(aliceId); Objects.requireNonNull(bobId); new AccountAllowanceApproveTransaction() - .approveHbarAllowance(bobId, aliceId, new Hbar(10)) - .freezeWith(testEnv.client) - .sign(bobKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveHbarAllowance(bobId, aliceId, new Hbar(10)) + .freezeWith(testEnv.client) + .sign(bobKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); var transferRecord = new TransferTransaction() - .addHbarTransfer(testEnv.operatorId, new Hbar(5)) - .addApprovedHbarTransfer(bobId, new Hbar(5).negated()) - .setTransactionId(TransactionId.generate(aliceId)) - .freezeWith(testEnv.client) - .sign(aliceKey) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addHbarTransfer(testEnv.operatorId, new Hbar(5)) + .addApprovedHbarTransfer(bobId, new Hbar(5).negated()) + .setTransactionId(TransactionId.generate(aliceId)) + .freezeWith(testEnv.client) + .sign(aliceKey) + .execute(testEnv.client) + .getRecord(testEnv.client); var transferFound = false; for (var transfer : transferRecord.transfers) { @@ -84,13 +65,12 @@ void canSpendHbarAllowance() throws Throwable { assertThat(transferFound).isTrue(); new AccountDeleteTransaction() - .setAccountId(bobId) - .setTransferAccountId(testEnv.operatorId) - .freezeWith(testEnv.client) - .sign(bobKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(bobId) + .setTransferAccountId(testEnv.operatorId) + .freezeWith(testEnv.client) + .sign(bobKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java index 217e08c4ff..891d3ad9f0 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountBalanceQuery; import com.hiero.sdk.AccountId; import com.hiero.sdk.Client; @@ -26,22 +11,16 @@ import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.Status; import com.hiero.sdk.TokenCreateTransaction; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class AccountBalanceIntegrationTest { @Test @DisplayName("can connect to previewnwet with TLS") void canConnectToPreviewnetWithTLS() throws Exception { - var client = Client.forPreviewnet() - .setTransportSecurity(true); + var client = Client.forPreviewnet().setTransportSecurity(true); boolean succeededAtLeastOnce = false; @@ -50,10 +29,10 @@ void canConnectToPreviewnetWithTLS() throws Exception { try { new AccountBalanceQuery() - .setMaxAttempts(1) - .setNodeAccountIds(Collections.singletonList(entry.getValue())) - .setAccountId(entry.getValue()) - .execute(client); + .setMaxAttempts(1) + .setNodeAccountIds(Collections.singletonList(entry.getValue())) + .setAccountId(entry.getValue()) + .execute(client); System.out.println("succeeded for " + entry); succeededAtLeastOnce = true; } catch (Throwable error) { @@ -68,8 +47,7 @@ void canConnectToPreviewnetWithTLS() throws Exception { @Test @DisplayName("can connect to testnet with TLS") void canConnectToTestnetWithTLS() throws Exception { - var client = Client.forTestnet() - .setTransportSecurity(true); + var client = Client.forTestnet().setTransportSecurity(true); boolean succeededAtLeastOnce = false; @@ -78,10 +56,10 @@ void canConnectToTestnetWithTLS() throws Exception { try { new AccountBalanceQuery() - .setMaxAttempts(1) - .setNodeAccountIds(Collections.singletonList(entry.getValue())) - .setAccountId(entry.getValue()) - .execute(client); + .setMaxAttempts(1) + .setNodeAccountIds(Collections.singletonList(entry.getValue())) + .setAccountId(entry.getValue()) + .execute(client); System.out.println("succeeded for " + entry); succeededAtLeastOnce = true; } catch (Throwable error) { @@ -96,8 +74,7 @@ void canConnectToTestnetWithTLS() throws Exception { @Test @DisplayName("can connect to mainnet with TLS") void canConnectToMainnetWithTLS() throws Exception { - var client = Client.forMainnet() - .setTransportSecurity(true); + var client = Client.forMainnet().setTransportSecurity(true); boolean succeededAtLeastOnce = false; @@ -106,10 +83,10 @@ void canConnectToMainnetWithTLS() throws Exception { try { new AccountBalanceQuery() - .setMaxAttempts(1) - .setNodeAccountIds(Collections.singletonList(entry.getValue())) - .setAccountId(entry.getValue()) - .execute(client); + .setMaxAttempts(1) + .setNodeAccountIds(Collections.singletonList(entry.getValue())) + .setAccountId(entry.getValue()) + .execute(client); System.out.println("succeeded for " + entry); succeededAtLeastOnce = true; } catch (Throwable error) { @@ -126,9 +103,9 @@ void canConnectToMainnetWithTLS() throws Exception { @DisplayName("can connect to previewnet with certificate verification off") void cannotConnectToPreviewnetWhenNetworkNameIsNullAndCertificateVerificationIsEnabled() throws Exception { var client = Client.forPreviewnet() - .setTransportSecurity(true) - .setVerifyCertificates(true) - .setNetworkName(null); + .setTransportSecurity(true) + .setVerifyCertificates(true) + .setNetworkName(null); assertThat(client.getNetwork().isEmpty()).isFalse(); @@ -137,9 +114,9 @@ void cannotConnectToPreviewnetWhenNetworkNameIsNullAndCertificateVerificationIsE assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> { new AccountBalanceQuery() - .setNodeAccountIds(Collections.singletonList(entry.getValue())) - .setAccountId(entry.getValue()) - .execute(client); + .setNodeAccountIds(Collections.singletonList(entry.getValue())) + .setAccountId(entry.getValue()) + .execute(client); }); } @@ -151,12 +128,10 @@ void cannotConnectToPreviewnetWhenNetworkNameIsNullAndCertificateVerificationIsE void canFetchBalanceForClientOperator() throws Exception { try (IntegrationTestEnv testEnv = new IntegrationTestEnv(1)) { - var balance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var balance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(balance.hbars.toTinybars() > 0).isTrue(); - } } @@ -165,9 +140,8 @@ void canFetchBalanceForClientOperator() throws Exception { void getCostBalanceForClientOperator() throws Exception { try (IntegrationTestEnv testEnv = new IntegrationTestEnv(1)) { - var balance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(new Hbar(1)); + var balance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).setMaxQueryPayment(new Hbar(1)); var cost = balance.getCost(testEnv.client); @@ -175,7 +149,6 @@ void getCostBalanceForClientOperator() throws Exception { assertThat(accBalance.hbars.toTinybars() > 0).isTrue(); assertThat(cost.toTinybars()).isEqualTo(0); - } } @@ -184,16 +157,14 @@ void getCostBalanceForClientOperator() throws Exception { void getCostBigMaxBalanceForClientOperator() throws Exception { try (IntegrationTestEnv testEnv = new IntegrationTestEnv(1)) { - var balance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(new Hbar(1000000)); + var balance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).setMaxQueryPayment(new Hbar(1000000)); var cost = balance.getCost(testEnv.client); var accBalance = balance.setQueryPayment(cost).execute(testEnv.client); assertThat(accBalance.hbars.toTinybars() > 0).isTrue(); - } } @@ -202,16 +173,14 @@ void getCostBigMaxBalanceForClientOperator() throws Exception { void getCostSmallMaxBalanceForClientOperator() throws Exception { try (IntegrationTestEnv testEnv = new IntegrationTestEnv(1)) { - var balance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var balance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).setMaxQueryPayment(Hbar.fromTinybars(1)); var cost = balance.getCost(testEnv.client); var accBalance = balance.setQueryPayment(cost).execute(testEnv.client); assertThat(accBalance.hbars.toTinybars() > 0).isTrue(); - } } @@ -220,43 +189,41 @@ void getCostSmallMaxBalanceForClientOperator() throws Exception { void canNotFetchBalanceForInvalidAccountId() throws Exception { try (IntegrationTestEnv testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new AccountBalanceQuery() - .setAccountId(AccountId.fromString("1.0.3")) - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new AccountBalanceQuery() + .setAccountId(AccountId.fromString("1.0.3")) + .execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Can fetch token balances for client operator") void canFetchTokenBalancesForClientOperator() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setInitialSupply(10000) - .setDecimals(50) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setInitialSupply(10000) + .setDecimals(50) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); var query = new AccountBalanceQuery(); - var balance = query - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var balance = query.setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(balance.tokens.get(tokenId)).isEqualTo(10000); assertThat(balance.tokenDecimals.get(tokenId)).isEqualTo(50); assertThat(query.toString()).isNotEmpty(); assertThat(query.getPaymentTransactionId()).isNull(); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java index de453898cb..c30966667c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java @@ -1,53 +1,32 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.*; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import java.time.Duration; import java.time.Instant; - import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class AccountCreateIntegrationTest { @Test @DisplayName("Can create account with only initial balance and key") void canCreateAccountWithOnlyInitialBalanceAndKey() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(accountId); assertThat(info.isDeleted).isFalse(); @@ -56,26 +35,21 @@ void canCreateAccountWithOnlyInitialBalanceAndKey() throws Exception { assertThat(info.autoRenewPeriod).isEqualTo(Duration.ofDays(90)); assertThat(info.proxyAccountId).isNull(); assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); - } } @Test @DisplayName("Can create account with no initial balance") void canCreateAccountWithNoInitialBalance() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(accountId); assertThat(info.isDeleted).isFalse(); @@ -84,7 +58,6 @@ void canCreateAccountWithNoInitialBalance() throws Exception { assertThat(info.autoRenewPeriod).isEqualTo(Duration.ofDays(90)); assertThat(info.proxyAccountId).isNull(); assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); - } } @@ -93,57 +66,54 @@ void canCreateAccountWithNoInitialBalance() throws Exception { void canNotCreateAccountWithNoKey() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> new AccountCreateTransaction() - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.KEY_REQUIRED.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> new AccountCreateTransaction() + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.KEY_REQUIRED.toString()); } } @Test @DisplayName("Can create account using aliasKey") void canCreateWithAliasKey() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var aliasId = key.toAccountId(0, 0); new TransferTransaction() - .addHbarTransfer(testEnv.operatorId, new Hbar(10).negated()) - .addHbarTransfer(aliasId, new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addHbarTransfer(testEnv.operatorId, new Hbar(10).negated()) + .addHbarTransfer(aliasId, new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var info = new AccountInfoQuery() - .setAccountId(aliasId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(aliasId).execute(testEnv.client); assertThat(key.getPublicKey()).isEqualTo(info.aliasKey); - } } @Test @DisplayName("Regenerates TransactionIds in response to expiration") void managesExpiration() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setTransactionId(new TransactionId(testEnv.operatorId, Instant.now().minusSeconds(40))) - .setTransactionValidDuration(Duration.ofSeconds(30)) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(key) + .setTransactionId( + new TransactionId(testEnv.operatorId, Instant.now().minusSeconds(40))) + .setTransactionValidDuration(Duration.ofSeconds(30)) + .freezeWith(testEnv.client) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(accountId); assertThat(info.isDeleted).isFalse(); @@ -152,7 +122,6 @@ void managesExpiration() throws Exception { assertThat(info.autoRenewPeriod).isEqualTo(Duration.ofDays(90)); assertThat(info.proxyAccountId).isNull(); assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); - } } @@ -168,28 +137,25 @@ void createAccountWithAliasFromAdminKey() throws Exception { // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); var accountId = new AccountCreateTransaction() - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; assertThat(accountId).isNotNull(); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isNotNull(); assertThat(info.contractAccountId).hasToString(evmAddress.toString()); assertThat(info.key).isEqualTo(adminKey.getPublicKey()); - } } @@ -205,29 +171,27 @@ void createAccountWithAliasFromAdminKeyWithReceiverSigRequired() throws Exceptio // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); var accountId = new AccountCreateTransaction() - .setReceiverSignatureRequired(true) - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client).accountId; + .setReceiverSignatureRequired(true) + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; assertThat(accountId).isNotNull(); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isNotNull(); assertThat(info.contractAccountId).hasToString(evmAddress.toString()); assertThat(info.key).isEqualTo(adminKey.getPublicKey()); - } } @@ -241,18 +205,19 @@ void cannotCreateAccountWithAliasFromAdminKeyWithReceiverSigRequiredAndNoSignatu // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> new AccountCreateTransaction() - .setReceiverSignatureRequired(true) - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> new AccountCreateTransaction() + .setReceiverSignatureRequired(true) + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -267,31 +232,29 @@ void createAccountWithAlias() throws Exception { // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); var key = PrivateKey.generateECDSA(); var evmAddress = key.getPublicKey().toEvmAddress(); var accountId = new AccountCreateTransaction() - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client).accountId; + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; assertThat(accountId).isNotNull(); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isNotNull(); assertThat(info.contractAccountId).hasToString(evmAddress.toString()); assertThat(info.key).isEqualTo(adminKey.getPublicKey()); - } } @@ -304,21 +267,22 @@ void cannotCreateAccountWithAliasWithoutSignature() throws Exception { // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); var key = PrivateKey.generateECDSA(); var evmAddress = key.getPublicKey().toEvmAddress(); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> new AccountCreateTransaction() - .setReceiverSignatureRequired(true) - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> new AccountCreateTransaction() + .setReceiverSignatureRequired(true) + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -333,38 +297,37 @@ void createAccountWithAliasWithReceiverSigRequired() throws Exception { // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); var key = PrivateKey.generateECDSA(); var evmAddress = key.getPublicKey().toEvmAddress(); var accountId = new AccountCreateTransaction() - .setReceiverSignatureRequired(true) - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .sign(key) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client).accountId; + .setReceiverSignatureRequired(true) + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .sign(key) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; assertThat(accountId).isNotNull(); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isNotNull(); assertThat(info.contractAccountId).hasToString(evmAddress.toString()); assertThat(info.key).isEqualTo(adminKey.getPublicKey()); - } } @Test - @DisplayName("Cannot create account with alias different from admin key and receiver sig required without signature") + @DisplayName( + "Cannot create account with alias different from admin key and receiver sig required without signature") void cannotCreateAccountWithAliasWithReceiverSigRequiredWithoutSignature() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -372,22 +335,23 @@ void cannotCreateAccountWithAliasWithReceiverSigRequiredWithoutSignature() throw // Create the admin account new AccountCreateTransaction() - .setKey(adminKey) - .freezeWith(testEnv.client) - .execute(testEnv.client); + .setKey(adminKey) + .freezeWith(testEnv.client) + .execute(testEnv.client); var key = PrivateKey.generateECDSA(); var evmAddress = key.getPublicKey().toEvmAddress(); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> new AccountCreateTransaction() - .setReceiverSignatureRequired(true) - .setKey(adminKey) - .setAlias(evmAddress) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> new AccountCreateTransaction() + .setReceiverSignatureRequired(true) + .setKey(adminKey) + .setAlias(evmAddress) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java index 5b78f07fad..72bb40a1d9 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.AccountDeleteTransaction; import com.hiero.sdk.AccountInfoQuery; @@ -27,33 +12,27 @@ import com.hiero.sdk.PrivateKey; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import java.time.Duration; - import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class AccountDeleteIntegrationTest { @Test @DisplayName("Can delete account") void canDeleteAccount() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(accountId); assertThat(info.isDeleted).isFalse(); @@ -62,7 +41,6 @@ void canDeleteAccount() throws Exception { assertThat(info.autoRenewPeriod).isEqualTo(Duration.ofDays(90)); assertThat(info.proxyAccountId).isNull(); assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); - } } @@ -71,38 +49,40 @@ void canDeleteAccount() throws Exception { void cannotCreateAccountWithNoKey() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new AccountDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.ACCOUNT_ID_DOES_NOT_EXIST.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new AccountDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.ACCOUNT_ID_DOES_NOT_EXIST.toString()); } } @Test @DisplayName("Cannot delete account that has not signed transaction") void cannotDeleteAccountThatHasNotSignedTransaction() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new AccountDeleteTransaction() - .setAccountId(accountId) - .setTransferAccountId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new AccountDeleteTransaction() + .setAccountId(accountId) + .setTransferAccountId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java index 41659613b9..3c695384b7 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -33,7 +15,7 @@ class AccountIdPopulationIntegrationTest { @Test @DisplayName("Can populate AccountId num from mirror node (using sync method)") void canPopulateAccountIdNumSync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var privateKey = PrivateKey.generateECDSA(); var publicKey = privateKey.getPublicKey(); @@ -41,11 +23,15 @@ void canPopulateAccountIdNumSync() throws Exception { var evmAddress = publicKey.toEvmAddress(); var evmAddressAccount = AccountId.fromEvmAddress(evmAddress); - var tx = new TransferTransaction().addHbarTransfer(evmAddressAccount, new Hbar(1)) - .addHbarTransfer(testEnv.operatorId, new Hbar(-1)).execute(testEnv.client); + var tx = new TransferTransaction() + .addHbarTransfer(evmAddressAccount, new Hbar(1)) + .addHbarTransfer(testEnv.operatorId, new Hbar(-1)) + .execute(testEnv.client); - var receipt = new TransactionReceiptQuery().setTransactionId(tx.transactionId).setIncludeChildren(true) - .execute(testEnv.client); + var receipt = new TransactionReceiptQuery() + .setTransactionId(tx.transactionId) + .setIncludeChildren(true) + .execute(testEnv.client); var newAccountId = receipt.children.get(0).accountId; @@ -60,7 +46,7 @@ void canPopulateAccountIdNumSync() throws Exception { @Test @DisplayName("Can populate AccountId num from mirror node (using async method)") void canPopulateAccountIdNumAsync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var privateKey = PrivateKey.generateECDSA(); var publicKey = privateKey.getPublicKey(); @@ -68,11 +54,15 @@ void canPopulateAccountIdNumAsync() throws Exception { var evmAddress = publicKey.toEvmAddress(); var evmAddressAccount = AccountId.fromEvmAddress(evmAddress); - var tx = new TransferTransaction().addHbarTransfer(evmAddressAccount, new Hbar(1)) - .addHbarTransfer(testEnv.operatorId, new Hbar(-1)).execute(testEnv.client); + var tx = new TransferTransaction() + .addHbarTransfer(evmAddressAccount, new Hbar(1)) + .addHbarTransfer(testEnv.operatorId, new Hbar(-1)) + .execute(testEnv.client); - var receipt = new TransactionReceiptQuery().setTransactionId(tx.transactionId).setIncludeChildren(true) - .execute(testEnv.client); + var receipt = new TransactionReceiptQuery() + .setTransactionId(tx.transactionId) + .setIncludeChildren(true) + .execute(testEnv.client); var newAccountId = receipt.children.get(0).accountId; @@ -81,14 +71,13 @@ void canPopulateAccountIdNumAsync() throws Exception { var accountId = idMirror.populateAccountNumAsync(testEnv.client).get(); assertThat(newAccountId.num).isEqualTo(accountId.num); - - } + } } @Test @DisplayName("Can populate AccountId evm address from mirror node (using sync method)") void canPopulateAccountIdEvmAddressSync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var privateKey = PrivateKey.generateECDSA(); var publicKey = privateKey.getPublicKey(); @@ -96,11 +85,15 @@ void canPopulateAccountIdEvmAddressSync() throws Exception { var evmAddress = publicKey.toEvmAddress(); var evmAddressAccount = AccountId.fromEvmAddress(evmAddress); - var tx = new TransferTransaction().addHbarTransfer(evmAddressAccount, new Hbar(1)) - .addHbarTransfer(testEnv.operatorId, new Hbar(-1)).execute(testEnv.client); + var tx = new TransferTransaction() + .addHbarTransfer(evmAddressAccount, new Hbar(1)) + .addHbarTransfer(testEnv.operatorId, new Hbar(-1)) + .execute(testEnv.client); - var receipt = new TransactionReceiptQuery().setTransactionId(tx.transactionId).setIncludeChildren(true) - .execute(testEnv.client); + var receipt = new TransactionReceiptQuery() + .setTransactionId(tx.transactionId) + .setIncludeChildren(true) + .execute(testEnv.client); var newAccountId = receipt.children.get(0).accountId; @@ -114,7 +107,7 @@ void canPopulateAccountIdEvmAddressSync() throws Exception { @Test @DisplayName("Can populate AccountId evm address from mirror node (using async method)") void canPopulateAccountIdEvmAddressAsync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var privateKey = PrivateKey.generateECDSA(); var publicKey = privateKey.getPublicKey(); @@ -122,19 +115,23 @@ void canPopulateAccountIdEvmAddressAsync() throws Exception { var evmAddress = publicKey.toEvmAddress(); var evmAddressAccount = AccountId.fromEvmAddress(evmAddress); - var tx = new TransferTransaction().addHbarTransfer(evmAddressAccount, new Hbar(1)) - .addHbarTransfer(testEnv.operatorId, new Hbar(-1)).execute(testEnv.client); + var tx = new TransferTransaction() + .addHbarTransfer(evmAddressAccount, new Hbar(1)) + .addHbarTransfer(testEnv.operatorId, new Hbar(-1)) + .execute(testEnv.client); - var receipt = new TransactionReceiptQuery().setTransactionId(tx.transactionId).setIncludeChildren(true) - .execute(testEnv.client); + var receipt = new TransactionReceiptQuery() + .setTransactionId(tx.transactionId) + .setIncludeChildren(true) + .execute(testEnv.client); var newAccountId = receipt.children.get(0).accountId; Thread.sleep(5000); - var accountId = newAccountId.populateAccountEvmAddressAsync(testEnv.client).get(); + var accountId = + newAccountId.populateAccountEvmAddressAsync(testEnv.client).get(); assertThat(evmAddressAccount.evmAddress).isEqualTo(accountId.evmAddress); } } - } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java index e08cbe0371..82f79c30b7 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java @@ -1,49 +1,27 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.AccountInfoFlow; import com.hiero.sdk.AccountInfoQuery; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; import com.hiero.sdk.Transaction; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.as; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class AccountInfoIntegrationTest { @Test @DisplayName("Can query account info for client operator") void canQueryAccountInfoForClientOperator() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var info = new AccountInfoQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(testEnv.operatorId); assertThat(info.isDeleted).isFalse(); @@ -51,7 +29,6 @@ void canQueryAccountInfoForClientOperator() throws Exception { assertThat(info.balance.toTinybars()).isGreaterThan(0); assertThat(info.proxyAccountId).isNull(); assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); - } } @@ -60,16 +37,13 @@ void canQueryAccountInfoForClientOperator() throws Exception { void getCostAccountInfoForClientOperator() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var info = new AccountInfoQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(new Hbar(1)); + var info = new AccountInfoQuery().setAccountId(testEnv.operatorId).setMaxQueryPayment(new Hbar(1)); var cost = info.getCost(testEnv.client); var accInfo = info.setQueryPayment(cost).execute(testEnv.client); assertThat(accInfo.accountId).isEqualTo(testEnv.operatorId); - } } @@ -78,16 +52,13 @@ void getCostAccountInfoForClientOperator() throws Exception { void getCostBigMaxAccountInfoForClientOperator() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var info = new AccountInfoQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(Hbar.MAX); + var info = new AccountInfoQuery().setAccountId(testEnv.operatorId).setMaxQueryPayment(Hbar.MAX); var cost = info.getCost(testEnv.client); var accInfo = info.setQueryPayment(cost).execute(testEnv.client); assertThat(accInfo.accountId).isEqualTo(testEnv.operatorId); - } } @@ -97,16 +68,17 @@ void getCostBigMaxAccountInfoForClientOperator() throws Exception { void getCostSmallMaxAccountInfoForClientOperator() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var info = new AccountInfoQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var info = new AccountInfoQuery().setAccountId(testEnv.operatorId).setMaxQueryPayment(Hbar.fromTinybars(1)); var cost = info.getCost(testEnv.client); - assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> { - info.execute(testEnv.client); - }).withMessage("com.hiero.sdk.MaxQueryPaymentExceededException: cost for AccountInfoQuery, of " + cost.toString() + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); - + assertThatExceptionOfType(RuntimeException.class) + .isThrownBy(() -> { + info.execute(testEnv.client); + }) + .withMessage("com.hiero.sdk.MaxQueryPaymentExceededException: cost for AccountInfoQuery, of " + + cost.toString() + + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); } } @@ -116,13 +88,14 @@ void getCostInsufficientTxFeeAccountInfoForClientOperator() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var info = new AccountInfoQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(Hbar.fromTinybars(10000)); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - info.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); - + .setAccountId(testEnv.operatorId) + .setMaxQueryPayment(Hbar.fromTinybars(10000)); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + info.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); } } @@ -135,19 +108,20 @@ void accountInfoFlowVerifyFunctions() throws Throwable { var newPublicKey = newKey.getPublicKey(); Transaction signedTx = new AccountCreateTransaction() - .setKey(newPublicKey) - .setInitialBalance(Hbar.fromTinybars(1000)) - .freezeWith(testEnv.client) - .signWithOperator(testEnv.client); + .setKey(newPublicKey) + .setInitialBalance(Hbar.fromTinybars(1000)) + .freezeWith(testEnv.client) + .signWithOperator(testEnv.client); Transaction unsignedTx = new AccountCreateTransaction() - .setKey(newPublicKey) - .setInitialBalance(Hbar.fromTinybars(1000)) - .freezeWith(testEnv.client); - - assertThat(AccountInfoFlow.verifyTransactionSignature(testEnv.client, testEnv.operatorId, signedTx)).isTrue(); - assertThat(AccountInfoFlow.verifyTransactionSignature(testEnv.client, testEnv.operatorId, unsignedTx)).isFalse(); - + .setKey(newPublicKey) + .setInitialBalance(Hbar.fromTinybars(1000)) + .freezeWith(testEnv.client); + + assertThat(AccountInfoFlow.verifyTransactionSignature(testEnv.client, testEnv.operatorId, signedTx)) + .isTrue(); + assertThat(AccountInfoFlow.verifyTransactionSignature(testEnv.client, testEnv.operatorId, unsignedTx)) + .isFalse(); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java index 0839343abe..e751d0dfed 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java @@ -1,70 +1,49 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.AccountRecordsQuery; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrivateKey; import com.hiero.sdk.TransferTransaction; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; - class AccountRecordsIntegrationTest { @Test @DisplayName("Can query account records") void canQueryAccountRecords() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); new TransferTransaction() - .addHbarTransfer(testEnv.operatorId, new Hbar(1).negated()) - .addHbarTransfer(accountId, new Hbar(1)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addHbarTransfer(testEnv.operatorId, new Hbar(1).negated()) + .addHbarTransfer(accountId, new Hbar(1)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addHbarTransfer(testEnv.operatorId, new Hbar(1)) - .addHbarTransfer(accountId, new Hbar(1).negated()) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addHbarTransfer(testEnv.operatorId, new Hbar(1)) + .addHbarTransfer(accountId, new Hbar(1).negated()) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var records = new AccountRecordsQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var records = + new AccountRecordsQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(records.isEmpty()).isFalse(); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java index 0e40d97851..80315e6d2c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountStakersQuery; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -26,21 +10,20 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class AccountStakersIntegrationTest { @Test @DisplayName("Cannot query account stakers since it is not supported") void cannotQueryAccountStakersSinceItIsNotSupported() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new AccountStakersQuery() - .setAccountId(testEnv.operatorId) - .setMaxQueryPayment(new Hbar(1)) - .execute(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new AccountStakersQuery() + .setAccountId(testEnv.operatorId) + .setMaxQueryPayment(new Hbar(1)) + .execute(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java index 48208ee225..a1cfe8f14a 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.AccountInfoQuery; import com.hiero.sdk.AccountUpdateTransaction; @@ -26,33 +11,25 @@ import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.PrivateKey; import com.hiero.sdk.Status; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import java.time.Duration; - import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class AccountUpdateIntegrationTest { @Test @DisplayName("Can update account with a new key") void canUpdateAccountWithNewKey() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key1 = PrivateKey.generateED25519(); var key2 = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key1) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key1).execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(accountId); assertThat(info.isDeleted).isFalse(); @@ -63,17 +40,15 @@ void canUpdateAccountWithNewKey() throws Exception { assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); new AccountUpdateTransaction() - .setAccountId(accountId) - .setKey(key2.getPublicKey()) - .freezeWith(testEnv.client) - .sign(key1) - .sign(key2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setKey(key2.getPublicKey()) + .freezeWith(testEnv.client) + .sign(key1) + .sign(key2) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); + info = new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); assertThat(info.accountId).isEqualTo(accountId); assertThat(info.isDeleted).isFalse(); @@ -82,7 +57,6 @@ void canUpdateAccountWithNewKey() throws Exception { assertThat(info.autoRenewPeriod).isEqualTo(Duration.ofDays(90)); assertThat(info.proxyAccountId).isNull(); assertThat(info.proxyReceived).isEqualTo(Hbar.ZERO); - } } @@ -91,12 +65,11 @@ void canUpdateAccountWithNewKey() throws Exception { void cannotUpdateAccountWhenAccountIdIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new AccountUpdateTransaction() - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.ACCOUNT_ID_DOES_NOT_EXIST.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new AccountUpdateTransaction().execute(testEnv.client).getReceipt(testEnv.client); + }) + .withMessageContaining(Status.ACCOUNT_ID_DOES_NOT_EXIST.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java index 063aa78980..6705d3f898 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java @@ -1,68 +1,48 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.*; -import java.util.Collections; -import java.util.List; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import java.time.Duration; - import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; public class ClientIntegrationTest { @Test @DisplayName("fails when all the manually set nodes are not matching the address book") void failsWhenNoNodesAreMatching() throws Exception { - var client = Client.forTestnet() - .setTransportSecurity(true); + var client = Client.forTestnet().setTransportSecurity(true); var nodes = new ArrayList(); nodes.add(new AccountId(1000)); nodes.add(new AccountId(1001)); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> new AccountBalanceQuery() - .setNodeAccountIds(nodes) - .setAccountId(new AccountId(7)) - .execute(client)).withMessageContaining("All node account IDs did not map to valid nodes in the client's network"); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> new AccountBalanceQuery() + .setNodeAccountIds(nodes) + .setAccountId(new AccountId(7)) + .execute(client)) + .withMessageContaining("All node account IDs did not map to valid nodes in the client's network"); client.close(); } @Test @DisplayName("can skip invalid nodes") void canSkipNodes() throws Exception { - var client = Client.forTestnet() - .setTransportSecurity(true); + var client = Client.forTestnet().setTransportSecurity(true); var nodes = new ArrayList<>(client.getNetwork().values().stream().toList()); nodes.add(new AccountId(1000)); new AccountBalanceQuery() - .setNodeAccountIds(nodes) - .setAccountId(new AccountId(7)) - .execute(client); + .setNodeAccountIds(nodes) + .setAccountId(new AccountId(7)) + .execute(client); client.close(); } @@ -77,20 +57,16 @@ void testReplaceNodes() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { testEnv.client - .setMaxQueryPayment(new Hbar(2)) - .setRequestTimeout(Duration.ofMinutes(2)) - .setNetwork(network); + .setMaxQueryPayment(new Hbar(2)) + .setRequestTimeout(Duration.ofMinutes(2)) + .setNetwork(network); assertThat(testEnv.operatorId).isNotNull(); // Execute two simple queries so we create a channel for each network node. - new AccountBalanceQuery() - .setAccountId(new AccountId(3)) - .execute(testEnv.client); + new AccountBalanceQuery().setAccountId(new AccountId(3)).execute(testEnv.client); - new AccountBalanceQuery() - .setAccountId(new AccountId(3)) - .execute(testEnv.client); + new AccountBalanceQuery().setAccountId(new AccountId(3)).execute(testEnv.client); network = new HashMap<>(); network.put("1.testnet.hedera.com:50211", new AccountId(4)); @@ -103,7 +79,6 @@ void testReplaceNodes() throws Exception { network.put("35.192.2.25:50211", new AccountId(5)); testEnv.client.setNetwork(network); - } } @@ -114,8 +89,8 @@ void transactionIdNetworkIsVerified() { client.setAutoValidateChecksums(true); new AccountCreateTransaction() - .setTransactionId(TransactionId.generate(AccountId.fromString("0.0.123-esxsf"))) - .execute(client); + .setTransactionId(TransactionId.generate(AccountId.fromString("0.0.123-esxsf"))) + .execute(client); client.close(); }); } @@ -128,12 +103,11 @@ void testMaxNodesPerTransaction() throws Exception { testEnv.client.setMaxNodesPerTransaction(1); var transaction = new AccountDeleteTransaction() - .setAccountId(testEnv.operatorId) - .freezeWith(testEnv.client); + .setAccountId(testEnv.operatorId) + .freezeWith(testEnv.client); assertThat(transaction.getNodeAccountIds()).isNotNull(); assertThat(transaction.getNodeAccountIds().size()).isEqualTo(1); - } } @@ -166,10 +140,7 @@ void pingAll() throws Exception { var node = nodes.get(0); - new AccountBalanceQuery() - .setAccountId(node) - .execute(testEnv.client); - + new AccountBalanceQuery().setAccountId(node).execute(testEnv.client); } } @@ -196,22 +167,21 @@ void pingAllBadNetwork() throws Exception { testEnv.client.setNetwork(network); - assertThatExceptionOfType(MaxAttemptsExceededException.class).isThrownBy(() -> { - testEnv.client.pingAll(); - }).withMessageContaining("exceeded maximum attempts"); + assertThatExceptionOfType(MaxAttemptsExceededException.class) + .isThrownBy(() -> { + testEnv.client.pingAll(); + }) + .withMessageContaining("exceeded maximum attempts"); var nodes = new ArrayList<>(testEnv.client.getNetwork().values()); assertThat(nodes.isEmpty()).isFalse(); var node = nodes.get(0); - new AccountBalanceQuery() - .setAccountId(node) - .execute(testEnv.client); + new AccountBalanceQuery().setAccountId(node).execute(testEnv.client); assertThat(testEnv.client.getNetwork().values().size()).isEqualTo(1); } - } @Test @@ -243,10 +213,7 @@ void pingAllAsync() throws Exception { var node = nodes.get(0); - new AccountBalanceQuery() - .setAccountId(node) - .execute(testEnv.client); - + new AccountBalanceQuery().setAccountId(node).execute(testEnv.client); } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java index 14bf407a3d..f0221ff413 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java @@ -1,71 +1,53 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; public class Contents { - private Contents() { - } + private Contents() {} - public static final String BIG_CONTENTS = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\n" + - "\n" + - "Suspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\n" + - "\n" + - "Nunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\n" + - "\n" + - "Integer pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\n" + - "\n" + - "Pellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\n" + - "\n" + - "Cras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\n" + - "\n" + - "Ut interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\n" + - "\n" + - "Aenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\n" + - "\n" + - "Pellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\n" + - "\n" + - "In hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\n" + - "\n" + - "Vivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\n" + - "\n" + - "Donec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\n" + - "\n" + - "Fusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\n" + - "\n" + - "Nunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\n" + - "\n" + - "Duis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\n" + - "\n" + - "Mauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\n" + - "\n" + - "Aenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\n" + - "\n" + - "Nunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\n" + - "\n" + - "Mauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\n" + - "\n" + - "Proin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\n" + - "\n" + - "Suspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\n" + - "\n" + - "In consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\n" + - "\n" + - "Etiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\n"; + public static final String BIG_CONTENTS = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\n" + + "\n" + + "Suspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\n" + + "\n" + + "Nunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\n" + + "\n" + + "Integer pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\n" + + "\n" + + "Pellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\n" + + "\n" + + "Cras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\n" + + "\n" + + "Ut interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\n" + + "\n" + + "Aenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\n" + + "\n" + + "Pellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\n" + + "\n" + + "In hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\n" + + "\n" + + "Vivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\n" + + "\n" + + "Donec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\n" + + "\n" + + "Fusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\n" + + "\n" + + "Nunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\n" + + "\n" + + "Duis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\n" + + "\n" + + "Mauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\n" + + "\n" + + "Aenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\n" + + "\n" + + "Nunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\n" + + "\n" + + "Mauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\n" + + "\n" + + "Proin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\n" + + "\n" + + "Suspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\n" + + "\n" + + "In consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\n" + + "\n" + + "Etiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\n"; } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java index 74ec3ec4ff..b61363ee89 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ContractByteCodeQuery; import com.hiero.sdk.ContractCreateTransaction; import com.hiero.sdk.ContractDeleteTransaction; @@ -29,203 +14,193 @@ import com.hiero.sdk.MaxQueryPaymentExceededException; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class ContractBytecodeIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; - - @Test - @DisplayName("Can query contract bytecode") - void canQueryContractBytecode() throws Exception { - try (var testEnv = new IntegrationTestEnv(1)) { - - var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); - - var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - - response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); - - var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - - var bytecode = new ContractByteCodeQuery() - .setContractId(contractId) - .execute(testEnv.client); - - assertThat(bytecode.size()).isEqualTo(798); - - new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - } - } - - @Test - @DisplayName("Can get cost, even with a big max") - void getCostBigMaxQueryContractBytecode() throws Exception { - try (var testEnv = new IntegrationTestEnv(1)) { - - var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); - - var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - - response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); - - var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - - var bytecodeQuery = new ContractByteCodeQuery() - .setContractId(contractId) - .setMaxQueryPayment(new Hbar(1000)); - - var cost = bytecodeQuery.getCost(testEnv.client); - - var bytecode = bytecodeQuery.setQueryPayment(cost).execute(testEnv.client); - - assertThat(bytecode.size()).isEqualTo(798); - - new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - } - } - - @Test - @DisplayName("Error, max is smaller than set payment.") - void getCostSmallMaxQueryContractBytecode() throws Exception { - try (var testEnv = new IntegrationTestEnv(1)) { - - var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); - - var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - - response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); - - var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - - var bytecodeQuery = new ContractByteCodeQuery() - .setContractId(contractId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); - - assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { - bytecodeQuery.execute(testEnv.client); - }); - - new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - } - } - - @Test - @DisplayName("Insufficient tx fee error.") - void getCostInsufficientTxFeeQueryContractBytecode() throws Exception { - try (var testEnv = new IntegrationTestEnv(1)) { - - var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); - - var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - - response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); - - var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - - var bytecodeQuery = new ContractByteCodeQuery() - .setContractId(contractId) - .setMaxQueryPayment(new Hbar(100)); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - bytecodeQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + + @Test + @DisplayName("Can query contract bytecode") + void canQueryContractBytecode() throws Exception { + try (var testEnv = new IntegrationTestEnv(1)) { + + var response = new FileCreateTransaction() + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); + + var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - } - } - - @Test - @DisplayName("Cannot query contract bytecode when contract ID is not set") - void cannotQueryContractBytecodeWhenContractIDIsNotSet() throws Exception { - try (var testEnv = new IntegrationTestEnv(1)) { - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractByteCodeQuery() - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); - - } - } + response = new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); + + var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); + + var bytecode = new ContractByteCodeQuery().setContractId(contractId).execute(testEnv.client); + + assertThat(bytecode.size()).isEqualTo(798); + + new ContractDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new FileDeleteTransaction() + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + } + } + + @Test + @DisplayName("Can get cost, even with a big max") + void getCostBigMaxQueryContractBytecode() throws Exception { + try (var testEnv = new IntegrationTestEnv(1)) { + + var response = new FileCreateTransaction() + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); + + var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); + + response = new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); + + var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); + + var bytecodeQuery = + new ContractByteCodeQuery().setContractId(contractId).setMaxQueryPayment(new Hbar(1000)); + + var cost = bytecodeQuery.getCost(testEnv.client); + + var bytecode = bytecodeQuery.setQueryPayment(cost).execute(testEnv.client); + + assertThat(bytecode.size()).isEqualTo(798); + + new ContractDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new FileDeleteTransaction() + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + } + } + + @Test + @DisplayName("Error, max is smaller than set payment.") + void getCostSmallMaxQueryContractBytecode() throws Exception { + try (var testEnv = new IntegrationTestEnv(1)) { + + var response = new FileCreateTransaction() + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); + + var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); + + response = new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); + + var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); + + var bytecodeQuery = + new ContractByteCodeQuery().setContractId(contractId).setMaxQueryPayment(Hbar.fromTinybars(1)); + + assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { + bytecodeQuery.execute(testEnv.client); + }); + + new ContractDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new FileDeleteTransaction() + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + } + } + + @Test + @DisplayName("Insufficient tx fee error.") + void getCostInsufficientTxFeeQueryContractBytecode() throws Exception { + try (var testEnv = new IntegrationTestEnv(1)) { + + var response = new FileCreateTransaction() + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); + + var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); + + response = new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); + + var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); + + var bytecodeQuery = + new ContractByteCodeQuery().setContractId(contractId).setMaxQueryPayment(new Hbar(100)); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + bytecodeQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + + new ContractDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new FileDeleteTransaction() + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + } + } + + @Test + @DisplayName("Cannot query contract bytecode when contract ID is not set") + void cannotQueryContractBytecodeWhenContractIDIsNotSet() throws Exception { + try (var testEnv = new IntegrationTestEnv(1)) { + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractByteCodeQuery().execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); + } + } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java index e919d0d2ba..ca4b020e7b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ContractCallQuery; import com.hiero.sdk.ContractCreateTransaction; import com.hiero.sdk.ContractDeleteTransaction; @@ -28,19 +13,15 @@ import com.hiero.sdk.Hbar; import com.hiero.sdk.MaxQueryPaymentExceededException; import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.MirrorNodeContractQuery; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class ContractCallIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Can call contract function") @@ -48,19 +29,19 @@ void canCallContractFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); @@ -68,32 +49,30 @@ void canCallContractFunction() throws Exception { Thread.sleep(2000); var gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("getMessage") - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("getMessage") + .execute(testEnv.client); var callQuery = new ContractCallQuery() - .setContractId(contractId) - .setGas(gas) - .setFunction("getMessage") - .setQueryPayment(new Hbar(1)); + .setContractId(contractId) + .setGas(gas) + .setFunction("getMessage") + .setQueryPayment(new Hbar(1)); - var result = callQuery - .execute(testEnv.client); + var result = callQuery.execute(testEnv.client); assertThat(result.getString(0)).isEqualTo("Hello from Hedera."); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -103,42 +82,41 @@ void cannotCallContractFunctionWhenContractFunctionIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .contractId - ); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractCallQuery() - .setContractId(contractId) - .setGas(100000) - .execute(testEnv.client); - }).withMessageContaining(Status.CONTRACT_REVERT_EXECUTED.toString()); + var contractId = Objects.requireNonNull(new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .contractId); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractCallQuery() + .setContractId(contractId) + .setGas(100000) + .execute(testEnv.client); + }) + .withMessageContaining(Status.CONTRACT_REVERT_EXECUTED.toString()); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -148,42 +126,41 @@ void cannotCallContractFunctionWhenGasIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .contractId - ); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractCallQuery() - .setContractId(contractId) - .setFunction("getMessage") - .execute(testEnv.client); - }).withMessageContaining(Status.INSUFFICIENT_GAS.toString()); + var contractId = Objects.requireNonNull(new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .contractId); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractCallQuery() + .setContractId(contractId) + .setFunction("getMessage") + .execute(testEnv.client); + }) + .withMessageContaining(Status.INSUFFICIENT_GAS.toString()); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -193,42 +170,41 @@ void cannotCallContractFunctionWhenContractIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .contractId - ); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractCallQuery() - .setGas(100000) - .setFunction("getMessage") - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); + var contractId = Objects.requireNonNull(new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .contractId); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractCallQuery() + .setGas(100000) + .setFunction("getMessage") + .execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -238,19 +214,19 @@ void getCostBigMaxContractCallFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); @@ -258,9 +234,9 @@ void getCostBigMaxContractCallFunction() throws Exception { Thread.sleep(2000); long gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("getMessage") - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("getMessage") + .execute(testEnv.client); var callQuery = new ContractCallQuery() .setContractId(contractId) @@ -268,22 +244,20 @@ void getCostBigMaxContractCallFunction() throws Exception { .setFunction("getMessage") .setQueryPayment(new Hbar(1)); - var result = callQuery - .execute(testEnv.client); + var result = callQuery.execute(testEnv.client); assertThat(result.getString(0)).isEqualTo("Hello from Hedera."); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -293,19 +267,19 @@ void getCostSmallMaxContractCallFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); @@ -313,9 +287,9 @@ void getCostSmallMaxContractCallFunction() throws Exception { Thread.sleep(2000); var gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("getMessage") - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("getMessage") + .execute(testEnv.client); var callQuery = new ContractCallQuery() .setContractId(contractId) @@ -328,16 +302,15 @@ void getCostSmallMaxContractCallFunction() throws Exception { }); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -347,19 +320,19 @@ void getCostInsufficientTxFeeContractCallFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); @@ -367,9 +340,9 @@ void getCostInsufficientTxFeeContractCallFunction() throws Exception { Thread.sleep(2000); var gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("getMessage") - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("getMessage") + .execute(testEnv.client); var callQuery = new ContractCallQuery() .setContractId(contractId) @@ -377,20 +350,22 @@ void getCostInsufficientTxFeeContractCallFunction() throws Exception { .setFunction("getMessage") .setMaxQueryPayment(new Hbar(100)); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - callQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + callQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java index 36988a1e09..4c62839f5e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java @@ -1,164 +1,142 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import com.hiero.sdk.*; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - public class ContractCreateFlowIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Create contract with flow") void createContractWithFlow() throws Throwable { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new ContractCreateFlow() - .setBytecode(SMART_CONTRACT_BYTECODE) - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setContractMemo("[e2e::ContractCreateFlow]") - .execute(testEnv.client); + .setBytecode(SMART_CONTRACT_BYTECODE) + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setContractMemo("[e2e::ContractCreateFlow]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); var receipt = new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(100000) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setGas(100000) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .setTransferAccountId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .setTransferAccountId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Create contract with flow without signing") void createContractWithFlowWithoutSigning() throws Throwable { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var adminKey = PrivateKey.generateED25519(); assertThatThrownBy(() -> new ContractCreateFlow() - .setBytecode(SMART_CONTRACT_BYTECODE) - .setAdminKey(adminKey) - .setGas(100000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setContractMemo("[e2e::ContractCreateFlow]") - .execute(testEnv.client)) - .isInstanceOf(RuntimeException.class) - .hasMessageEndingWith("raised status INVALID_SIGNATURE"); - + .setBytecode(SMART_CONTRACT_BYTECODE) + .setAdminKey(adminKey) + .setGas(100000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setContractMemo("[e2e::ContractCreateFlow]") + .execute(testEnv.client)) + .isInstanceOf(RuntimeException.class) + .hasMessageEndingWith("raised status INVALID_SIGNATURE"); } } @Test @DisplayName("Create contract with flow and sign with private key") void createContractWithFlowPrivateKeySign() throws Throwable { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var adminKey = PrivateKey.generateED25519(); var response = new ContractCreateFlow() - .setBytecode(SMART_CONTRACT_BYTECODE) - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setContractMemo("[e2e::ContractCreateFlow]") - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client); + .setBytecode(SMART_CONTRACT_BYTECODE) + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setContractMemo("[e2e::ContractCreateFlow]") + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); var receipt = new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(100000) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setGas(100000) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .setTransferAccountId(testEnv.operatorId) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .setTransferAccountId(testEnv.operatorId) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Create contract with flow and sign with public key and transaction signer") void createContractWithFlowPublicKeySign() throws Throwable { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var adminKey = PrivateKey.generateED25519(); var response = new ContractCreateFlow() - .setBytecode(SMART_CONTRACT_BYTECODE) - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setContractMemo("[e2e::ContractCreateFlow]") - .freezeWith(testEnv.client) - .signWith(adminKey.getPublicKey(), adminKey::sign) - .execute(testEnv.client); + .setBytecode(SMART_CONTRACT_BYTECODE) + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setContractMemo("[e2e::ContractCreateFlow]") + .freezeWith(testEnv.client) + .signWith(adminKey.getPublicKey(), adminKey::sign) + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); var receipt = new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(100000) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setGas(100000) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .setTransferAccountId(testEnv.operatorId) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .setTransferAccountId(testEnv.operatorId) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java index ae8f0edc1d..9140d84125 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ContractCreateTransaction; import com.hiero.sdk.ContractDeleteTransaction; import com.hiero.sdk.ContractFunctionParameters; @@ -28,17 +13,13 @@ import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.as; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class ContractCreateIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Can create contract") @@ -46,45 +27,44 @@ void canCreateContract() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); - assertThat(Objects.requireNonNull(info.accountId).toString()).isEqualTo(Objects.requireNonNull(contractId).toString()); + assertThat(Objects.requireNonNull(info.accountId).toString()) + .isEqualTo(Objects.requireNonNull(contractId).toString()); assertThat(info.adminKey).isNotNull(); - assertThat(Objects.requireNonNull(info.adminKey).toString()).isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); + assertThat(Objects.requireNonNull(info.adminKey).toString()) + .isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -94,33 +74,31 @@ void canCreateContractWithNoAdminKey() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); - assertThat(Objects.requireNonNull(info.accountId).toString()).isEqualTo(Objects.requireNonNull(contractId).toString()); + assertThat(Objects.requireNonNull(info.accountId).toString()) + .isEqualTo(Objects.requireNonNull(contractId).toString()); assertThat(info.adminKey).isNotNull(); // assertEquals(info.adminKey, contractId); assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); - } } @@ -130,29 +108,30 @@ void cannotCreateContractWhenGasIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INSUFFICIENT_GAS.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setConstructorParameters( + new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INSUFFICIENT_GAS.toString()); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } - } @Test @@ -161,27 +140,28 @@ void cannotCreateContractWhenConstructorParametersAreNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(100000) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.CONTRACT_REVERT_EXECUTED.toString()); + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(100000) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.CONTRACT_REVERT_EXECUTED.toString()); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -190,16 +170,18 @@ void cannotCreateContractWhenConstructorParametersAreNotSet() throws Exception { void cannotCreateContractWhenBytecodeFileIdIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(100000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_FILE_ID.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(100000) + .setConstructorParameters( + new ContractFunctionParameters().addString("Hello from Hedera.")) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_FILE_ID.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java index 179b30bf1c..e68c7fe1fb 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ContractCreateTransaction; import com.hiero.sdk.ContractDeleteTransaction; import com.hiero.sdk.ContractFunctionParameters; @@ -28,17 +13,13 @@ import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.as; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class ContractDeleteIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Can delete contract with admin key") @@ -46,25 +27,23 @@ void canDeleteContractWithAdminKey() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); @@ -76,16 +55,15 @@ void canDeleteContractWithAdminKey() throws Exception { assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -95,25 +73,22 @@ void cannotDeleteContractWhichHasNoAdminKey() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); var contractId = Objects.requireNonNull(new ContractCreateTransaction() - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .contractId - ); - - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .contractId); + + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); @@ -123,14 +98,15 @@ void cannotDeleteContractWhichHasNoAdminKey() throws Exception { assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new ContractDeleteTransaction() - .setContractId(contractId) - .setTransferAccountId(testEnv.client.getOperatorAccountId()) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.MODIFYING_IMMUTABLE_CONTRACT.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new ContractDeleteTransaction() + .setContractId(contractId) + .setTransferAccountId(testEnv.client.getOperatorAccountId()) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.MODIFYING_IMMUTABLE_CONTRACT.toString()); } } @@ -139,12 +115,11 @@ void cannotDeleteContractWhichHasNoAdminKey() throws Exception { void cannotDeleteContractWhenContractIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractDeleteTransaction() - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractDeleteTransaction().execute(testEnv.client).getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java index dc580f9cf8..d18e60d4e8 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -29,7 +11,6 @@ import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.MirrorNodeContractQuery; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; @@ -38,7 +19,8 @@ import org.junit.jupiter.api.Test; public class ContractExecuteIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Can execute contract methods") @@ -46,19 +28,19 @@ void canExecuteContractMethods() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); @@ -66,29 +48,28 @@ void canExecuteContractMethods() throws Exception { Thread.sleep(2000); var gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client); var receipt = new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(gas + 10000) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setGas(gas + 10000) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -97,14 +78,15 @@ void canExecuteContractMethods() throws Exception { void cannotExecuteContractWhenContractIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractExecuteTransaction() - .setGas(100000) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractExecuteTransaction() + .setGas(100000) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); } } @@ -114,41 +96,42 @@ void cannotExecuteContractWhenContractFunctionParametersAreNotSet() throws Excep try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client).contractId); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(100000) + var contractId = Objects.requireNonNull(new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.CONTRACT_REVERT_EXECUTED.toString()); + .getReceipt(testEnv.client) + .contractId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new ContractExecuteTransaction() + .setContractId(contractId) + .setGas(100000) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.CONTRACT_REVERT_EXECUTED.toString()); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -158,41 +141,42 @@ void cannotExecuteContractWhenGasIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client).contractId); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractExecuteTransaction() - .setContractId(contractId) - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + var contractId = Objects.requireNonNull(new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INSUFFICIENT_GAS.toString()); + .getReceipt(testEnv.client) + .contractId); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractExecuteTransaction() + .setContractId(contractId) + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INSUFFICIENT_GAS.toString()); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java index c834903301..f5a1989eb8 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -33,7 +15,6 @@ import com.hiero.sdk.FileId; import com.hiero.sdk.Hbar; import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.MirrorNodeContractQuery; import java.math.BigInteger; import java.util.Arrays; import java.util.Objects; @@ -44,7 +25,8 @@ import org.junit.jupiter.api.Test; public class ContractFunctionParametersIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "60806040523480156200001157600080fd5b5060408051608081018252600491810191825263082d8caf60e31b6060820152818152600160208201529060009081906200004d908262000106565b5060208201518160010155905050620001d2565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200008c57607f821691505b602082108103620000ad57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010157600081815260208120601f850160051c81016020861015620000dc5750805b601f850160051c820191505b81811015620000fd57828155600101620000e8565b5050505b505050565b81516001600160401b0381111562000122576200012262000061565b6200013a8162000133845462000077565b84620000b3565b602080601f831160018114620001725760008415620001595750858301515b600019600386901b1c1916600185901b178555620000fd565b600085815260208120601f198616915b82811015620001a35788860151825594840194600190910190840162000182565b5085821015620001c25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b615dfe80620001e26000396000f3fe608060405234801561001057600080fd5b50600436106108355760003560e01c80637f8082f711610437578063c5882dbb11610236578063e2a345291161013b578063f6e877f4116100c3578063fafc3b9911610092578063fafc3b9914611857578063fba1bc4c14611872578063febe099714611887578063ff5f54dd146118a2578063ffb80501146118bd57600080fd5b8063f6e877f4146117d9578063f8293f6e146117ff578063f914c4d214611821578063f962326a1461183c57600080fd5b8063eceda56a1161010a578063eceda56a1461174c578063ef65066114611767578063f0ebb92214611782578063f4e490f51461179d578063f680c24a146117be57600080fd5b8063e2a34529146116d8578063e4b90944146116f3578063e713cda81461170e578063ea945d301461173157600080fd5b8063d79d4d40116101be578063e05e91e01161018d578063e05e91e014611630578063e066de5014611656578063e0cddc551461167c578063e0f53e2414611697578063e1dbb318146116bd57600080fd5b8063d79d4d4014611592578063dade0c0b146115b8578063dbb04ed9146115da578063de9fb4841461160357600080fd5b8063cbd2e6a511610205578063cbd2e6a514611511578063cdb9e4e814611536578063cf7c3dfc1461155c578063d1b10ad714610ada578063d33c57501461157757600080fd5b8063c5882dbb1461148b578063c6c18a1c146114a6578063c7d8b87e146114d0578063cb47cdae146114f657600080fd5b8063a1bda1221161033c578063b5abe7df116102c4578063ba945bdb11610293578063ba945bdb146113dc578063bb6b524314611402578063bd90536a14611428578063be63d0b814611450578063c503772d1461146b57600080fd5b8063b5abe7df14611359578063b834bfe914611374578063b8da8d1614611395578063b989c7ee146113bb57600080fd5b8063aa016e681161030b578063aa016e68146112dc578063aa80ca2e14610c6b578063b2325c35146112f7578063b2db404a14611312578063b4e3e7b11461133357600080fd5b8063a1bda12214611259578063a401d60d1461127a578063a57ebf10146112a0578063a75761f1146112bb57600080fd5b80638f2805e0116103bf57806394cd7c801161038e57806394cd7c80146111b557806398508ba3146111d65780639b1794ae146111f7578063a08b9f671461121d578063a19962341461123e57600080fd5b80638f2805e0146111435780638ff4cfee1461115e578063909c5b2414611179578063923f5edf1461119457600080fd5b806386aba5a71161040657806386aba5a7146110ab578063881c8fb7146110c657806388b1dd37146110ec57806388b7e6f5146111075780638d7f60151461112857600080fd5b80637f8082f714610c6b578063817b24541461107557806381dbe13e14611090578063827147ce1461099a57600080fd5b806338fa6658116106435780635a8fd3b51161054857806370a5cb81116104d05780637ba844771161049f5780637ba8447714610fe25780637d0dc26214610ffd5780637d906c551461101e5780637e281630146110395780637ec32d841461105457600080fd5b806370a5cb8114610f5a57806372a06b4d14610f80578063737b801614610fa1578063796a27ea14610fbc57600080fd5b806369cbe0561161051757806369cbe05614610ecd5780636a54715c14610ee85780636a75c12f14610f095780636a9929db14610f245780636ee8f39c14610f3f57600080fd5b80635a8fd3b514610e4f578063628bc3ef14610e6a57806364e008c114610e8b57806368ef446614610eac57600080fd5b80634bbc9a67116105cb578063545e21131161059a578063545e211314610dd157806355f232a414610dfe57806357890ba914610e1957806357d9c08b14610e3457806359adb2df14610ada57600080fd5b80634bbc9a6714610d655780634e96247314610d80578063501297c214610d9b57806350370d8514610db657600080fd5b80633f396e67116106125780633f396e6714610ce3578063407b899b14610d0b578063435a33a814610d2c57806344e7b03714610af657806348d848d014610d4757600080fd5b806338fa665814610c6b5780633a73007714610c865780633b45e6e014610ca15780633e1a277114610cc257600080fd5b80631e9aa70f116107495780632ef16e8e116106d15780633135d681116106a05780633135d68114610beb57806333520ec314610c0657806333edb89614610c275780633729a2da14610c42578063382d087314610c5057600080fd5b80632ef16e8e14610b6d5780632f47a40d14610b8e5780632f6c1bb414610baf578063309f9ac914610bd057600080fd5b806322937ea91161071857806322937ea914610ada5780632421101f14610af657806324c3c3d214610b1c57806328a30eb714610b375780632a3082ce14610b5257600080fd5b80631e9aa70f14610a6e578063203ae83a14610a8957806321d1730b14610aa45780632234ea0214610abf57600080fd5b8063118b8415116107cc57806312b932a71161079b57806312b932a7146109db57806312cd95a1146109f657806315832ae414610a17578063189cea8e14610a325780631d11456214610a5357600080fd5b8063118b84151461095857806311ec6c9014610979578063126bc8151461099a578063129ed5da146109b557600080fd5b806306ac6fe11161080857806306ac6fe1146108ca57806308123e09146108f05780630a958dc81461091657806310d545531461093757600080fd5b8063017fa10b1461083a578063021d88ab14610868578063037454301461088e5780630577a846146108af575b600080fd5b61084b610848366004611a34565b90565b6040516001600160801b0390911681526020015b60405180910390f35b610876610848366004611a6d565b6040516001600160601b03909116815260200161085f565b61089c610848366004611a9a565b604051600c9190910b815260200161085f565b6108bd610848366004611b35565b60405161085f9190611bd1565b6108d8610848366004611c35565b6040516001600160781b03909116815260200161085f565b6108fe610848366004611c67565b60405166ffffffffffffff909116815260200161085f565b610924610848366004611c94565b60405160049190910b815260200161085f565b610945610848366004611cc1565b60405160119190910b815260200161085f565b610966610848366004611cee565b604051601e9190910b815260200161085f565b610987610848366004611d1b565b60405160139190910b815260200161085f565b6109a8610848366004611da5565b60405161085f9190611e27565b6109c3610848366004611e51565b6040516001600160981b03909116815260200161085f565b6109e9610848366004611e7e565b60405161085f9190611f0a565b610a04610848366004611f57565b60405160129190910b815260200161085f565b610a25610848366004611f83565b60405161085f919061200f565b610a4061084836600461205c565b60405160169190910b815260200161085f565b610a6161084836600461208f565b60405161085f919061211d565b610a7c610848366004612170565b60405161085f91906121fc565b610a97610848366004612237565b60405161085f91906122c3565b610ab261084836600461231b565b60405161085f91906123a7565b610acd6108483660046123fa565b60405161085f9190612486565b610ae86108483660046124c1565b60405190815260200161085f565b610b046108483660046124da565b6040516001600160a01b03909116815260200161085f565b610b2a61084836600461250e565b60405161085f919061259a565b610b456108483660046125db565b60405161085f9190612667565b610b606108483660046126b4565b60405161085f9190612740565b610b7b61084836600461278d565b604051601d9190910b815260200161085f565b610b9c6108483660046127a8565b604051600a9190910b815260200161085f565b610bbd6108483660046127d5565b60405160199190910b815260200161085f565b610bde610848366004612807565b60405161085f9190612893565b610bf96108483660046128eb565b60405161085f9190612977565b610c146108483660046129ca565b604051601a9190910b815260200161085f565b610c356108483660046129f7565b60405161085f9190612a83565b610a61610848366004612abe565b610c5e610848366004612b5e565b60405161085f9190612bea565b610c79610848366004612c25565b60405161085f9190612caa565b610c94610848366004612cfd565b60405161085f9190612d89565b610caf610848366004612de0565b60405160109190910b815260200161085f565b610cd0610848366004612e0d565b604051601c9190910b815260200161085f565b610cf1610848366004612e41565b60405168ffffffffffffffffff909116815260200161085f565b610d19610848366004612e6e565b60405160079190910b815260200161085f565b610d3a610848366004612e89565b60405161085f9190612f15565b610d55610848366004612f60565b604051901515815260200161085f565b610d73610848366004612f7b565b60405161085f9190613007565b610d8e610848366004613058565b60405161085f91906130e4565b610da9610848366004613137565b60405161085f91906131c3565b610dc4610848366004613215565b60405161085f91906132a1565b610de4610ddf3660046132f4565b6118e1565b60408051600093840b81529190920b60208201520161085f565b610e0c61084836600461330f565b60405161085f919061339b565b610e276108483660046133d6565b60405161085f9190613462565b610e426108483660046134b3565b60405161085f919061353f565b610e5d610848366004613593565b60405161085f919061361f565b610e7861084836600461366f565b60405160099190910b815260200161085f565b610e9961084836600461369c565b60405160179190910b815260200161085f565b610eba6108483660046136b7565b60405160149190910b815260200161085f565b610edb6108483660046136e4565b60405161085f9190613770565b610ef66108483660046137ab565b60405160069190910b815260200161085f565b610f176108483660046137d8565b60405161085f9190613864565b610f3261084836600461389f565b60405161085f919061392b565b610f4d610848366004613980565b60405161085f9190613a0c565b610f68610848366004613a67565b6040516001600160681b03909116815260200161085f565b610f8e6108483660046132f4565b60405160009190910b815260200161085f565b610faf610848366004613a99565b60405161085f9190613b25565b610fca610848366004613b66565b6040516001600160d81b03909116815260200161085f565b610ff0610848366004613b96565b60405161085f9190613c22565b61100b610848366004613c73565b604051601b9190910b815260200161085f565b61102c610848366004613ca1565b60405161085f9190613d2d565b611047610848366004613d7c565b60405161085f9190613e08565b611062610848366004613e56565b60405160029190910b815260200161085f565b611083610848366004613e88565b60405161085f9190613f14565b61109e610848366004613f55565b60405161085f9190614005565b6110b9610848366004614067565b60405161085f91906140f3565b6110d461084836600461414b565b6040516001600160b01b03909116815260200161085f565b6110fa610848366004614166565b60405161085f91906141f2565b61111561084836600461422d565b604051600f9190910b815260200161085f565b611136610848366004614248565b60405161085f91906142d4565b611151610848366004614326565b60405161085f91906143b2565b61116c6108483660046143f3565b60405161085f919061447f565b6111876108483660046144ba565b60405161085f919061455d565b6111a26108483660046145b2565b60405160159190910b815260200161085f565b6111c36108483660046145df565b60405160189190910b815260200161085f565b6111e46108483660046145fa565b604051600d9190910b815260200161085f565b61120561084836600461462c565b6040516001600160b81b03909116815260200161085f565b61122b610848366004614647565b604051600b9190910b815260200161085f565b61124c610848366004614662565b60405161085f91906146ee565b61126761084836600461472f565b60405160019190910b815260200161085f565b61128861084836600461474a565b6040516001600160f01b03909116815260200161085f565b6112ae610848366004614765565b60405161085f91906147f1565b6112c961084836600461482c565b60405161ffff909116815260200161085f565b6112ea610848366004614847565b60405161085f91906148d3565b611305610848366004614928565b60405161085f91906149b4565b611320610848366004614a01565b60405160059190910b815260200161085f565b611341610848366004614a1c565b6040516001600160701b03909116815260200161085f565b611367610848366004614a37565b60405161085f9190614ac3565b611382610848366004614b04565b604051600e9190910b815260200161085f565b6113a3610848366004614b1f565b6040516001600160a81b03909116815260200161085f565b6113c9610848366004614b3a565b60405160039190910b815260200161085f565b6113ea610848366004614b55565b6040516001600160881b03909116815260200161085f565b611410610848366004614b70565b6040516001600160c81b03909116815260200161085f565b61143b6114363660046124c1565b6118f9565b6040805192835260208301919091520161085f565b61145e610848366004614b8b565b60405161085f9190614c17565b611479610848366004614c52565b60405160ff909116815260200161085f565b611499610848366004614c6d565b60405161085f9190614cf9565b6114b4610848366004614d34565b6040516affffffffffffffffffffff909116815260200161085f565b6114de610848366004614d4f565b6040516001600160f81b03909116815260200161085f565b611504610848366004614d6a565b60405161085f9190614df6565b61151f610848366004614e31565b60405165ffffffffffff909116815260200161085f565b611544610848366004614e63565b6040516001600160e01b03909116815260200161085f565b61156a610848366004614e7e565b60405161085f9190614f0a565b611585610848366004614f45565b60405161085f9190614fd1565b6115a0610848366004615029565b6040516001600160d01b03909116815260200161085f565b6115cb6115c6366004615044565b611908565b60405161085f9392919061505f565b6115e8610848366004615096565b60405169ffffffffffffffffffff909116815260200161085f565b611616611611366004611c94565b611946565b60408051600493840b81529190920b60208201520161085f565b61163e6108483660046150b1565b6040516001600160401b03909116815260200161085f565b6116646108483660046150e3565b6040516001600160e81b03909116815260200161085f565b61168a6108483660046150fe565b60405161085f919061518a565b6116a56108483660046151c5565b6040516001600160c01b03909116815260200161085f565b6116cb6108483660046151f2565b60405161085f919061527e565b6116e66108483660046152b9565b60405161085f9190615345565b61170161084836600461538d565b60405161085f9190615419565b61171c610848366004615044565b60405163ffffffff909116815260200161085f565b61173f610848366004615454565b60405161085f91906154e0565b61175a61084836600461551b565b60405161085f91906155a7565b6117756108483660046155e2565b60405161085f919061566e565b6117906108483660046156af565b60405161085f919061573b565b6117ab610848366004615776565b60405160089190910b815260200161085f565b6117cc610848366004615791565b60405161085f919061581d565b6117e7610848366004615858565b6040516001600160901b03909116815260200161085f565b61180d610848366004615873565b60405162ffffff909116815260200161085f565b61182f61084836600461588e565b60405161085f919061591a565b61184a61084836600461595b565b60405161085f91906159e7565b611865610848366004615a28565b60405161085f9190615ab4565b61187a611955565b60405161085f9190615af5565b611895610848366004615b27565b60405161085f9190615bb3565b6118b0610848366004615bf4565b60405161085f9190615c80565b6118cb610848366004615cc1565b60405164ffffffffff909116815260200161085f565b600080826118f0816014615cf2565b91509150915091565b600080826118f0816001615d19565b600080606083611919600182615d41565b6040805180820190915260028152614f4b60f01b602082015291945063ffffffff16925090509193909250565b600080826118f0816001615d65565b604080518082019091526060815260006020820152600060405180604001604052908160008201805461198790615d8e565b80601f01602080910402602001604051908101604052809291908181526020018280546119b390615d8e565b8015611a005780601f106119d557610100808354040283529160200191611a00565b820191906000526020600020905b8154815290600101906020018083116119e357829003601f168201915b50505050508152602001600182015481525050905090565b80356001600160801b0381168114611a2f57600080fd5b919050565b600060208284031215611a4657600080fd5b611a4f82611a18565b9392505050565b80356001600160601b0381168114611a2f57600080fd5b600060208284031215611a7f57600080fd5b611a4f82611a56565b8035600c81900b8114611a2f57600080fd5b600060208284031215611aac57600080fd5b611a4f82611a88565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611af357611af3611ab5565b604052919050565b60006001600160401b03821115611b1457611b14611ab5565b5060051b60200190565b80356001600160f01b0381168114611a2f57600080fd5b60006020808385031215611b4857600080fd5b82356001600160401b03811115611b5e57600080fd5b8301601f81018513611b6f57600080fd5b8035611b82611b7d82611afb565b611acb565b81815260059190911b82018301908381019087831115611ba157600080fd5b928401925b82841015611bc657611bb784611b1e565b82529284019290840190611ba6565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160f01b031683529284019291840191600101611bed565b50909695505050505050565b80356001600160781b0381168114611a2f57600080fd5b600060208284031215611c4757600080fd5b611a4f82611c1e565b803566ffffffffffffff81168114611a2f57600080fd5b600060208284031215611c7957600080fd5b611a4f82611c50565b8035600481900b8114611a2f57600080fd5b600060208284031215611ca657600080fd5b611a4f82611c82565b8035601181900b8114611a2f57600080fd5b600060208284031215611cd357600080fd5b611a4f82611caf565b8035601e81900b8114611a2f57600080fd5b600060208284031215611d0057600080fd5b611a4f82611cdc565b8035601381900b8114611a2f57600080fd5b600060208284031215611d2d57600080fd5b611a4f82611d09565b600082601f830112611d4757600080fd5b81356001600160401b03811115611d6057611d60611ab5565b611d73601f8201601f1916602001611acb565b818152846020838601011115611d8857600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215611db757600080fd5b81356001600160401b03811115611dcd57600080fd5b611dd984828501611d36565b949350505050565b6000815180845260005b81811015611e0757602081850181015186830182015201611deb565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611a4f6020830184611de1565b80356001600160981b0381168114611a2f57600080fd5b600060208284031215611e6357600080fd5b611a4f82611e3a565b8035600381900b8114611a2f57600080fd5b60006020808385031215611e9157600080fd5b82356001600160401b03811115611ea757600080fd5b8301601f81018513611eb857600080fd5b8035611ec6611b7d82611afb565b81815260059190911b82018301908381019087831115611ee557600080fd5b928401925b82841015611bc657611efb84611e6c565b82529284019290840190611eea565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160030b83529284019291840191600101611f26565b8035601281900b8114611a2f57600080fd5b600060208284031215611f6957600080fd5b611a4f82611f45565b803560ff81168114611a2f57600080fd5b60006020808385031215611f9657600080fd5b82356001600160401b03811115611fac57600080fd5b8301601f81018513611fbd57600080fd5b8035611fcb611b7d82611afb565b81815260059190911b82018301908381019087831115611fea57600080fd5b928401925b82841015611bc65761200084611f72565b82529284019290840190611fef565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160ff168352928401929184019160010161202b565b8035601681900b8114611a2f57600080fd5b60006020828403121561206e57600080fd5b611a4f8261204a565b6001600160a01b038116811461208c57600080fd5b50565b600060208083850312156120a257600080fd5b82356001600160401b038111156120b857600080fd5b8301601f810185136120c957600080fd5b80356120d7611b7d82611afb565b81815260059190911b820183019083810190878311156120f657600080fd5b928401925b82841015611bc657833561210e81612077565b825292840192908401906120fb565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160a01b031683529284019291840191600101612139565b8035601481900b8114611a2f57600080fd5b6000602080838503121561218357600080fd5b82356001600160401b0381111561219957600080fd5b8301601f810185136121aa57600080fd5b80356121b8611b7d82611afb565b81815260059190911b820183019083810190878311156121d757600080fd5b928401925b82841015611bc6576121ed8461215e565b825292840192908401906121dc565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160140b83529284019291840191600101612218565b6000602080838503121561224a57600080fd5b82356001600160401b0381111561226057600080fd5b8301601f8101851361227157600080fd5b803561227f611b7d82611afb565b81815260059190911b8201830190838101908783111561229e57600080fd5b928401925b82841015611bc6576122b484611c50565b825292840192908401906122a3565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835166ffffffffffffff16835292840192918401916001016122df565b80356001600160f81b0381168114611a2f57600080fd5b6000602080838503121561232e57600080fd5b82356001600160401b0381111561234457600080fd5b8301601f8101851361235557600080fd5b8035612363611b7d82611afb565b81815260059190911b8201830190838101908783111561238257600080fd5b928401925b82841015611bc65761239884612304565b82529284019290840190612387565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160f81b0316835292840192918401916001016123c3565b8035600a81900b8114611a2f57600080fd5b6000602080838503121561240d57600080fd5b82356001600160401b0381111561242357600080fd5b8301601f8101851361243457600080fd5b8035612442611b7d82611afb565b81815260059190911b8201830190838101908783111561246157600080fd5b928401925b82841015611bc657612477846123e8565b82529284019290840190612466565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600a0b835292840192918401916001016124a2565b6000602082840312156124d357600080fd5b5035919050565b6000602082840312156124ec57600080fd5b8135611a4f81612077565b80356001600160c81b0381168114611a2f57600080fd5b6000602080838503121561252157600080fd5b82356001600160401b0381111561253757600080fd5b8301601f8101851361254857600080fd5b8035612556611b7d82611afb565b81815260059190911b8201830190838101908783111561257557600080fd5b928401925b82841015611bc65761258b846124f7565b8252928401929084019061257a565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160c81b0316835292840192918401916001016125b6565b600060208083850312156125ee57600080fd5b82356001600160401b0381111561260457600080fd5b8301601f8101851361261557600080fd5b8035612623611b7d82611afb565b81815260059190911b8201830190838101908783111561264257600080fd5b928401925b82841015611bc65761265884611d09565b82529284019290840190612647565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160130b83529284019291840191600101612683565b8035600b81900b8114611a2f57600080fd5b600060208083850312156126c757600080fd5b82356001600160401b038111156126dd57600080fd5b8301601f810185136126ee57600080fd5b80356126fc611b7d82611afb565b81815260059190911b8201830190838101908783111561271b57600080fd5b928401925b82841015611bc657612731846126a2565b82529284019290840190612720565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600b0b8352928401929184019160010161275c565b8035601d81900b8114611a2f57600080fd5b60006020828403121561279f57600080fd5b611a4f8261277b565b6000602082840312156127ba57600080fd5b611a4f826123e8565b8035601981900b8114611a2f57600080fd5b6000602082840312156127e757600080fd5b611a4f826127c3565b80356001600160c01b0381168114611a2f57600080fd5b6000602080838503121561281a57600080fd5b82356001600160401b0381111561283057600080fd5b8301601f8101851361284157600080fd5b803561284f611b7d82611afb565b81815260059190911b8201830190838101908783111561286e57600080fd5b928401925b82841015611bc657612884846127f0565b82529284019290840190612873565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160c01b0316835292840192918401916001016128af565b80356001600160401b0381168114611a2f57600080fd5b600060208083850312156128fe57600080fd5b82356001600160401b0381111561291457600080fd5b8301601f8101851361292557600080fd5b8035612933611b7d82611afb565b81815260059190911b8201830190838101908783111561295257600080fd5b928401925b82841015611bc657612968846128d4565b82529284019290840190612957565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160401b031683529284019291840191600101612993565b8035601a81900b8114611a2f57600080fd5b6000602082840312156129dc57600080fd5b611a4f826129b8565b8035600d81900b8114611a2f57600080fd5b60006020808385031215612a0a57600080fd5b82356001600160401b03811115612a2057600080fd5b8301601f81018513612a3157600080fd5b8035612a3f611b7d82611afb565b81815260059190911b82018301908381019087831115612a5e57600080fd5b928401925b82841015611bc657612a74846129e5565b82529284019290840190612a63565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600d0b83529284019291840191600101612a9f565b60006020808385031215612ad157600080fd5b82356001600160401b03811115612ae757600080fd5b8301601f81018513612af857600080fd5b8035612b06611b7d82611afb565b81815260059190911b82018301908381019087831115612b2557600080fd5b928401925b82841015611bc6578335612b3d81612077565b82529284019290840190612b2a565b8035600181900b8114611a2f57600080fd5b60006020808385031215612b7157600080fd5b82356001600160401b03811115612b8757600080fd5b8301601f81018513612b9857600080fd5b8035612ba6611b7d82611afb565b81815260059190911b82018301908381019087831115612bc557600080fd5b928401925b82841015611bc657612bdb84612b4c565b82529284019290840190612bca565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600190810b8452938501939285019201612c06565b60006020808385031215612c3857600080fd5b82356001600160401b03811115612c4e57600080fd5b8301601f81018513612c5f57600080fd5b8035612c6d611b7d82611afb565b81815260059190911b82018301908381019087831115612c8c57600080fd5b928401925b82841015611bc657833582529284019290840190612c91565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835183529284019291840191600101612cc6565b80356affffffffffffffffffffff81168114611a2f57600080fd5b60006020808385031215612d1057600080fd5b82356001600160401b03811115612d2657600080fd5b8301601f81018513612d3757600080fd5b8035612d45611b7d82611afb565b81815260059190911b82018301908381019087831115612d6457600080fd5b928401925b82841015611bc657612d7a84612ce2565b82529284019290840190612d69565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516affffffffffffffffffffff1683529284019291840191600101612da5565b8035601081900b8114611a2f57600080fd5b600060208284031215612df257600080fd5b611a4f82612dce565b8035601c81900b8114611a2f57600080fd5b600060208284031215612e1f57600080fd5b611a4f82612dfb565b803568ffffffffffffffffff81168114611a2f57600080fd5b600060208284031215612e5357600080fd5b611a4f82612e28565b8035600781900b8114611a2f57600080fd5b600060208284031215612e8057600080fd5b611a4f82612e5c565b60006020808385031215612e9c57600080fd5b82356001600160401b03811115612eb257600080fd5b8301601f81018513612ec357600080fd5b8035612ed1611b7d82611afb565b81815260059190911b82018301908381019087831115612ef057600080fd5b928401925b82841015611bc657612f06846129b8565b82529284019290840190612ef5565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601a0b83529284019291840191600101612f31565b80358015158114611a2f57600080fd5b600060208284031215612f7257600080fd5b611a4f82612f50565b60006020808385031215612f8e57600080fd5b82356001600160401b03811115612fa457600080fd5b8301601f81018513612fb557600080fd5b8035612fc3611b7d82611afb565b81815260059190911b82018301908381019087831115612fe257600080fd5b928401925b82841015611bc657612ff884612f50565b82529284019290840190612fe7565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351151583529284019291840191600101613023565b80356001600160d81b0381168114611a2f57600080fd5b6000602080838503121561306b57600080fd5b82356001600160401b0381111561308157600080fd5b8301601f8101851361309257600080fd5b80356130a0611b7d82611afb565b81815260059190911b820183019083810190878311156130bf57600080fd5b928401925b82841015611bc6576130d584613041565b825292840192908401906130c4565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160d81b031683529284019291840191600101613100565b8035601581900b8114611a2f57600080fd5b6000602080838503121561314a57600080fd5b82356001600160401b0381111561316057600080fd5b8301601f8101851361317157600080fd5b803561317f611b7d82611afb565b81815260059190911b8201830190838101908783111561319e57600080fd5b928401925b82841015611bc6576131b484613125565b825292840192908401906131a3565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160150b835292840192918401916001016131df565b80356001600160a81b0381168114611a2f57600080fd5b6000602080838503121561322857600080fd5b82356001600160401b0381111561323e57600080fd5b8301601f8101851361324f57600080fd5b803561325d611b7d82611afb565b81815260059190911b8201830190838101908783111561327c57600080fd5b928401925b82841015611bc657613292846131fe565b82529284019290840190613281565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160a81b0316835292840192918401916001016132bd565b8035600081900b8114611a2f57600080fd5b60006020828403121561330657600080fd5b611a4f826132e2565b6000602080838503121561332257600080fd5b82356001600160401b0381111561333857600080fd5b8301601f8101851361334957600080fd5b8035613357611b7d82611afb565b81815260059190911b8201830190838101908783111561337657600080fd5b928401925b82841015611bc65761338c84611caf565b8252928401929084019061337b565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160110b835292840192918401916001016133b7565b600060208083850312156133e957600080fd5b82356001600160401b038111156133ff57600080fd5b8301601f8101851361341057600080fd5b803561341e611b7d82611afb565b81815260059190911b8201830190838101908783111561343d57600080fd5b928401925b82841015611bc6576134538461204a565b82529284019290840190613442565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160160b8352928401929184019160010161347e565b803565ffffffffffff81168114611a2f57600080fd5b600060208083850312156134c657600080fd5b82356001600160401b038111156134dc57600080fd5b8301601f810185136134ed57600080fd5b80356134fb611b7d82611afb565b81815260059190911b8201830190838101908783111561351a57600080fd5b928401925b82841015611bc6576135308461349d565b8252928401929084019061351f565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835165ffffffffffff168352928401929184019160010161355b565b803563ffffffff81168114611a2f57600080fd5b600060208083850312156135a657600080fd5b82356001600160401b038111156135bc57600080fd5b8301601f810185136135cd57600080fd5b80356135db611b7d82611afb565b81815260059190911b820183019083810190878311156135fa57600080fd5b928401925b82841015611bc6576136108461357f565b825292840192908401906135ff565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835163ffffffff168352928401929184019160010161363b565b8035600981900b8114611a2f57600080fd5b60006020828403121561368157600080fd5b611a4f8261365d565b8035601781900b8114611a2f57600080fd5b6000602082840312156136ae57600080fd5b611a4f8261368a565b6000602082840312156136c957600080fd5b611a4f8261215e565b8035600681900b8114611a2f57600080fd5b600060208083850312156136f757600080fd5b82356001600160401b0381111561370d57600080fd5b8301601f8101851361371e57600080fd5b803561372c611b7d82611afb565b81815260059190911b8201830190838101908783111561374b57600080fd5b928401925b82841015611bc657613761846136d2565b82529284019290840190613750565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160060b8352928401929184019160010161378c565b6000602082840312156137bd57600080fd5b611a4f826136d2565b8035600f81900b8114611a2f57600080fd5b600060208083850312156137eb57600080fd5b82356001600160401b0381111561380157600080fd5b8301601f8101851361381257600080fd5b8035613820611b7d82611afb565b81815260059190911b8201830190838101908783111561383f57600080fd5b928401925b82841015611bc657613855846137c6565b82529284019290840190613844565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600f0b83529284019291840191600101613880565b600060208083850312156138b257600080fd5b82356001600160401b038111156138c857600080fd5b8301601f810185136138d957600080fd5b80356138e7611b7d82611afb565b81815260059190911b8201830190838101908783111561390657600080fd5b928401925b82841015611bc65761391c84611cdc565b8252928401929084019061390b565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601e0b83529284019291840191600101613947565b803569ffffffffffffffffffff81168114611a2f57600080fd5b6000602080838503121561399357600080fd5b82356001600160401b038111156139a957600080fd5b8301601f810185136139ba57600080fd5b80356139c8611b7d82611afb565b81815260059190911b820183019083810190878311156139e757600080fd5b928401925b82841015611bc6576139fd84613966565b825292840192908401906139ec565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835169ffffffffffffffffffff1683529284019291840191600101613a28565b80356001600160681b0381168114611a2f57600080fd5b600060208284031215613a7957600080fd5b611a4f82613a50565b80356001600160701b0381168114611a2f57600080fd5b60006020808385031215613aac57600080fd5b82356001600160401b03811115613ac257600080fd5b8301601f81018513613ad357600080fd5b8035613ae1611b7d82611afb565b81815260059190911b82018301908381019087831115613b0057600080fd5b928401925b82841015611bc657613b1684613a82565b82529284019290840190613b05565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160701b031683529284019291840191600101613b41565b600060208284031215613b7857600080fd5b611a4f82613041565b803564ffffffffff81168114611a2f57600080fd5b60006020808385031215613ba957600080fd5b82356001600160401b03811115613bbf57600080fd5b8301601f81018513613bd057600080fd5b8035613bde611b7d82611afb565b81815260059190911b82018301908381019087831115613bfd57600080fd5b928401925b82841015611bc657613c1384613b81565b82529284019290840190613c02565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835164ffffffffff1683529284019291840191600101613c3e565b8035601b81900b8114611a2f57600080fd5b600060208284031215613c8557600080fd5b611a4f82613c61565b803562ffffff81168114611a2f57600080fd5b60006020808385031215613cb457600080fd5b82356001600160401b03811115613cca57600080fd5b8301601f81018513613cdb57600080fd5b8035613ce9611b7d82611afb565b81815260059190911b82018301908381019087831115613d0857600080fd5b928401925b82841015611bc657613d1e84613c8e565b82529284019290840190613d0d565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835162ffffff1683529284019291840191600101613d49565b803561ffff81168114611a2f57600080fd5b60006020808385031215613d8f57600080fd5b82356001600160401b03811115613da557600080fd5b8301601f81018513613db657600080fd5b8035613dc4611b7d82611afb565b81815260059190911b82018301908381019087831115613de357600080fd5b928401925b82841015611bc657613df984613d6a565b82529284019290840190613de8565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835161ffff1683529284019291840191600101613e24565b8035600281900b8114611a2f57600080fd5b600060208284031215613e6857600080fd5b611a4f82613e44565b80356001600160901b0381168114611a2f57600080fd5b60006020808385031215613e9b57600080fd5b82356001600160401b03811115613eb157600080fd5b8301601f81018513613ec257600080fd5b8035613ed0611b7d82611afb565b81815260059190911b82018301908381019087831115613eef57600080fd5b928401925b82841015611bc657613f0584613e71565b82529284019290840190613ef4565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160901b031683529284019291840191600101613f30565b60006020808385031215613f6857600080fd5b82356001600160401b0380821115613f7f57600080fd5b818501915085601f830112613f9357600080fd5b8135613fa1611b7d82611afb565b81815260059190911b83018401908481019088831115613fc057600080fd5b8585015b83811015613ff857803585811115613fdc5760008081fd5b613fea8b89838a0101611d36565b845250918601918601613fc4565b5098975050505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561405a57603f19888603018452614048858351611de1565b9450928501929085019060010161402c565b5092979650505050505050565b6000602080838503121561407a57600080fd5b82356001600160401b0381111561409057600080fd5b8301601f810185136140a157600080fd5b80356140af611b7d82611afb565b81815260059190911b820183019083810190878311156140ce57600080fd5b928401925b82841015611bc6576140e484611e3a565b825292840192908401906140d3565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160981b03168352928401929184019160010161410f565b80356001600160b01b0381168114611a2f57600080fd5b60006020828403121561415d57600080fd5b611a4f82614134565b6000602080838503121561417957600080fd5b82356001600160401b0381111561418f57600080fd5b8301601f810185136141a057600080fd5b80356141ae611b7d82611afb565b81815260059190911b820183019083810190878311156141cd57600080fd5b928401925b82841015611bc6576141e384612dce565b825292840192908401906141d2565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160100b8352928401929184019160010161420e565b60006020828403121561423f57600080fd5b611a4f826137c6565b6000602080838503121561425b57600080fd5b82356001600160401b0381111561427157600080fd5b8301601f8101851361428257600080fd5b8035614290611b7d82611afb565b81815260059190911b820183019083810190878311156142af57600080fd5b928401925b82841015611bc6576142c5846127c3565b825292840192908401906142b4565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160190b835292840192918401916001016142f0565b80356001600160881b0381168114611a2f57600080fd5b6000602080838503121561433957600080fd5b82356001600160401b0381111561434f57600080fd5b8301601f8101851361436057600080fd5b803561436e611b7d82611afb565b81815260059190911b8201830190838101908783111561438d57600080fd5b928401925b82841015611bc6576143a38461430f565b82529284019290840190614392565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160881b0316835292840192918401916001016143ce565b6000602080838503121561440657600080fd5b82356001600160401b0381111561441c57600080fd5b8301601f8101851361442d57600080fd5b803561443b611b7d82611afb565b81815260059190911b8201830190838101908783111561445a57600080fd5b928401925b82841015611bc65761447084613c61565b8252928401929084019061445f565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601b0b8352928401929184019160010161449b565b600060208083850312156144cd57600080fd5b82356001600160401b03808211156144e457600080fd5b818501915085601f8301126144f857600080fd5b8135614506611b7d82611afb565b81815260059190911b8301840190848101908883111561452557600080fd5b8585015b83811015613ff8578035858111156145415760008081fd5b61454f8b89838a0101611d36565b845250918601918601614529565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561405a57603f198886030184526145a0858351611de1565b94509285019290850190600101614584565b6000602082840312156145c457600080fd5b611a4f82613125565b8035601881900b8114611a2f57600080fd5b6000602082840312156145f157600080fd5b611a4f826145cd565b60006020828403121561460c57600080fd5b611a4f826129e5565b80356001600160b81b0381168114611a2f57600080fd5b60006020828403121561463e57600080fd5b611a4f82614615565b60006020828403121561465957600080fd5b611a4f826126a2565b6000602080838503121561467557600080fd5b82356001600160401b0381111561468b57600080fd5b8301601f8101851361469c57600080fd5b80356146aa611b7d82611afb565b81815260059190911b820183019083810190878311156146c957600080fd5b928401925b82841015611bc6576146df84614134565b825292840192908401906146ce565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160b01b03168352928401929184019160010161470a565b60006020828403121561474157600080fd5b611a4f82612b4c565b60006020828403121561475c57600080fd5b611a4f82611b1e565b6000602080838503121561477857600080fd5b82356001600160401b0381111561478e57600080fd5b8301601f8101851361479f57600080fd5b80356147ad611b7d82611afb565b81815260059190911b820183019083810190878311156147cc57600080fd5b928401925b82841015611bc6576147e284611a88565b825292840192908401906147d1565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600c0b8352928401929184019160010161480d565b60006020828403121561483e57600080fd5b611a4f82613d6a565b6000602080838503121561485a57600080fd5b82356001600160401b0381111561487057600080fd5b8301601f8101851361488157600080fd5b803561488f611b7d82611afb565b81815260059190911b820183019083810190878311156148ae57600080fd5b928401925b82841015611bc6576148c484612e28565b825292840192908401906148b3565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835168ffffffffffffffffff16835292840192918401916001016148ef565b8035600e81900b8114611a2f57600080fd5b6000602080838503121561493b57600080fd5b82356001600160401b0381111561495157600080fd5b8301601f8101851361496257600080fd5b8035614970611b7d82611afb565b81815260059190911b8201830190838101908783111561498f57600080fd5b928401925b82841015611bc6576149a584614916565b82529284019290840190614994565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600e0b835292840192918401916001016149d0565b8035600581900b8114611a2f57600080fd5b600060208284031215614a1357600080fd5b611a4f826149ef565b600060208284031215614a2e57600080fd5b611a4f82613a82565b60006020808385031215614a4a57600080fd5b82356001600160401b03811115614a6057600080fd5b8301601f81018513614a7157600080fd5b8035614a7f611b7d82611afb565b81815260059190911b82018301908381019087831115614a9e57600080fd5b928401925b82841015611bc657614ab484613a50565b82529284019290840190614aa3565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160681b031683529284019291840191600101614adf565b600060208284031215614b1657600080fd5b611a4f82614916565b600060208284031215614b3157600080fd5b611a4f826131fe565b600060208284031215614b4c57600080fd5b611a4f82611e6c565b600060208284031215614b6757600080fd5b611a4f8261430f565b600060208284031215614b8257600080fd5b611a4f826124f7565b60006020808385031215614b9e57600080fd5b82356001600160401b03811115614bb457600080fd5b8301601f81018513614bc557600080fd5b8035614bd3611b7d82611afb565b81815260059190911b82018301908381019087831115614bf257600080fd5b928401925b82841015611bc657614c08846149ef565b82529284019290840190614bf7565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160050b83529284019291840191600101614c33565b600060208284031215614c6457600080fd5b611a4f82611f72565b60006020808385031215614c8057600080fd5b82356001600160401b03811115614c9657600080fd5b8301601f81018513614ca757600080fd5b8035614cb5611b7d82611afb565b81815260059190911b82018301908381019087831115614cd457600080fd5b928401925b82841015611bc657614cea84611f45565b82529284019290840190614cd9565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160120b83529284019291840191600101614d15565b600060208284031215614d4657600080fd5b611a4f82612ce2565b600060208284031215614d6157600080fd5b611a4f82612304565b60006020808385031215614d7d57600080fd5b82356001600160401b03811115614d9357600080fd5b8301601f81018513614da457600080fd5b8035614db2611b7d82611afb565b81815260059190911b82018301908381019087831115614dd157600080fd5b928401925b82841015611bc657614de7846145cd565b82529284019290840190614dd6565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160180b83529284019291840191600101614e12565b600060208284031215614e4357600080fd5b611a4f8261349d565b80356001600160e01b0381168114611a2f57600080fd5b600060208284031215614e7557600080fd5b611a4f82614e4c565b60006020808385031215614e9157600080fd5b82356001600160401b03811115614ea757600080fd5b8301601f81018513614eb857600080fd5b8035614ec6611b7d82611afb565b81815260059190911b82018301908381019087831115614ee557600080fd5b928401925b82841015611bc657614efb8461365d565b82529284019290840190614eea565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160090b83529284019291840191600101614f26565b60006020808385031215614f5857600080fd5b82356001600160401b03811115614f6e57600080fd5b8301601f81018513614f7f57600080fd5b8035614f8d611b7d82611afb565b81815260059190911b82018301908381019087831115614fac57600080fd5b928401925b82841015611bc657614fc284614e4c565b82529284019290840190614fb1565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160e01b031683529284019291840191600101614fed565b80356001600160d01b0381168114611a2f57600080fd5b60006020828403121561503b57600080fd5b611a4f82615012565b60006020828403121561505657600080fd5b611a4f8261357f565b63ffffffff841681526001600160401b038316602082015260606040820152600061508d6060830184611de1565b95945050505050565b6000602082840312156150a857600080fd5b611a4f82613966565b6000602082840312156150c357600080fd5b611a4f826128d4565b80356001600160e81b0381168114611a2f57600080fd5b6000602082840312156150f557600080fd5b611a4f826150cc565b6000602080838503121561511157600080fd5b82356001600160401b0381111561512757600080fd5b8301601f8101851361513857600080fd5b8035615146611b7d82611afb565b81815260059190911b8201830190838101908783111561516557600080fd5b928401925b82841015611bc65761517b84612dfb565b8252928401929084019061516a565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601c0b835292840192918401916001016151a6565b6000602082840312156151d757600080fd5b611a4f826127f0565b8035600881900b8114611a2f57600080fd5b6000602080838503121561520557600080fd5b82356001600160401b0381111561521b57600080fd5b8301601f8101851361522c57600080fd5b803561523a611b7d82611afb565b81815260059190911b8201830190838101908783111561525957600080fd5b928401925b82841015611bc65761526f846151e0565b8252928401929084019061525e565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160080b8352928401929184019160010161529a565b600060208083850312156152cc57600080fd5b82356001600160401b038111156152e257600080fd5b8301601f810185136152f357600080fd5b8035615301611b7d82611afb565b81815260059190911b8201830190838101908783111561532057600080fd5b928401925b82841015611bc657615336846132e2565b82529284019290840190615325565b602080825282518282018190526000919084820190604085019084805b82811015615380578451820b84529385019392850192600101615362565b5091979650505050505050565b600060208083850312156153a057600080fd5b82356001600160401b038111156153b657600080fd5b8301601f810185136153c757600080fd5b80356153d5611b7d82611afb565b81815260059190911b820183019083810190878311156153f457600080fd5b928401925b82841015611bc65761540a8461277b565b825292840192908401906153f9565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601d0b83529284019291840191600101615435565b6000602080838503121561546757600080fd5b82356001600160401b0381111561547d57600080fd5b8301601f8101851361548e57600080fd5b803561549c611b7d82611afb565b81815260059190911b820183019083810190878311156154bb57600080fd5b928401925b82841015611bc6576154d184611c82565b825292840192908401906154c0565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160040b835292840192918401916001016154fc565b6000602080838503121561552e57600080fd5b82356001600160401b0381111561554457600080fd5b8301601f8101851361555557600080fd5b8035615563611b7d82611afb565b81815260059190911b8201830190838101908783111561558257600080fd5b928401925b82841015611bc65761559884613e44565b82529284019290840190615587565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160020b835292840192918401916001016155c3565b600060208083850312156155f557600080fd5b82356001600160401b0381111561560b57600080fd5b8301601f8101851361561c57600080fd5b803561562a611b7d82611afb565b81815260059190911b8201830190838101908783111561564957600080fd5b928401925b82841015611bc65761565f846150cc565b8252928401929084019061564e565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160e81b03168352928401929184019160010161568a565b600060208083850312156156c257600080fd5b82356001600160401b038111156156d857600080fd5b8301601f810185136156e957600080fd5b80356156f7611b7d82611afb565b81815260059190911b8201830190838101908783111561571657600080fd5b928401925b82841015611bc65761572c8461368a565b8252928401929084019061571b565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160170b83529284019291840191600101615757565b60006020828403121561578857600080fd5b611a4f826151e0565b600060208083850312156157a457600080fd5b82356001600160401b038111156157ba57600080fd5b8301601f810185136157cb57600080fd5b80356157d9611b7d82611afb565b81815260059190911b820183019083810190878311156157f857600080fd5b928401925b82841015611bc65761580e84612e5c565b825292840192908401906157fd565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160070b83529284019291840191600101615839565b60006020828403121561586a57600080fd5b611a4f82613e71565b60006020828403121561588557600080fd5b611a4f82613c8e565b600060208083850312156158a157600080fd5b82356001600160401b038111156158b757600080fd5b8301601f810185136158c857600080fd5b80356158d6611b7d82611afb565b81815260059190911b820183019083810190878311156158f557600080fd5b928401925b82841015611bc65761590b84611a18565b825292840192908401906158fa565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160801b031683529284019291840191600101615936565b6000602080838503121561596e57600080fd5b82356001600160401b0381111561598457600080fd5b8301601f8101851361599557600080fd5b80356159a3611b7d82611afb565b81815260059190911b820183019083810190878311156159c257600080fd5b928401925b82841015611bc6576159d884615012565b825292840192908401906159c7565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160d01b031683529284019291840191600101615a03565b60006020808385031215615a3b57600080fd5b82356001600160401b03811115615a5157600080fd5b8301601f81018513615a6257600080fd5b8035615a70611b7d82611afb565b81815260059190911b82018301908381019087831115615a8f57600080fd5b928401925b82841015611bc657615aa584614615565b82529284019290840190615a94565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160b81b031683529284019291840191600101615ad0565b602081526000825160406020840152615b116060840182611de1565b9050602084015160408401528091505092915050565b60006020808385031215615b3a57600080fd5b82356001600160401b03811115615b5057600080fd5b8301601f81018513615b6157600080fd5b8035615b6f611b7d82611afb565b81815260059190911b82018301908381019087831115615b8e57600080fd5b928401925b82841015611bc657615ba484611c1e565b82529284019290840190615b93565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160781b031683529284019291840191600101615bcf565b60006020808385031215615c0757600080fd5b82356001600160401b03811115615c1d57600080fd5b8301601f81018513615c2e57600080fd5b8035615c3c611b7d82611afb565b81815260059190911b82018301908381019087831115615c5b57600080fd5b928401925b82841015611bc657615c7184611a56565b82529284019290840190615c60565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160601b031683529284019291840191600101615c9c565b600060208284031215615cd357600080fd5b611a4f82613b81565b634e487b7160e01b600052601160045260246000fd5b600081810b9083900b01607f8113607f1982121715615d1357615d13615cdc565b92915050565b8082018281126000831280158216821582161715615d3957615d39615cdc565b505092915050565b63ffffffff828116828216039080821115615d5e57615d5e615cdc565b5092915050565b600481810b9083900b01647fffffffff8113647fffffffff1982121715615d1357615d13615cdc565b600181811c90821680615da257607f821691505b602082108103615dc257634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220a5b87b6881e1a012e4a59d55c230cfcf3a2342b83efdbfb3c5f5cfa532fc854864736f6c63430008120033"; + private static final String SMART_CONTRACT_BYTECODE = + "60806040523480156200001157600080fd5b5060408051608081018252600491810191825263082d8caf60e31b6060820152818152600160208201529060009081906200004d908262000106565b5060208201518160010155905050620001d2565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200008c57607f821691505b602082108103620000ad57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010157600081815260208120601f850160051c81016020861015620000dc5750805b601f850160051c820191505b81811015620000fd57828155600101620000e8565b5050505b505050565b81516001600160401b0381111562000122576200012262000061565b6200013a8162000133845462000077565b84620000b3565b602080601f831160018114620001725760008415620001595750858301515b600019600386901b1c1916600185901b178555620000fd565b600085815260208120601f198616915b82811015620001a35788860151825594840194600190910190840162000182565b5085821015620001c25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b615dfe80620001e26000396000f3fe608060405234801561001057600080fd5b50600436106108355760003560e01c80637f8082f711610437578063c5882dbb11610236578063e2a345291161013b578063f6e877f4116100c3578063fafc3b9911610092578063fafc3b9914611857578063fba1bc4c14611872578063febe099714611887578063ff5f54dd146118a2578063ffb80501146118bd57600080fd5b8063f6e877f4146117d9578063f8293f6e146117ff578063f914c4d214611821578063f962326a1461183c57600080fd5b8063eceda56a1161010a578063eceda56a1461174c578063ef65066114611767578063f0ebb92214611782578063f4e490f51461179d578063f680c24a146117be57600080fd5b8063e2a34529146116d8578063e4b90944146116f3578063e713cda81461170e578063ea945d301461173157600080fd5b8063d79d4d40116101be578063e05e91e01161018d578063e05e91e014611630578063e066de5014611656578063e0cddc551461167c578063e0f53e2414611697578063e1dbb318146116bd57600080fd5b8063d79d4d4014611592578063dade0c0b146115b8578063dbb04ed9146115da578063de9fb4841461160357600080fd5b8063cbd2e6a511610205578063cbd2e6a514611511578063cdb9e4e814611536578063cf7c3dfc1461155c578063d1b10ad714610ada578063d33c57501461157757600080fd5b8063c5882dbb1461148b578063c6c18a1c146114a6578063c7d8b87e146114d0578063cb47cdae146114f657600080fd5b8063a1bda1221161033c578063b5abe7df116102c4578063ba945bdb11610293578063ba945bdb146113dc578063bb6b524314611402578063bd90536a14611428578063be63d0b814611450578063c503772d1461146b57600080fd5b8063b5abe7df14611359578063b834bfe914611374578063b8da8d1614611395578063b989c7ee146113bb57600080fd5b8063aa016e681161030b578063aa016e68146112dc578063aa80ca2e14610c6b578063b2325c35146112f7578063b2db404a14611312578063b4e3e7b11461133357600080fd5b8063a1bda12214611259578063a401d60d1461127a578063a57ebf10146112a0578063a75761f1146112bb57600080fd5b80638f2805e0116103bf57806394cd7c801161038e57806394cd7c80146111b557806398508ba3146111d65780639b1794ae146111f7578063a08b9f671461121d578063a19962341461123e57600080fd5b80638f2805e0146111435780638ff4cfee1461115e578063909c5b2414611179578063923f5edf1461119457600080fd5b806386aba5a71161040657806386aba5a7146110ab578063881c8fb7146110c657806388b1dd37146110ec57806388b7e6f5146111075780638d7f60151461112857600080fd5b80637f8082f714610c6b578063817b24541461107557806381dbe13e14611090578063827147ce1461099a57600080fd5b806338fa6658116106435780635a8fd3b51161054857806370a5cb81116104d05780637ba844771161049f5780637ba8447714610fe25780637d0dc26214610ffd5780637d906c551461101e5780637e281630146110395780637ec32d841461105457600080fd5b806370a5cb8114610f5a57806372a06b4d14610f80578063737b801614610fa1578063796a27ea14610fbc57600080fd5b806369cbe0561161051757806369cbe05614610ecd5780636a54715c14610ee85780636a75c12f14610f095780636a9929db14610f245780636ee8f39c14610f3f57600080fd5b80635a8fd3b514610e4f578063628bc3ef14610e6a57806364e008c114610e8b57806368ef446614610eac57600080fd5b80634bbc9a67116105cb578063545e21131161059a578063545e211314610dd157806355f232a414610dfe57806357890ba914610e1957806357d9c08b14610e3457806359adb2df14610ada57600080fd5b80634bbc9a6714610d655780634e96247314610d80578063501297c214610d9b57806350370d8514610db657600080fd5b80633f396e67116106125780633f396e6714610ce3578063407b899b14610d0b578063435a33a814610d2c57806344e7b03714610af657806348d848d014610d4757600080fd5b806338fa665814610c6b5780633a73007714610c865780633b45e6e014610ca15780633e1a277114610cc257600080fd5b80631e9aa70f116107495780632ef16e8e116106d15780633135d681116106a05780633135d68114610beb57806333520ec314610c0657806333edb89614610c275780633729a2da14610c42578063382d087314610c5057600080fd5b80632ef16e8e14610b6d5780632f47a40d14610b8e5780632f6c1bb414610baf578063309f9ac914610bd057600080fd5b806322937ea91161071857806322937ea914610ada5780632421101f14610af657806324c3c3d214610b1c57806328a30eb714610b375780632a3082ce14610b5257600080fd5b80631e9aa70f14610a6e578063203ae83a14610a8957806321d1730b14610aa45780632234ea0214610abf57600080fd5b8063118b8415116107cc57806312b932a71161079b57806312b932a7146109db57806312cd95a1146109f657806315832ae414610a17578063189cea8e14610a325780631d11456214610a5357600080fd5b8063118b84151461095857806311ec6c9014610979578063126bc8151461099a578063129ed5da146109b557600080fd5b806306ac6fe11161080857806306ac6fe1146108ca57806308123e09146108f05780630a958dc81461091657806310d545531461093757600080fd5b8063017fa10b1461083a578063021d88ab14610868578063037454301461088e5780630577a846146108af575b600080fd5b61084b610848366004611a34565b90565b6040516001600160801b0390911681526020015b60405180910390f35b610876610848366004611a6d565b6040516001600160601b03909116815260200161085f565b61089c610848366004611a9a565b604051600c9190910b815260200161085f565b6108bd610848366004611b35565b60405161085f9190611bd1565b6108d8610848366004611c35565b6040516001600160781b03909116815260200161085f565b6108fe610848366004611c67565b60405166ffffffffffffff909116815260200161085f565b610924610848366004611c94565b60405160049190910b815260200161085f565b610945610848366004611cc1565b60405160119190910b815260200161085f565b610966610848366004611cee565b604051601e9190910b815260200161085f565b610987610848366004611d1b565b60405160139190910b815260200161085f565b6109a8610848366004611da5565b60405161085f9190611e27565b6109c3610848366004611e51565b6040516001600160981b03909116815260200161085f565b6109e9610848366004611e7e565b60405161085f9190611f0a565b610a04610848366004611f57565b60405160129190910b815260200161085f565b610a25610848366004611f83565b60405161085f919061200f565b610a4061084836600461205c565b60405160169190910b815260200161085f565b610a6161084836600461208f565b60405161085f919061211d565b610a7c610848366004612170565b60405161085f91906121fc565b610a97610848366004612237565b60405161085f91906122c3565b610ab261084836600461231b565b60405161085f91906123a7565b610acd6108483660046123fa565b60405161085f9190612486565b610ae86108483660046124c1565b60405190815260200161085f565b610b046108483660046124da565b6040516001600160a01b03909116815260200161085f565b610b2a61084836600461250e565b60405161085f919061259a565b610b456108483660046125db565b60405161085f9190612667565b610b606108483660046126b4565b60405161085f9190612740565b610b7b61084836600461278d565b604051601d9190910b815260200161085f565b610b9c6108483660046127a8565b604051600a9190910b815260200161085f565b610bbd6108483660046127d5565b60405160199190910b815260200161085f565b610bde610848366004612807565b60405161085f9190612893565b610bf96108483660046128eb565b60405161085f9190612977565b610c146108483660046129ca565b604051601a9190910b815260200161085f565b610c356108483660046129f7565b60405161085f9190612a83565b610a61610848366004612abe565b610c5e610848366004612b5e565b60405161085f9190612bea565b610c79610848366004612c25565b60405161085f9190612caa565b610c94610848366004612cfd565b60405161085f9190612d89565b610caf610848366004612de0565b60405160109190910b815260200161085f565b610cd0610848366004612e0d565b604051601c9190910b815260200161085f565b610cf1610848366004612e41565b60405168ffffffffffffffffff909116815260200161085f565b610d19610848366004612e6e565b60405160079190910b815260200161085f565b610d3a610848366004612e89565b60405161085f9190612f15565b610d55610848366004612f60565b604051901515815260200161085f565b610d73610848366004612f7b565b60405161085f9190613007565b610d8e610848366004613058565b60405161085f91906130e4565b610da9610848366004613137565b60405161085f91906131c3565b610dc4610848366004613215565b60405161085f91906132a1565b610de4610ddf3660046132f4565b6118e1565b60408051600093840b81529190920b60208201520161085f565b610e0c61084836600461330f565b60405161085f919061339b565b610e276108483660046133d6565b60405161085f9190613462565b610e426108483660046134b3565b60405161085f919061353f565b610e5d610848366004613593565b60405161085f919061361f565b610e7861084836600461366f565b60405160099190910b815260200161085f565b610e9961084836600461369c565b60405160179190910b815260200161085f565b610eba6108483660046136b7565b60405160149190910b815260200161085f565b610edb6108483660046136e4565b60405161085f9190613770565b610ef66108483660046137ab565b60405160069190910b815260200161085f565b610f176108483660046137d8565b60405161085f9190613864565b610f3261084836600461389f565b60405161085f919061392b565b610f4d610848366004613980565b60405161085f9190613a0c565b610f68610848366004613a67565b6040516001600160681b03909116815260200161085f565b610f8e6108483660046132f4565b60405160009190910b815260200161085f565b610faf610848366004613a99565b60405161085f9190613b25565b610fca610848366004613b66565b6040516001600160d81b03909116815260200161085f565b610ff0610848366004613b96565b60405161085f9190613c22565b61100b610848366004613c73565b604051601b9190910b815260200161085f565b61102c610848366004613ca1565b60405161085f9190613d2d565b611047610848366004613d7c565b60405161085f9190613e08565b611062610848366004613e56565b60405160029190910b815260200161085f565b611083610848366004613e88565b60405161085f9190613f14565b61109e610848366004613f55565b60405161085f9190614005565b6110b9610848366004614067565b60405161085f91906140f3565b6110d461084836600461414b565b6040516001600160b01b03909116815260200161085f565b6110fa610848366004614166565b60405161085f91906141f2565b61111561084836600461422d565b604051600f9190910b815260200161085f565b611136610848366004614248565b60405161085f91906142d4565b611151610848366004614326565b60405161085f91906143b2565b61116c6108483660046143f3565b60405161085f919061447f565b6111876108483660046144ba565b60405161085f919061455d565b6111a26108483660046145b2565b60405160159190910b815260200161085f565b6111c36108483660046145df565b60405160189190910b815260200161085f565b6111e46108483660046145fa565b604051600d9190910b815260200161085f565b61120561084836600461462c565b6040516001600160b81b03909116815260200161085f565b61122b610848366004614647565b604051600b9190910b815260200161085f565b61124c610848366004614662565b60405161085f91906146ee565b61126761084836600461472f565b60405160019190910b815260200161085f565b61128861084836600461474a565b6040516001600160f01b03909116815260200161085f565b6112ae610848366004614765565b60405161085f91906147f1565b6112c961084836600461482c565b60405161ffff909116815260200161085f565b6112ea610848366004614847565b60405161085f91906148d3565b611305610848366004614928565b60405161085f91906149b4565b611320610848366004614a01565b60405160059190910b815260200161085f565b611341610848366004614a1c565b6040516001600160701b03909116815260200161085f565b611367610848366004614a37565b60405161085f9190614ac3565b611382610848366004614b04565b604051600e9190910b815260200161085f565b6113a3610848366004614b1f565b6040516001600160a81b03909116815260200161085f565b6113c9610848366004614b3a565b60405160039190910b815260200161085f565b6113ea610848366004614b55565b6040516001600160881b03909116815260200161085f565b611410610848366004614b70565b6040516001600160c81b03909116815260200161085f565b61143b6114363660046124c1565b6118f9565b6040805192835260208301919091520161085f565b61145e610848366004614b8b565b60405161085f9190614c17565b611479610848366004614c52565b60405160ff909116815260200161085f565b611499610848366004614c6d565b60405161085f9190614cf9565b6114b4610848366004614d34565b6040516affffffffffffffffffffff909116815260200161085f565b6114de610848366004614d4f565b6040516001600160f81b03909116815260200161085f565b611504610848366004614d6a565b60405161085f9190614df6565b61151f610848366004614e31565b60405165ffffffffffff909116815260200161085f565b611544610848366004614e63565b6040516001600160e01b03909116815260200161085f565b61156a610848366004614e7e565b60405161085f9190614f0a565b611585610848366004614f45565b60405161085f9190614fd1565b6115a0610848366004615029565b6040516001600160d01b03909116815260200161085f565b6115cb6115c6366004615044565b611908565b60405161085f9392919061505f565b6115e8610848366004615096565b60405169ffffffffffffffffffff909116815260200161085f565b611616611611366004611c94565b611946565b60408051600493840b81529190920b60208201520161085f565b61163e6108483660046150b1565b6040516001600160401b03909116815260200161085f565b6116646108483660046150e3565b6040516001600160e81b03909116815260200161085f565b61168a6108483660046150fe565b60405161085f919061518a565b6116a56108483660046151c5565b6040516001600160c01b03909116815260200161085f565b6116cb6108483660046151f2565b60405161085f919061527e565b6116e66108483660046152b9565b60405161085f9190615345565b61170161084836600461538d565b60405161085f9190615419565b61171c610848366004615044565b60405163ffffffff909116815260200161085f565b61173f610848366004615454565b60405161085f91906154e0565b61175a61084836600461551b565b60405161085f91906155a7565b6117756108483660046155e2565b60405161085f919061566e565b6117906108483660046156af565b60405161085f919061573b565b6117ab610848366004615776565b60405160089190910b815260200161085f565b6117cc610848366004615791565b60405161085f919061581d565b6117e7610848366004615858565b6040516001600160901b03909116815260200161085f565b61180d610848366004615873565b60405162ffffff909116815260200161085f565b61182f61084836600461588e565b60405161085f919061591a565b61184a61084836600461595b565b60405161085f91906159e7565b611865610848366004615a28565b60405161085f9190615ab4565b61187a611955565b60405161085f9190615af5565b611895610848366004615b27565b60405161085f9190615bb3565b6118b0610848366004615bf4565b60405161085f9190615c80565b6118cb610848366004615cc1565b60405164ffffffffff909116815260200161085f565b600080826118f0816014615cf2565b91509150915091565b600080826118f0816001615d19565b600080606083611919600182615d41565b6040805180820190915260028152614f4b60f01b602082015291945063ffffffff16925090509193909250565b600080826118f0816001615d65565b604080518082019091526060815260006020820152600060405180604001604052908160008201805461198790615d8e565b80601f01602080910402602001604051908101604052809291908181526020018280546119b390615d8e565b8015611a005780601f106119d557610100808354040283529160200191611a00565b820191906000526020600020905b8154815290600101906020018083116119e357829003601f168201915b50505050508152602001600182015481525050905090565b80356001600160801b0381168114611a2f57600080fd5b919050565b600060208284031215611a4657600080fd5b611a4f82611a18565b9392505050565b80356001600160601b0381168114611a2f57600080fd5b600060208284031215611a7f57600080fd5b611a4f82611a56565b8035600c81900b8114611a2f57600080fd5b600060208284031215611aac57600080fd5b611a4f82611a88565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611af357611af3611ab5565b604052919050565b60006001600160401b03821115611b1457611b14611ab5565b5060051b60200190565b80356001600160f01b0381168114611a2f57600080fd5b60006020808385031215611b4857600080fd5b82356001600160401b03811115611b5e57600080fd5b8301601f81018513611b6f57600080fd5b8035611b82611b7d82611afb565b611acb565b81815260059190911b82018301908381019087831115611ba157600080fd5b928401925b82841015611bc657611bb784611b1e565b82529284019290840190611ba6565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160f01b031683529284019291840191600101611bed565b50909695505050505050565b80356001600160781b0381168114611a2f57600080fd5b600060208284031215611c4757600080fd5b611a4f82611c1e565b803566ffffffffffffff81168114611a2f57600080fd5b600060208284031215611c7957600080fd5b611a4f82611c50565b8035600481900b8114611a2f57600080fd5b600060208284031215611ca657600080fd5b611a4f82611c82565b8035601181900b8114611a2f57600080fd5b600060208284031215611cd357600080fd5b611a4f82611caf565b8035601e81900b8114611a2f57600080fd5b600060208284031215611d0057600080fd5b611a4f82611cdc565b8035601381900b8114611a2f57600080fd5b600060208284031215611d2d57600080fd5b611a4f82611d09565b600082601f830112611d4757600080fd5b81356001600160401b03811115611d6057611d60611ab5565b611d73601f8201601f1916602001611acb565b818152846020838601011115611d8857600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215611db757600080fd5b81356001600160401b03811115611dcd57600080fd5b611dd984828501611d36565b949350505050565b6000815180845260005b81811015611e0757602081850181015186830182015201611deb565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611a4f6020830184611de1565b80356001600160981b0381168114611a2f57600080fd5b600060208284031215611e6357600080fd5b611a4f82611e3a565b8035600381900b8114611a2f57600080fd5b60006020808385031215611e9157600080fd5b82356001600160401b03811115611ea757600080fd5b8301601f81018513611eb857600080fd5b8035611ec6611b7d82611afb565b81815260059190911b82018301908381019087831115611ee557600080fd5b928401925b82841015611bc657611efb84611e6c565b82529284019290840190611eea565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160030b83529284019291840191600101611f26565b8035601281900b8114611a2f57600080fd5b600060208284031215611f6957600080fd5b611a4f82611f45565b803560ff81168114611a2f57600080fd5b60006020808385031215611f9657600080fd5b82356001600160401b03811115611fac57600080fd5b8301601f81018513611fbd57600080fd5b8035611fcb611b7d82611afb565b81815260059190911b82018301908381019087831115611fea57600080fd5b928401925b82841015611bc65761200084611f72565b82529284019290840190611fef565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160ff168352928401929184019160010161202b565b8035601681900b8114611a2f57600080fd5b60006020828403121561206e57600080fd5b611a4f8261204a565b6001600160a01b038116811461208c57600080fd5b50565b600060208083850312156120a257600080fd5b82356001600160401b038111156120b857600080fd5b8301601f810185136120c957600080fd5b80356120d7611b7d82611afb565b81815260059190911b820183019083810190878311156120f657600080fd5b928401925b82841015611bc657833561210e81612077565b825292840192908401906120fb565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160a01b031683529284019291840191600101612139565b8035601481900b8114611a2f57600080fd5b6000602080838503121561218357600080fd5b82356001600160401b0381111561219957600080fd5b8301601f810185136121aa57600080fd5b80356121b8611b7d82611afb565b81815260059190911b820183019083810190878311156121d757600080fd5b928401925b82841015611bc6576121ed8461215e565b825292840192908401906121dc565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160140b83529284019291840191600101612218565b6000602080838503121561224a57600080fd5b82356001600160401b0381111561226057600080fd5b8301601f8101851361227157600080fd5b803561227f611b7d82611afb565b81815260059190911b8201830190838101908783111561229e57600080fd5b928401925b82841015611bc6576122b484611c50565b825292840192908401906122a3565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835166ffffffffffffff16835292840192918401916001016122df565b80356001600160f81b0381168114611a2f57600080fd5b6000602080838503121561232e57600080fd5b82356001600160401b0381111561234457600080fd5b8301601f8101851361235557600080fd5b8035612363611b7d82611afb565b81815260059190911b8201830190838101908783111561238257600080fd5b928401925b82841015611bc65761239884612304565b82529284019290840190612387565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160f81b0316835292840192918401916001016123c3565b8035600a81900b8114611a2f57600080fd5b6000602080838503121561240d57600080fd5b82356001600160401b0381111561242357600080fd5b8301601f8101851361243457600080fd5b8035612442611b7d82611afb565b81815260059190911b8201830190838101908783111561246157600080fd5b928401925b82841015611bc657612477846123e8565b82529284019290840190612466565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600a0b835292840192918401916001016124a2565b6000602082840312156124d357600080fd5b5035919050565b6000602082840312156124ec57600080fd5b8135611a4f81612077565b80356001600160c81b0381168114611a2f57600080fd5b6000602080838503121561252157600080fd5b82356001600160401b0381111561253757600080fd5b8301601f8101851361254857600080fd5b8035612556611b7d82611afb565b81815260059190911b8201830190838101908783111561257557600080fd5b928401925b82841015611bc65761258b846124f7565b8252928401929084019061257a565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160c81b0316835292840192918401916001016125b6565b600060208083850312156125ee57600080fd5b82356001600160401b0381111561260457600080fd5b8301601f8101851361261557600080fd5b8035612623611b7d82611afb565b81815260059190911b8201830190838101908783111561264257600080fd5b928401925b82841015611bc65761265884611d09565b82529284019290840190612647565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160130b83529284019291840191600101612683565b8035600b81900b8114611a2f57600080fd5b600060208083850312156126c757600080fd5b82356001600160401b038111156126dd57600080fd5b8301601f810185136126ee57600080fd5b80356126fc611b7d82611afb565b81815260059190911b8201830190838101908783111561271b57600080fd5b928401925b82841015611bc657612731846126a2565b82529284019290840190612720565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600b0b8352928401929184019160010161275c565b8035601d81900b8114611a2f57600080fd5b60006020828403121561279f57600080fd5b611a4f8261277b565b6000602082840312156127ba57600080fd5b611a4f826123e8565b8035601981900b8114611a2f57600080fd5b6000602082840312156127e757600080fd5b611a4f826127c3565b80356001600160c01b0381168114611a2f57600080fd5b6000602080838503121561281a57600080fd5b82356001600160401b0381111561283057600080fd5b8301601f8101851361284157600080fd5b803561284f611b7d82611afb565b81815260059190911b8201830190838101908783111561286e57600080fd5b928401925b82841015611bc657612884846127f0565b82529284019290840190612873565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160c01b0316835292840192918401916001016128af565b80356001600160401b0381168114611a2f57600080fd5b600060208083850312156128fe57600080fd5b82356001600160401b0381111561291457600080fd5b8301601f8101851361292557600080fd5b8035612933611b7d82611afb565b81815260059190911b8201830190838101908783111561295257600080fd5b928401925b82841015611bc657612968846128d4565b82529284019290840190612957565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160401b031683529284019291840191600101612993565b8035601a81900b8114611a2f57600080fd5b6000602082840312156129dc57600080fd5b611a4f826129b8565b8035600d81900b8114611a2f57600080fd5b60006020808385031215612a0a57600080fd5b82356001600160401b03811115612a2057600080fd5b8301601f81018513612a3157600080fd5b8035612a3f611b7d82611afb565b81815260059190911b82018301908381019087831115612a5e57600080fd5b928401925b82841015611bc657612a74846129e5565b82529284019290840190612a63565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600d0b83529284019291840191600101612a9f565b60006020808385031215612ad157600080fd5b82356001600160401b03811115612ae757600080fd5b8301601f81018513612af857600080fd5b8035612b06611b7d82611afb565b81815260059190911b82018301908381019087831115612b2557600080fd5b928401925b82841015611bc6578335612b3d81612077565b82529284019290840190612b2a565b8035600181900b8114611a2f57600080fd5b60006020808385031215612b7157600080fd5b82356001600160401b03811115612b8757600080fd5b8301601f81018513612b9857600080fd5b8035612ba6611b7d82611afb565b81815260059190911b82018301908381019087831115612bc557600080fd5b928401925b82841015611bc657612bdb84612b4c565b82529284019290840190612bca565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600190810b8452938501939285019201612c06565b60006020808385031215612c3857600080fd5b82356001600160401b03811115612c4e57600080fd5b8301601f81018513612c5f57600080fd5b8035612c6d611b7d82611afb565b81815260059190911b82018301908381019087831115612c8c57600080fd5b928401925b82841015611bc657833582529284019290840190612c91565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835183529284019291840191600101612cc6565b80356affffffffffffffffffffff81168114611a2f57600080fd5b60006020808385031215612d1057600080fd5b82356001600160401b03811115612d2657600080fd5b8301601f81018513612d3757600080fd5b8035612d45611b7d82611afb565b81815260059190911b82018301908381019087831115612d6457600080fd5b928401925b82841015611bc657612d7a84612ce2565b82529284019290840190612d69565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516affffffffffffffffffffff1683529284019291840191600101612da5565b8035601081900b8114611a2f57600080fd5b600060208284031215612df257600080fd5b611a4f82612dce565b8035601c81900b8114611a2f57600080fd5b600060208284031215612e1f57600080fd5b611a4f82612dfb565b803568ffffffffffffffffff81168114611a2f57600080fd5b600060208284031215612e5357600080fd5b611a4f82612e28565b8035600781900b8114611a2f57600080fd5b600060208284031215612e8057600080fd5b611a4f82612e5c565b60006020808385031215612e9c57600080fd5b82356001600160401b03811115612eb257600080fd5b8301601f81018513612ec357600080fd5b8035612ed1611b7d82611afb565b81815260059190911b82018301908381019087831115612ef057600080fd5b928401925b82841015611bc657612f06846129b8565b82529284019290840190612ef5565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601a0b83529284019291840191600101612f31565b80358015158114611a2f57600080fd5b600060208284031215612f7257600080fd5b611a4f82612f50565b60006020808385031215612f8e57600080fd5b82356001600160401b03811115612fa457600080fd5b8301601f81018513612fb557600080fd5b8035612fc3611b7d82611afb565b81815260059190911b82018301908381019087831115612fe257600080fd5b928401925b82841015611bc657612ff884612f50565b82529284019290840190612fe7565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351151583529284019291840191600101613023565b80356001600160d81b0381168114611a2f57600080fd5b6000602080838503121561306b57600080fd5b82356001600160401b0381111561308157600080fd5b8301601f8101851361309257600080fd5b80356130a0611b7d82611afb565b81815260059190911b820183019083810190878311156130bf57600080fd5b928401925b82841015611bc6576130d584613041565b825292840192908401906130c4565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160d81b031683529284019291840191600101613100565b8035601581900b8114611a2f57600080fd5b6000602080838503121561314a57600080fd5b82356001600160401b0381111561316057600080fd5b8301601f8101851361317157600080fd5b803561317f611b7d82611afb565b81815260059190911b8201830190838101908783111561319e57600080fd5b928401925b82841015611bc6576131b484613125565b825292840192908401906131a3565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160150b835292840192918401916001016131df565b80356001600160a81b0381168114611a2f57600080fd5b6000602080838503121561322857600080fd5b82356001600160401b0381111561323e57600080fd5b8301601f8101851361324f57600080fd5b803561325d611b7d82611afb565b81815260059190911b8201830190838101908783111561327c57600080fd5b928401925b82841015611bc657613292846131fe565b82529284019290840190613281565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160a81b0316835292840192918401916001016132bd565b8035600081900b8114611a2f57600080fd5b60006020828403121561330657600080fd5b611a4f826132e2565b6000602080838503121561332257600080fd5b82356001600160401b0381111561333857600080fd5b8301601f8101851361334957600080fd5b8035613357611b7d82611afb565b81815260059190911b8201830190838101908783111561337657600080fd5b928401925b82841015611bc65761338c84611caf565b8252928401929084019061337b565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160110b835292840192918401916001016133b7565b600060208083850312156133e957600080fd5b82356001600160401b038111156133ff57600080fd5b8301601f8101851361341057600080fd5b803561341e611b7d82611afb565b81815260059190911b8201830190838101908783111561343d57600080fd5b928401925b82841015611bc6576134538461204a565b82529284019290840190613442565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160160b8352928401929184019160010161347e565b803565ffffffffffff81168114611a2f57600080fd5b600060208083850312156134c657600080fd5b82356001600160401b038111156134dc57600080fd5b8301601f810185136134ed57600080fd5b80356134fb611b7d82611afb565b81815260059190911b8201830190838101908783111561351a57600080fd5b928401925b82841015611bc6576135308461349d565b8252928401929084019061351f565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835165ffffffffffff168352928401929184019160010161355b565b803563ffffffff81168114611a2f57600080fd5b600060208083850312156135a657600080fd5b82356001600160401b038111156135bc57600080fd5b8301601f810185136135cd57600080fd5b80356135db611b7d82611afb565b81815260059190911b820183019083810190878311156135fa57600080fd5b928401925b82841015611bc6576136108461357f565b825292840192908401906135ff565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835163ffffffff168352928401929184019160010161363b565b8035600981900b8114611a2f57600080fd5b60006020828403121561368157600080fd5b611a4f8261365d565b8035601781900b8114611a2f57600080fd5b6000602082840312156136ae57600080fd5b611a4f8261368a565b6000602082840312156136c957600080fd5b611a4f8261215e565b8035600681900b8114611a2f57600080fd5b600060208083850312156136f757600080fd5b82356001600160401b0381111561370d57600080fd5b8301601f8101851361371e57600080fd5b803561372c611b7d82611afb565b81815260059190911b8201830190838101908783111561374b57600080fd5b928401925b82841015611bc657613761846136d2565b82529284019290840190613750565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160060b8352928401929184019160010161378c565b6000602082840312156137bd57600080fd5b611a4f826136d2565b8035600f81900b8114611a2f57600080fd5b600060208083850312156137eb57600080fd5b82356001600160401b0381111561380157600080fd5b8301601f8101851361381257600080fd5b8035613820611b7d82611afb565b81815260059190911b8201830190838101908783111561383f57600080fd5b928401925b82841015611bc657613855846137c6565b82529284019290840190613844565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600f0b83529284019291840191600101613880565b600060208083850312156138b257600080fd5b82356001600160401b038111156138c857600080fd5b8301601f810185136138d957600080fd5b80356138e7611b7d82611afb565b81815260059190911b8201830190838101908783111561390657600080fd5b928401925b82841015611bc65761391c84611cdc565b8252928401929084019061390b565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601e0b83529284019291840191600101613947565b803569ffffffffffffffffffff81168114611a2f57600080fd5b6000602080838503121561399357600080fd5b82356001600160401b038111156139a957600080fd5b8301601f810185136139ba57600080fd5b80356139c8611b7d82611afb565b81815260059190911b820183019083810190878311156139e757600080fd5b928401925b82841015611bc6576139fd84613966565b825292840192908401906139ec565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835169ffffffffffffffffffff1683529284019291840191600101613a28565b80356001600160681b0381168114611a2f57600080fd5b600060208284031215613a7957600080fd5b611a4f82613a50565b80356001600160701b0381168114611a2f57600080fd5b60006020808385031215613aac57600080fd5b82356001600160401b03811115613ac257600080fd5b8301601f81018513613ad357600080fd5b8035613ae1611b7d82611afb565b81815260059190911b82018301908381019087831115613b0057600080fd5b928401925b82841015611bc657613b1684613a82565b82529284019290840190613b05565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160701b031683529284019291840191600101613b41565b600060208284031215613b7857600080fd5b611a4f82613041565b803564ffffffffff81168114611a2f57600080fd5b60006020808385031215613ba957600080fd5b82356001600160401b03811115613bbf57600080fd5b8301601f81018513613bd057600080fd5b8035613bde611b7d82611afb565b81815260059190911b82018301908381019087831115613bfd57600080fd5b928401925b82841015611bc657613c1384613b81565b82529284019290840190613c02565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835164ffffffffff1683529284019291840191600101613c3e565b8035601b81900b8114611a2f57600080fd5b600060208284031215613c8557600080fd5b611a4f82613c61565b803562ffffff81168114611a2f57600080fd5b60006020808385031215613cb457600080fd5b82356001600160401b03811115613cca57600080fd5b8301601f81018513613cdb57600080fd5b8035613ce9611b7d82611afb565b81815260059190911b82018301908381019087831115613d0857600080fd5b928401925b82841015611bc657613d1e84613c8e565b82529284019290840190613d0d565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835162ffffff1683529284019291840191600101613d49565b803561ffff81168114611a2f57600080fd5b60006020808385031215613d8f57600080fd5b82356001600160401b03811115613da557600080fd5b8301601f81018513613db657600080fd5b8035613dc4611b7d82611afb565b81815260059190911b82018301908381019087831115613de357600080fd5b928401925b82841015611bc657613df984613d6a565b82529284019290840190613de8565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835161ffff1683529284019291840191600101613e24565b8035600281900b8114611a2f57600080fd5b600060208284031215613e6857600080fd5b611a4f82613e44565b80356001600160901b0381168114611a2f57600080fd5b60006020808385031215613e9b57600080fd5b82356001600160401b03811115613eb157600080fd5b8301601f81018513613ec257600080fd5b8035613ed0611b7d82611afb565b81815260059190911b82018301908381019087831115613eef57600080fd5b928401925b82841015611bc657613f0584613e71565b82529284019290840190613ef4565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160901b031683529284019291840191600101613f30565b60006020808385031215613f6857600080fd5b82356001600160401b0380821115613f7f57600080fd5b818501915085601f830112613f9357600080fd5b8135613fa1611b7d82611afb565b81815260059190911b83018401908481019088831115613fc057600080fd5b8585015b83811015613ff857803585811115613fdc5760008081fd5b613fea8b89838a0101611d36565b845250918601918601613fc4565b5098975050505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561405a57603f19888603018452614048858351611de1565b9450928501929085019060010161402c565b5092979650505050505050565b6000602080838503121561407a57600080fd5b82356001600160401b0381111561409057600080fd5b8301601f810185136140a157600080fd5b80356140af611b7d82611afb565b81815260059190911b820183019083810190878311156140ce57600080fd5b928401925b82841015611bc6576140e484611e3a565b825292840192908401906140d3565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160981b03168352928401929184019160010161410f565b80356001600160b01b0381168114611a2f57600080fd5b60006020828403121561415d57600080fd5b611a4f82614134565b6000602080838503121561417957600080fd5b82356001600160401b0381111561418f57600080fd5b8301601f810185136141a057600080fd5b80356141ae611b7d82611afb565b81815260059190911b820183019083810190878311156141cd57600080fd5b928401925b82841015611bc6576141e384612dce565b825292840192908401906141d2565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160100b8352928401929184019160010161420e565b60006020828403121561423f57600080fd5b611a4f826137c6565b6000602080838503121561425b57600080fd5b82356001600160401b0381111561427157600080fd5b8301601f8101851361428257600080fd5b8035614290611b7d82611afb565b81815260059190911b820183019083810190878311156142af57600080fd5b928401925b82841015611bc6576142c5846127c3565b825292840192908401906142b4565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160190b835292840192918401916001016142f0565b80356001600160881b0381168114611a2f57600080fd5b6000602080838503121561433957600080fd5b82356001600160401b0381111561434f57600080fd5b8301601f8101851361436057600080fd5b803561436e611b7d82611afb565b81815260059190911b8201830190838101908783111561438d57600080fd5b928401925b82841015611bc6576143a38461430f565b82529284019290840190614392565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160881b0316835292840192918401916001016143ce565b6000602080838503121561440657600080fd5b82356001600160401b0381111561441c57600080fd5b8301601f8101851361442d57600080fd5b803561443b611b7d82611afb565b81815260059190911b8201830190838101908783111561445a57600080fd5b928401925b82841015611bc65761447084613c61565b8252928401929084019061445f565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601b0b8352928401929184019160010161449b565b600060208083850312156144cd57600080fd5b82356001600160401b03808211156144e457600080fd5b818501915085601f8301126144f857600080fd5b8135614506611b7d82611afb565b81815260059190911b8301840190848101908883111561452557600080fd5b8585015b83811015613ff8578035858111156145415760008081fd5b61454f8b89838a0101611d36565b845250918601918601614529565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561405a57603f198886030184526145a0858351611de1565b94509285019290850190600101614584565b6000602082840312156145c457600080fd5b611a4f82613125565b8035601881900b8114611a2f57600080fd5b6000602082840312156145f157600080fd5b611a4f826145cd565b60006020828403121561460c57600080fd5b611a4f826129e5565b80356001600160b81b0381168114611a2f57600080fd5b60006020828403121561463e57600080fd5b611a4f82614615565b60006020828403121561465957600080fd5b611a4f826126a2565b6000602080838503121561467557600080fd5b82356001600160401b0381111561468b57600080fd5b8301601f8101851361469c57600080fd5b80356146aa611b7d82611afb565b81815260059190911b820183019083810190878311156146c957600080fd5b928401925b82841015611bc6576146df84614134565b825292840192908401906146ce565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160b01b03168352928401929184019160010161470a565b60006020828403121561474157600080fd5b611a4f82612b4c565b60006020828403121561475c57600080fd5b611a4f82611b1e565b6000602080838503121561477857600080fd5b82356001600160401b0381111561478e57600080fd5b8301601f8101851361479f57600080fd5b80356147ad611b7d82611afb565b81815260059190911b820183019083810190878311156147cc57600080fd5b928401925b82841015611bc6576147e284611a88565b825292840192908401906147d1565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600c0b8352928401929184019160010161480d565b60006020828403121561483e57600080fd5b611a4f82613d6a565b6000602080838503121561485a57600080fd5b82356001600160401b0381111561487057600080fd5b8301601f8101851361488157600080fd5b803561488f611b7d82611afb565b81815260059190911b820183019083810190878311156148ae57600080fd5b928401925b82841015611bc6576148c484612e28565b825292840192908401906148b3565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835168ffffffffffffffffff16835292840192918401916001016148ef565b8035600e81900b8114611a2f57600080fd5b6000602080838503121561493b57600080fd5b82356001600160401b0381111561495157600080fd5b8301601f8101851361496257600080fd5b8035614970611b7d82611afb565b81815260059190911b8201830190838101908783111561498f57600080fd5b928401925b82841015611bc6576149a584614916565b82529284019290840190614994565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351600e0b835292840192918401916001016149d0565b8035600581900b8114611a2f57600080fd5b600060208284031215614a1357600080fd5b611a4f826149ef565b600060208284031215614a2e57600080fd5b611a4f82613a82565b60006020808385031215614a4a57600080fd5b82356001600160401b03811115614a6057600080fd5b8301601f81018513614a7157600080fd5b8035614a7f611b7d82611afb565b81815260059190911b82018301908381019087831115614a9e57600080fd5b928401925b82841015611bc657614ab484613a50565b82529284019290840190614aa3565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160681b031683529284019291840191600101614adf565b600060208284031215614b1657600080fd5b611a4f82614916565b600060208284031215614b3157600080fd5b611a4f826131fe565b600060208284031215614b4c57600080fd5b611a4f82611e6c565b600060208284031215614b6757600080fd5b611a4f8261430f565b600060208284031215614b8257600080fd5b611a4f826124f7565b60006020808385031215614b9e57600080fd5b82356001600160401b03811115614bb457600080fd5b8301601f81018513614bc557600080fd5b8035614bd3611b7d82611afb565b81815260059190911b82018301908381019087831115614bf257600080fd5b928401925b82841015611bc657614c08846149ef565b82529284019290840190614bf7565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160050b83529284019291840191600101614c33565b600060208284031215614c6457600080fd5b611a4f82611f72565b60006020808385031215614c8057600080fd5b82356001600160401b03811115614c9657600080fd5b8301601f81018513614ca757600080fd5b8035614cb5611b7d82611afb565b81815260059190911b82018301908381019087831115614cd457600080fd5b928401925b82841015611bc657614cea84611f45565b82529284019290840190614cd9565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160120b83529284019291840191600101614d15565b600060208284031215614d4657600080fd5b611a4f82612ce2565b600060208284031215614d6157600080fd5b611a4f82612304565b60006020808385031215614d7d57600080fd5b82356001600160401b03811115614d9357600080fd5b8301601f81018513614da457600080fd5b8035614db2611b7d82611afb565b81815260059190911b82018301908381019087831115614dd157600080fd5b928401925b82841015611bc657614de7846145cd565b82529284019290840190614dd6565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160180b83529284019291840191600101614e12565b600060208284031215614e4357600080fd5b611a4f8261349d565b80356001600160e01b0381168114611a2f57600080fd5b600060208284031215614e7557600080fd5b611a4f82614e4c565b60006020808385031215614e9157600080fd5b82356001600160401b03811115614ea757600080fd5b8301601f81018513614eb857600080fd5b8035614ec6611b7d82611afb565b81815260059190911b82018301908381019087831115614ee557600080fd5b928401925b82841015611bc657614efb8461365d565b82529284019290840190614eea565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160090b83529284019291840191600101614f26565b60006020808385031215614f5857600080fd5b82356001600160401b03811115614f6e57600080fd5b8301601f81018513614f7f57600080fd5b8035614f8d611b7d82611afb565b81815260059190911b82018301908381019087831115614fac57600080fd5b928401925b82841015611bc657614fc284614e4c565b82529284019290840190614fb1565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160e01b031683529284019291840191600101614fed565b80356001600160d01b0381168114611a2f57600080fd5b60006020828403121561503b57600080fd5b611a4f82615012565b60006020828403121561505657600080fd5b611a4f8261357f565b63ffffffff841681526001600160401b038316602082015260606040820152600061508d6060830184611de1565b95945050505050565b6000602082840312156150a857600080fd5b611a4f82613966565b6000602082840312156150c357600080fd5b611a4f826128d4565b80356001600160e81b0381168114611a2f57600080fd5b6000602082840312156150f557600080fd5b611a4f826150cc565b6000602080838503121561511157600080fd5b82356001600160401b0381111561512757600080fd5b8301601f8101851361513857600080fd5b8035615146611b7d82611afb565b81815260059190911b8201830190838101908783111561516557600080fd5b928401925b82841015611bc65761517b84612dfb565b8252928401929084019061516a565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601c0b835292840192918401916001016151a6565b6000602082840312156151d757600080fd5b611a4f826127f0565b8035600881900b8114611a2f57600080fd5b6000602080838503121561520557600080fd5b82356001600160401b0381111561521b57600080fd5b8301601f8101851361522c57600080fd5b803561523a611b7d82611afb565b81815260059190911b8201830190838101908783111561525957600080fd5b928401925b82841015611bc65761526f846151e0565b8252928401929084019061525e565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160080b8352928401929184019160010161529a565b600060208083850312156152cc57600080fd5b82356001600160401b038111156152e257600080fd5b8301601f810185136152f357600080fd5b8035615301611b7d82611afb565b81815260059190911b8201830190838101908783111561532057600080fd5b928401925b82841015611bc657615336846132e2565b82529284019290840190615325565b602080825282518282018190526000919084820190604085019084805b82811015615380578451820b84529385019392850192600101615362565b5091979650505050505050565b600060208083850312156153a057600080fd5b82356001600160401b038111156153b657600080fd5b8301601f810185136153c757600080fd5b80356153d5611b7d82611afb565b81815260059190911b820183019083810190878311156153f457600080fd5b928401925b82841015611bc65761540a8461277b565b825292840192908401906153f9565b6020808252825182820181905260009190848201906040850190845b81811015611c12578351601d0b83529284019291840191600101615435565b6000602080838503121561546757600080fd5b82356001600160401b0381111561547d57600080fd5b8301601f8101851361548e57600080fd5b803561549c611b7d82611afb565b81815260059190911b820183019083810190878311156154bb57600080fd5b928401925b82841015611bc6576154d184611c82565b825292840192908401906154c0565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160040b835292840192918401916001016154fc565b6000602080838503121561552e57600080fd5b82356001600160401b0381111561554457600080fd5b8301601f8101851361555557600080fd5b8035615563611b7d82611afb565b81815260059190911b8201830190838101908783111561558257600080fd5b928401925b82841015611bc65761559884613e44565b82529284019290840190615587565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160020b835292840192918401916001016155c3565b600060208083850312156155f557600080fd5b82356001600160401b0381111561560b57600080fd5b8301601f8101851361561c57600080fd5b803561562a611b7d82611afb565b81815260059190911b8201830190838101908783111561564957600080fd5b928401925b82841015611bc65761565f846150cc565b8252928401929084019061564e565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160e81b03168352928401929184019160010161568a565b600060208083850312156156c257600080fd5b82356001600160401b038111156156d857600080fd5b8301601f810185136156e957600080fd5b80356156f7611b7d82611afb565b81815260059190911b8201830190838101908783111561571657600080fd5b928401925b82841015611bc65761572c8461368a565b8252928401929084019061571b565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160170b83529284019291840191600101615757565b60006020828403121561578857600080fd5b611a4f826151e0565b600060208083850312156157a457600080fd5b82356001600160401b038111156157ba57600080fd5b8301601f810185136157cb57600080fd5b80356157d9611b7d82611afb565b81815260059190911b820183019083810190878311156157f857600080fd5b928401925b82841015611bc65761580e84612e5c565b825292840192908401906157fd565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835160070b83529284019291840191600101615839565b60006020828403121561586a57600080fd5b611a4f82613e71565b60006020828403121561588557600080fd5b611a4f82613c8e565b600060208083850312156158a157600080fd5b82356001600160401b038111156158b757600080fd5b8301601f810185136158c857600080fd5b80356158d6611b7d82611afb565b81815260059190911b820183019083810190878311156158f557600080fd5b928401925b82841015611bc65761590b84611a18565b825292840192908401906158fa565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160801b031683529284019291840191600101615936565b6000602080838503121561596e57600080fd5b82356001600160401b0381111561598457600080fd5b8301601f8101851361599557600080fd5b80356159a3611b7d82611afb565b81815260059190911b820183019083810190878311156159c257600080fd5b928401925b82841015611bc6576159d884615012565b825292840192908401906159c7565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160d01b031683529284019291840191600101615a03565b60006020808385031215615a3b57600080fd5b82356001600160401b03811115615a5157600080fd5b8301601f81018513615a6257600080fd5b8035615a70611b7d82611afb565b81815260059190911b82018301908381019087831115615a8f57600080fd5b928401925b82841015611bc657615aa584614615565b82529284019290840190615a94565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160b81b031683529284019291840191600101615ad0565b602081526000825160406020840152615b116060840182611de1565b9050602084015160408401528091505092915050565b60006020808385031215615b3a57600080fd5b82356001600160401b03811115615b5057600080fd5b8301601f81018513615b6157600080fd5b8035615b6f611b7d82611afb565b81815260059190911b82018301908381019087831115615b8e57600080fd5b928401925b82841015611bc657615ba484611c1e565b82529284019290840190615b93565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160781b031683529284019291840191600101615bcf565b60006020808385031215615c0757600080fd5b82356001600160401b03811115615c1d57600080fd5b8301601f81018513615c2e57600080fd5b8035615c3c611b7d82611afb565b81815260059190911b82018301908381019087831115615c5b57600080fd5b928401925b82841015611bc657615c7184611a56565b82529284019290840190615c60565b6020808252825182820181905260009190848201906040850190845b81811015611c125783516001600160601b031683529284019291840191600101615c9c565b600060208284031215615cd357600080fd5b611a4f82613b81565b634e487b7160e01b600052601160045260246000fd5b600081810b9083900b01607f8113607f1982121715615d1357615d13615cdc565b92915050565b8082018281126000831280158216821582161715615d3957615d39615cdc565b505092915050565b63ffffffff828116828216039080821115615d5e57615d5e615cdc565b5092915050565b600481810b9083900b01647fffffffff8113647fffffffff1982121715615d1357615d13615cdc565b600181811c90821680615da257607f821691505b602082108103615dc257634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220a5b87b6881e1a012e4a59d55c230cfcf3a2342b83efdbfb3c5f5cfa532fc854864736f6c63430008120033"; private static IntegrationTestEnv testEnv; private static FileId fileId; private static ContractId contractId; @@ -57,20 +39,29 @@ public static void beforeAll() throws Exception { fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - new FileAppendTransaction().setFileId(fileId).setContents(SMART_CONTRACT_BYTECODE).setMaxChunks(31) - .execute(testEnv.client); + new FileAppendTransaction() + .setFileId(fileId) + .setContents(SMART_CONTRACT_BYTECODE) + .setMaxChunks(31) + .execute(testEnv.client); - response = new ContractCreateTransaction().setAdminKey(testEnv.operatorKey).setGas(1500000) - .setConstructorParameters(new ContractFunctionParameters()).setBytecodeFileId(fileId) - .execute(testEnv.client); + response = new ContractCreateTransaction() + .setAdminKey(testEnv.operatorKey) + .setGas(1500000) + .setConstructorParameters(new ContractFunctionParameters()) + .setBytecodeFileId(fileId) + .execute(testEnv.client); contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); } @AfterAll public static void afterAll() throws Exception { - new ContractDeleteTransaction().setTransferAccountId(testEnv.operatorId).setContractId(contractId) - .execute(testEnv.client).getReceipt(testEnv.client); + new ContractDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction().setFileId(fileId).execute(testEnv.client).getReceipt(testEnv.client); @@ -86,13 +77,17 @@ public void afterEach() throws InterruptedException { @Test @DisplayName("Can receive uint8 min value from contract call") void canCallContractFunctionUint8Min() throws Exception { - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint8", new ContractFunctionParameters().addUint8((byte) 0x0)) - .execute(testEnv.client); - - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint8", new ContractFunctionParameters().addUint8((byte) 0x0)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint8", new ContractFunctionParameters().addUint8((byte) 0x0)) + .execute(testEnv.client); + + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint8", new ContractFunctionParameters().addUint8((byte) 0x0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint8(0)).isEqualTo((byte) 0x0); } @@ -103,13 +98,17 @@ void canCallContractFunctionUint8Max() throws Exception { int uint8Max = 255; byte uint8MaxByte = (byte) uint8Max; - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint8", new ContractFunctionParameters().addUint8(uint8MaxByte)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint8", new ContractFunctionParameters().addUint8(uint8MaxByte)) + .execute(testEnv.client); - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint8", new ContractFunctionParameters().addUint8(uint8MaxByte)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint8", new ContractFunctionParameters().addUint8(uint8MaxByte)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint8MaxFromResponse = Byte.toUnsignedInt(response.getUint8(0)); @@ -124,13 +123,17 @@ void canCallContractFunctionUint8Array() throws Exception { byte uint8MaxByte = (byte) uint8Max; byte[] uint8Array = {uint8MinByte, uint8MaxByte}; - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint8Arr", new ContractFunctionParameters().addUint8Array(uint8Array)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint8Arr", new ContractFunctionParameters().addUint8Array(uint8Array)) + .execute(testEnv.client); - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint8Arr", new ContractFunctionParameters().addUint8Array(uint8Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint8Arr", new ContractFunctionParameters().addUint8Array(uint8Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(uint8[])").get(0); @@ -141,9 +144,12 @@ void canCallContractFunctionUint8Array() throws Exception { @Test @DisplayName("Can receive uint16 min value from contract call") void canCallContractFunctionUint16Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint16", new ContractFunctionParameters().addUint16(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint16", new ContractFunctionParameters().addUint16(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint32(0)).isEqualTo(0); } @@ -154,13 +160,17 @@ void canCallContractFunctionUint16Max() throws Exception { var uint16Max = "65535"; int uint16MaxInt = Integer.parseUnsignedInt(uint16Max); - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint16", new ContractFunctionParameters().addUint16(uint16MaxInt)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint16", new ContractFunctionParameters().addUint16(uint16MaxInt)) + .execute(testEnv.client); - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint16", new ContractFunctionParameters().addUint16(uint16MaxInt)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint16", new ContractFunctionParameters().addUint16(uint16MaxInt)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint16MaxIntFromResponse = Integer.toUnsignedString(response.getUint32(0)); @@ -175,13 +185,17 @@ void canCallContractFunctionUint16Array() throws Exception { int uint16MaxInt = Integer.parseUnsignedInt(uint16Max); int[] uint16Array = {uint16MinInt, uint16MaxInt}; - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint16Arr", new ContractFunctionParameters().addUint16Array(uint16Array)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint16Arr", new ContractFunctionParameters().addUint16Array(uint16Array)) + .execute(testEnv.client); - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint16Arr", new ContractFunctionParameters().addUint16Array(uint16Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint16Arr", new ContractFunctionParameters().addUint16Array(uint16Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(uint16[])").get(0); @@ -191,13 +205,17 @@ void canCallContractFunctionUint16Array() throws Exception { @Test @DisplayName("Can receive uint24 min value from contract call") void canCallContractFunctionUint24Min() throws Exception { - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint24", new ContractFunctionParameters().addUint24(0)) - .execute(testEnv.client); - - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint24", new ContractFunctionParameters().addUint24(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint24", new ContractFunctionParameters().addUint24(0)) + .execute(testEnv.client); + + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint24", new ContractFunctionParameters().addUint24(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint32(0)).isEqualTo(0); } @@ -208,13 +226,17 @@ void canCallContractFunctionUint24Max() throws Exception { var uint24Max = "16777215"; int uint24MaxInt = Integer.parseUnsignedInt(uint24Max); - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint24", new ContractFunctionParameters().addUint24(uint24MaxInt)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint24", new ContractFunctionParameters().addUint24(uint24MaxInt)) + .execute(testEnv.client); - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint24", new ContractFunctionParameters().addUint24(uint24MaxInt)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint24", new ContractFunctionParameters().addUint24(uint24MaxInt)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint24MaxIntFromResponse = Integer.toUnsignedString(response.getUint32(0)); @@ -229,13 +251,17 @@ void canCallContractFunctionUint24Array() throws Exception { int uint24MaxInt = Integer.parseUnsignedInt(uint24Max); int[] uint24Array = {uint24MinInt, uint24MaxInt}; - var gas = new MirrorNodeContractEstimateGasQuery().setContractId(contractId) - .setFunction("returnUint24Arr", new ContractFunctionParameters().addUint24Array(uint24Array)) - .execute(testEnv.client); + var gas = new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("returnUint24Arr", new ContractFunctionParameters().addUint24Array(uint24Array)) + .execute(testEnv.client); - var response = new ContractCallQuery().setContractId(contractId).setGas(gas) - .setFunction("returnUint24Arr", new ContractFunctionParameters().addUint24Array(uint24Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(gas) + .setFunction("returnUint24Arr", new ContractFunctionParameters().addUint24Array(uint24Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(uint24[])").get(0); @@ -245,9 +271,12 @@ void canCallContractFunctionUint24Array() throws Exception { @Test @DisplayName("Can receive uint32 min value from contract call") void canCallContractFunctionUint32Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint32", new ContractFunctionParameters().addUint32(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint32", new ContractFunctionParameters().addUint32(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint32(0)).isEqualTo(0); } @@ -258,9 +287,12 @@ void canCallContractFunctionUint32Max() throws Exception { var uint32Max = "4294967295"; int uint32MaxInt = Integer.parseUnsignedInt(uint32Max); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint32", new ContractFunctionParameters().addUint32(uint32MaxInt)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint32", new ContractFunctionParameters().addUint32(uint32MaxInt)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint32MaxIntFromResponse = Integer.toUnsignedString(response.getUint32(0)); @@ -275,9 +307,12 @@ void canCallContractFunctionUint32Array() throws Exception { int uint32MaxInt = Integer.parseUnsignedInt(uint32Max); int[] uint32Array = {uint32MinInt, uint32MaxInt}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint32Arr", new ContractFunctionParameters().addUint32Array(uint32Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint32Arr", new ContractFunctionParameters().addUint32Array(uint32Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(uint32[])").get(0); @@ -288,9 +323,12 @@ void canCallContractFunctionUint32Array() throws Exception { @Test @DisplayName("Can receive uint40 min value from contract call") void canCallContractFunctionUint40Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint40", new ContractFunctionParameters().addUint40(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint40", new ContractFunctionParameters().addUint40(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint64(0)).isEqualTo(0); } @@ -301,9 +339,12 @@ void canCallContractFunctionUint40Max() throws Exception { var uint40Max = "109951162777"; long uint40MaxLong = Long.parseUnsignedLong(uint40Max); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint40", new ContractFunctionParameters().addUint40(uint40MaxLong)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint40", new ContractFunctionParameters().addUint40(uint40MaxLong)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint64MaxLongFromResponse = Long.toUnsignedString(response.getUint64(0)); @@ -318,9 +359,12 @@ void canCallContractFunctionUint40Array() throws Exception { long uint40MaxLong = Long.parseUnsignedLong(uint40Max); long[] uint40Array = {uint40MinLong, uint40MaxLong}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint40Arr", new ContractFunctionParameters().addUint40Array(uint40Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint40Arr", new ContractFunctionParameters().addUint40Array(uint40Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(uint40[])").get(0); @@ -330,9 +374,12 @@ void canCallContractFunctionUint40Array() throws Exception { @Test @DisplayName("Can receive uint48 min value from contract call") void canCallContractFunctionUint48Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint48", new ContractFunctionParameters().addUint48(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint48", new ContractFunctionParameters().addUint48(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint64(0)).isEqualTo(0); } @@ -343,9 +390,12 @@ void canCallContractFunctionUint48Max() throws Exception { var uint48Max = "281474976710655"; long uint48MaxLong = Long.parseUnsignedLong(uint48Max); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint48", new ContractFunctionParameters().addUint48(uint48MaxLong)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint48", new ContractFunctionParameters().addUint48(uint48MaxLong)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint64MaxLongFromResponse = Long.toUnsignedString(response.getUint64(0)); @@ -360,9 +410,12 @@ void canCallContractFunctionUint48Array() throws Exception { long uint48MaxLong = Long.parseUnsignedLong(uint48Max); long[] uint48Array = {uint48MinLong, uint48MaxLong}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint48Arr", new ContractFunctionParameters().addUint48Array(uint48Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint48Arr", new ContractFunctionParameters().addUint48Array(uint48Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(uint48[])").get(0); @@ -372,9 +425,12 @@ void canCallContractFunctionUint48Array() throws Exception { @Test @DisplayName("Can receive uint56 min value from contract call") void canCallContractFunctionUint56Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint56", new ContractFunctionParameters().addUint56(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint56", new ContractFunctionParameters().addUint56(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint64(0)).isEqualTo(0); } @@ -385,9 +441,12 @@ void canCallContractFunctionUint56Max() throws Exception { var uint56Max = "72057594037927935"; long uint56MaxLong = Long.parseUnsignedLong(uint56Max); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint56", new ContractFunctionParameters().addUint56(uint56MaxLong)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint56", new ContractFunctionParameters().addUint56(uint56MaxLong)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint64MaxLongFromResponse = Long.toUnsignedString(response.getUint64(0)); @@ -402,9 +461,12 @@ void canCallContractFunctionUint56Array() throws Exception { long uint56MaxLong = Long.parseUnsignedLong(uint56Max); long[] uint56Array = {uint56MinLong, uint56MaxLong}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint56Arr", new ContractFunctionParameters().addUint56Array(uint56Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint56Arr", new ContractFunctionParameters().addUint56Array(uint56Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(uint56[])").get(0); @@ -414,9 +476,12 @@ void canCallContractFunctionUint56Array() throws Exception { @Test @DisplayName("Can receive uint64 min value from contract call") void canCallContractFunctionUint64Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint64", new ContractFunctionParameters().addUint64(0)).setQueryPayment(new Hbar(10)) - .execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint64", new ContractFunctionParameters().addUint64(0)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint64(0)).isEqualTo(0); } @@ -427,9 +492,12 @@ void canCallContractFunctionUint64Max() throws Exception { var uint64Max = "9223372036854775807"; long uint64MaxLong = Long.parseUnsignedLong(uint64Max); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint64", new ContractFunctionParameters().addUint64(uint64MaxLong)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint64", new ContractFunctionParameters().addUint64(uint64MaxLong)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var uint64MaxLongFromResponse = Long.toUnsignedString(response.getUint64(0)); @@ -444,9 +512,12 @@ void canCallContractFunctionUint64Array() throws Exception { long uint64MaxLong = Long.parseUnsignedLong(uint64Max); long[] uint64Array = {uint64MinLong, uint64MaxLong}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint64Arr", new ContractFunctionParameters().addUint64Array(uint64Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint64Arr", new ContractFunctionParameters().addUint64Array(uint64Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint64[])").get(0); @@ -457,9 +528,12 @@ void canCallContractFunctionUint64Array() throws Exception { @Test @DisplayName("Can receive uint72 min value from contract call") void canCallContractFunctionUint72Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint72", new ContractFunctionParameters().addUint72(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint72", new ContractFunctionParameters().addUint72(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -469,9 +543,12 @@ void canCallContractFunctionUint72Min() throws Exception { void canCallContractFunctionUint72Max() throws Exception { BigInteger uint72Max = new BigInteger("4722366482869645213695"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint72", new ContractFunctionParameters().addUint72(uint72Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint72", new ContractFunctionParameters().addUint72(uint72Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint72Max); } @@ -483,9 +560,12 @@ void canCallContractFunctionUint72Array() throws Exception { BigInteger uint72Max = new BigInteger("4722366482869645213695"); BigInteger[] uint72Array = {uint72Min, uint72Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint72Arr", new ContractFunctionParameters().addUint72Array(uint72Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint72Arr", new ContractFunctionParameters().addUint72Array(uint72Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint72[])").get(0); @@ -495,9 +575,12 @@ void canCallContractFunctionUint72Array() throws Exception { @Test @DisplayName("Can receive uint80 min value from contract call") void canCallContractFunctionUint80Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint80", new ContractFunctionParameters().addUint80(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint80", new ContractFunctionParameters().addUint80(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -507,9 +590,12 @@ void canCallContractFunctionUint80Min() throws Exception { void canCallContractFunctionUint80Max() throws Exception { BigInteger uint80Max = new BigInteger("1208925819614629174706175"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint80", new ContractFunctionParameters().addUint80(uint80Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint80", new ContractFunctionParameters().addUint80(uint80Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint80Max); } @@ -521,9 +607,12 @@ void canCallContractFunctionUint80Array() throws Exception { BigInteger uint80Max = new BigInteger("1208925819614629174706175"); BigInteger[] uint80Array = {uint80Min, uint80Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint80Arr", new ContractFunctionParameters().addUint80Array(uint80Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint80Arr", new ContractFunctionParameters().addUint80Array(uint80Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint80[])").get(0); @@ -533,9 +622,12 @@ void canCallContractFunctionUint80Array() throws Exception { @Test @DisplayName("Can receive uint88 min value from contract call") void canCallContractFunctionUint88Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint88", new ContractFunctionParameters().addUint88(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint88", new ContractFunctionParameters().addUint88(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -545,9 +637,12 @@ void canCallContractFunctionUint88Min() throws Exception { void canCallContractFunctionUint88Max() throws Exception { BigInteger uint88Max = new BigInteger("309485009821345068724781055"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint88", new ContractFunctionParameters().addUint88(uint88Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint88", new ContractFunctionParameters().addUint88(uint88Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint88Max); } @@ -559,9 +654,12 @@ void canCallContractFunctionUint88Array() throws Exception { BigInteger uint88Max = new BigInteger("309485009821345068724781055"); BigInteger[] uint88Array = {uint88Min, uint88Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint88Arr", new ContractFunctionParameters().addUint88Array(uint88Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint88Arr", new ContractFunctionParameters().addUint88Array(uint88Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint88[])").get(0); @@ -571,9 +669,12 @@ void canCallContractFunctionUint88Array() throws Exception { @Test @DisplayName("Can receive uint96 min value from contract call") void canCallContractFunctionUint96Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint96", new ContractFunctionParameters().addUint96(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint96", new ContractFunctionParameters().addUint96(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -583,9 +684,12 @@ void canCallContractFunctionUint96Min() throws Exception { void canCallContractFunctionUint96Max() throws Exception { BigInteger uint96Max = new BigInteger("79228162514264337593543950335"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint96", new ContractFunctionParameters().addUint96(uint96Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint96", new ContractFunctionParameters().addUint96(uint96Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint96Max); } @@ -597,9 +701,12 @@ void canCallContractFunctionUint96Array() throws Exception { BigInteger uint96Max = new BigInteger("79228162514264337593543950335"); BigInteger[] uint96Array = {uint96Min, uint96Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint96Arr", new ContractFunctionParameters().addUint96Array(uint96Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint96Arr", new ContractFunctionParameters().addUint96Array(uint96Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint96[])").get(0); @@ -609,9 +716,12 @@ void canCallContractFunctionUint96Array() throws Exception { @Test @DisplayName("Can receive uint104 min value from contract call") void canCallContractFunctionUint104Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint104", new ContractFunctionParameters().addUint104(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint104", new ContractFunctionParameters().addUint104(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -621,9 +731,12 @@ void canCallContractFunctionUint104Min() throws Exception { void canCallContractFunctionUint104Max() throws Exception { BigInteger uint104Max = new BigInteger("20282409603651670423947251286015"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint104", new ContractFunctionParameters().addUint104(uint104Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint104", new ContractFunctionParameters().addUint104(uint104Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint104Max); } @@ -635,9 +748,12 @@ void canCallContractFunctionUint104Array() throws Exception { BigInteger uint104Max = new BigInteger("20282409603651670423947251286015"); BigInteger[] uint104Array = {uint104Min, uint104Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint104Arr", new ContractFunctionParameters().addUint104Array(uint104Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint104Arr", new ContractFunctionParameters().addUint104Array(uint104Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint104[])").get(0); @@ -647,9 +763,12 @@ void canCallContractFunctionUint104Array() throws Exception { @Test @DisplayName("Can receive uint112 min value from contract call") void canCallContractFunctionUint112Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint112", new ContractFunctionParameters().addUint112(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint112", new ContractFunctionParameters().addUint112(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -659,9 +778,12 @@ void canCallContractFunctionUint112Min() throws Exception { void canCallContractFunctionUint112Max() throws Exception { BigInteger uint112Max = new BigInteger("5192296858534827628530496329220095"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint112", new ContractFunctionParameters().addUint112(uint112Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint112", new ContractFunctionParameters().addUint112(uint112Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint112Max); } @@ -673,9 +795,12 @@ void canCallContractFunctionUint112Array() throws Exception { BigInteger uint112Max = new BigInteger("5192296858534827628530496329220095"); BigInteger[] uint112Array = {uint112Min, uint112Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint112Arr", new ContractFunctionParameters().addUint112Array(uint112Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint112Arr", new ContractFunctionParameters().addUint112Array(uint112Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint112[])").get(0); @@ -685,9 +810,12 @@ void canCallContractFunctionUint112Array() throws Exception { @Test @DisplayName("Can receive uint120 min value from contract call") void canCallContractFunctionUint120Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint120", new ContractFunctionParameters().addUint120(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint120", new ContractFunctionParameters().addUint120(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -697,9 +825,12 @@ void canCallContractFunctionUint120Min() throws Exception { void canCallContractFunctionUint120Max() throws Exception { BigInteger uint120Max = new BigInteger("1329227995784915872903807060280344575"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint120", new ContractFunctionParameters().addUint120(uint120Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint120", new ContractFunctionParameters().addUint120(uint120Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint120Max); } @@ -711,9 +842,12 @@ void canCallContractFunctionUint120Array() throws Exception { BigInteger uint120Max = new BigInteger("1329227995784915872903807060280344575"); BigInteger[] uint120Array = {uint120Min, uint120Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint120Arr", new ContractFunctionParameters().addUint120Array(uint120Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint120Arr", new ContractFunctionParameters().addUint120Array(uint120Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint120[])").get(0); @@ -723,9 +857,12 @@ void canCallContractFunctionUint120Array() throws Exception { @Test @DisplayName("Can receive uint128 min value from contract call") void canCallContractFunctionUint128Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint128", new ContractFunctionParameters().addUint128(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint128", new ContractFunctionParameters().addUint128(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -735,9 +872,12 @@ void canCallContractFunctionUint128Min() throws Exception { void canCallContractFunctionUint128Max() throws Exception { BigInteger uint128Max = new BigInteger("340282366920938463463374607431768211455"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint128", new ContractFunctionParameters().addUint128(uint128Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint128", new ContractFunctionParameters().addUint128(uint128Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint128Max); } @@ -749,9 +889,12 @@ void canCallContractFunctionUint128Array() throws Exception { BigInteger uint128Max = new BigInteger("340282366920938463463374607431768211455"); BigInteger[] uint128Array = {uint128Min, uint128Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint128Arr", new ContractFunctionParameters().addUint128Array(uint128Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint128Arr", new ContractFunctionParameters().addUint128Array(uint128Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint128[])").get(0); @@ -761,9 +904,12 @@ void canCallContractFunctionUint128Array() throws Exception { @Test @DisplayName("Can receive uint136 min value from contract call") void canCallContractFunctionUint136Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint136", new ContractFunctionParameters().addUint136(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint136", new ContractFunctionParameters().addUint136(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -773,9 +919,12 @@ void canCallContractFunctionUint136Min() throws Exception { void canCallContractFunctionUint136Max() throws Exception { BigInteger uint136Max = new BigInteger("87112285931760246646623899502532662132735"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint136", new ContractFunctionParameters().addUint136(uint136Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint136", new ContractFunctionParameters().addUint136(uint136Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint136Max); } @@ -787,9 +936,12 @@ void canCallContractFunctionUint136Array() throws Exception { BigInteger uint136Max = new BigInteger("87112285931760246646623899502532662132735"); BigInteger[] uint136Array = {uint136Min, uint136Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint136Arr", new ContractFunctionParameters().addUint136Array(uint136Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint136Arr", new ContractFunctionParameters().addUint136Array(uint136Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint136[])").get(0); @@ -799,9 +951,12 @@ void canCallContractFunctionUint136Array() throws Exception { @Test @DisplayName("Can receive uint144 min value from contract call") void canCallContractFunctionUint144Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint144", new ContractFunctionParameters().addUint144(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint144", new ContractFunctionParameters().addUint144(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -811,9 +966,12 @@ void canCallContractFunctionUint144Min() throws Exception { void canCallContractFunctionUint144Max() throws Exception { BigInteger uint144Max = new BigInteger("22300745198530623141535718272648361505980415"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint144", new ContractFunctionParameters().addUint144(uint144Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint144", new ContractFunctionParameters().addUint144(uint144Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint144Max); } @@ -825,9 +983,12 @@ void canCallContractFunctionUint144Array() throws Exception { BigInteger uint144Max = new BigInteger("22300745198530623141535718272648361505980415"); BigInteger[] uint144Array = {uint144Min, uint144Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint144Arr", new ContractFunctionParameters().addUint144Array(uint144Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint144Arr", new ContractFunctionParameters().addUint144Array(uint144Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint144[])").get(0); @@ -837,9 +998,12 @@ void canCallContractFunctionUint144Array() throws Exception { @Test @DisplayName("Can receive uint152 min value from contract call") void canCallContractFunctionUint152Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint152", new ContractFunctionParameters().addUint152(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint152", new ContractFunctionParameters().addUint152(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -849,9 +1013,12 @@ void canCallContractFunctionUint152Min() throws Exception { void canCallContractFunctionUint152Max() throws Exception { BigInteger uint152Max = new BigInteger("5708990770823839524233143877797980545530986495"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint152", new ContractFunctionParameters().addUint152(uint152Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint152", new ContractFunctionParameters().addUint152(uint152Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint152Max); } @@ -863,9 +1030,12 @@ void canCallContractFunctionUint152Array() throws Exception { BigInteger uint152Max = new BigInteger("5708990770823839524233143877797980545530986495"); BigInteger[] uint152Array = {uint152Min, uint152Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint152Arr", new ContractFunctionParameters().addUint152Array(uint152Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint152Arr", new ContractFunctionParameters().addUint152Array(uint152Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint152[])").get(0); @@ -875,9 +1045,12 @@ void canCallContractFunctionUint152Array() throws Exception { @Test @DisplayName("Can receive uint160 min value from contract call") void canCallContractFunctionUint160Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint160", new ContractFunctionParameters().addUint160(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint160", new ContractFunctionParameters().addUint160(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -887,9 +1060,12 @@ void canCallContractFunctionUint160Min() throws Exception { void canCallContractFunctionUint160Max() throws Exception { BigInteger uint160Max = new BigInteger("1461501637330902918203684832716283019655932542975"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint160", new ContractFunctionParameters().addUint160(uint160Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint160", new ContractFunctionParameters().addUint160(uint160Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint160Max); } @@ -901,9 +1077,12 @@ void canCallContractFunctionUint160Array() throws Exception { BigInteger uint160Max = new BigInteger("1461501637330902918203684832716283019655932542975"); BigInteger[] uint160Array = {uint160Min, uint160Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint160Arr", new ContractFunctionParameters().addUint160Array(uint160Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint160Arr", new ContractFunctionParameters().addUint160Array(uint160Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint160[])").get(0); @@ -913,9 +1092,12 @@ void canCallContractFunctionUint160Array() throws Exception { @Test @DisplayName("Can receive uint168 min value from contract call") void canCallContractFunctionUint168Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint168", new ContractFunctionParameters().addUint168(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint168", new ContractFunctionParameters().addUint168(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -925,9 +1107,12 @@ void canCallContractFunctionUint168Min() throws Exception { void canCallContractFunctionUint168Max() throws Exception { BigInteger uint168Max = new BigInteger("374144419156711147060143317175368453031918731001855"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint168", new ContractFunctionParameters().addUint168(uint168Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint168", new ContractFunctionParameters().addUint168(uint168Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint168Max); } @@ -939,9 +1124,12 @@ void canCallContractFunctionUint168Array() throws Exception { BigInteger uint168Max = new BigInteger("374144419156711147060143317175368453031918731001855"); BigInteger[] uint168Array = {uint168Min, uint168Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint168Arr", new ContractFunctionParameters().addUint168Array(uint168Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint168Arr", new ContractFunctionParameters().addUint168Array(uint168Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint168[])").get(0); @@ -951,9 +1139,12 @@ void canCallContractFunctionUint168Array() throws Exception { @Test @DisplayName("Can receive uint176 min value from contract call") void canCallContractFunctionUint176Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint176", new ContractFunctionParameters().addUint176(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint176", new ContractFunctionParameters().addUint176(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -963,9 +1154,12 @@ void canCallContractFunctionUint176Min() throws Exception { void canCallContractFunctionUint176Max() throws Exception { BigInteger uint176Max = new BigInteger("95780971304118053647396689196894323976171195136475135"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint176", new ContractFunctionParameters().addUint176(uint176Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint176", new ContractFunctionParameters().addUint176(uint176Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint176Max); } @@ -977,9 +1171,12 @@ void canCallContractFunctionUint176Array() throws Exception { BigInteger uint176Max = new BigInteger("95780971304118053647396689196894323976171195136475135"); BigInteger[] uint176Array = {uint176Min, uint176Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint176Arr", new ContractFunctionParameters().addUint176Array(uint176Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint176Arr", new ContractFunctionParameters().addUint176Array(uint176Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint176[])").get(0); @@ -989,9 +1186,12 @@ void canCallContractFunctionUint176Array() throws Exception { @Test @DisplayName("Can receive uint184 min value from contract call") void canCallContractFunctionUint184Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint184", new ContractFunctionParameters().addUint184(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint184", new ContractFunctionParameters().addUint184(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1001,9 +1201,12 @@ void canCallContractFunctionUint184Min() throws Exception { void canCallContractFunctionUint184Max() throws Exception { BigInteger uint184Max = new BigInteger("24519928653854221733733552434404946937899825954937634815"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint184", new ContractFunctionParameters().addUint184(uint184Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint184", new ContractFunctionParameters().addUint184(uint184Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint184Max); } @@ -1015,9 +1218,12 @@ void canCallContractFunctionUint184Array() throws Exception { BigInteger uint184Max = new BigInteger("24519928653854221733733552434404946937899825954937634815"); BigInteger[] uint184Array = {uint184Min, uint184Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint184Arr", new ContractFunctionParameters().addUint184Array(uint184Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint184Arr", new ContractFunctionParameters().addUint184Array(uint184Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint184[])").get(0); @@ -1027,9 +1233,12 @@ void canCallContractFunctionUint184Array() throws Exception { @Test @DisplayName("Can receive uint192 min value from contract call") void canCallContractFunctionUint192Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint192", new ContractFunctionParameters().addUint192(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint192", new ContractFunctionParameters().addUint192(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1039,9 +1248,12 @@ void canCallContractFunctionUint192Min() throws Exception { void canCallContractFunctionUint192Max() throws Exception { BigInteger uint192Max = new BigInteger("6277101735386680763835789423207666416102355444464034512895"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint192", new ContractFunctionParameters().addUint192(uint192Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint192", new ContractFunctionParameters().addUint192(uint192Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint192Max); } @@ -1053,9 +1265,12 @@ void canCallContractFunctionUint192Array() throws Exception { BigInteger uint192Max = new BigInteger("6277101735386680763835789423207666416102355444464034512895"); BigInteger[] uint192Array = {uint192Min, uint192Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint192Arr", new ContractFunctionParameters().addUint192Array(uint192Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint192Arr", new ContractFunctionParameters().addUint192Array(uint192Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint192[])").get(0); @@ -1065,9 +1280,12 @@ void canCallContractFunctionUint192Array() throws Exception { @Test @DisplayName("Can receive uint200 min value from contract call") void canCallContractFunctionUint200Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint200", new ContractFunctionParameters().addUint200(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint200", new ContractFunctionParameters().addUint200(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1077,9 +1295,12 @@ void canCallContractFunctionUint200Min() throws Exception { void canCallContractFunctionUint200Max() throws Exception { BigInteger uint200Max = new BigInteger("1606938044258990275541962092341162602522202993782792835301375"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint200", new ContractFunctionParameters().addUint200(uint200Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint200", new ContractFunctionParameters().addUint200(uint200Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint200Max); } @@ -1091,9 +1312,12 @@ void canCallContractFunctionUint200Array() throws Exception { BigInteger uint200Max = new BigInteger("1606938044258990275541962092341162602522202993782792835301375"); BigInteger[] uint200Array = {uint200Min, uint200Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint200Arr", new ContractFunctionParameters().addUint200Array(uint200Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint200Arr", new ContractFunctionParameters().addUint200Array(uint200Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint200[])").get(0); @@ -1103,9 +1327,12 @@ void canCallContractFunctionUint200Array() throws Exception { @Test @DisplayName("Can receive uint208 min value from contract call") void canCallContractFunctionUint208Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint208", new ContractFunctionParameters().addUint208(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint208", new ContractFunctionParameters().addUint208(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1115,9 +1342,12 @@ void canCallContractFunctionUint208Min() throws Exception { void canCallContractFunctionUint208Max() throws Exception { BigInteger uint208Max = new BigInteger("411376139330301510538742295639337626245683966408394965837152255"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint208", new ContractFunctionParameters().addUint208(uint208Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint208", new ContractFunctionParameters().addUint208(uint208Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint208Max); } @@ -1129,9 +1359,12 @@ void canCallContractFunctionUint208Array() throws Exception { BigInteger uint208Max = new BigInteger("411376139330301510538742295639337626245683966408394965837152255"); BigInteger[] uint208Array = {uint208Min, uint208Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint208Arr", new ContractFunctionParameters().addUint208Array(uint208Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint208Arr", new ContractFunctionParameters().addUint208Array(uint208Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint208[])").get(0); @@ -1141,9 +1374,12 @@ void canCallContractFunctionUint208Array() throws Exception { @Test @DisplayName("Can receive uint216 min value from contract call") void canCallContractFunctionUint216Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint216", new ContractFunctionParameters().addUint216(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint216", new ContractFunctionParameters().addUint216(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1153,9 +1389,12 @@ void canCallContractFunctionUint216Min() throws Exception { void canCallContractFunctionUint216Max() throws Exception { BigInteger uint216Max = new BigInteger("105312291668557186697918027683670432318895095400549111254310977535"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint216", new ContractFunctionParameters().addUint216(uint216Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint216", new ContractFunctionParameters().addUint216(uint216Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint216Max); } @@ -1167,9 +1406,12 @@ void canCallContractFunctionUint216Array() throws Exception { BigInteger uint216Max = new BigInteger("105312291668557186697918027683670432318895095400549111254310977535"); BigInteger[] uint216Array = {uint216Min, uint216Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint216Arr", new ContractFunctionParameters().addUint216Array(uint216Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint216Arr", new ContractFunctionParameters().addUint216Array(uint216Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint216[])").get(0); @@ -1179,9 +1421,12 @@ void canCallContractFunctionUint216Array() throws Exception { @Test @DisplayName("Can receive uint224 min value from contract call") void canCallContractFunctionUint224Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint224", new ContractFunctionParameters().addUint224(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint224", new ContractFunctionParameters().addUint224(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1191,9 +1436,12 @@ void canCallContractFunctionUint224Min() throws Exception { void canCallContractFunctionUint224Max() throws Exception { BigInteger uint224Max = new BigInteger("26959946667150639794667015087019630673637144422540572481103610249215"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint224", new ContractFunctionParameters().addUint224(uint224Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint224", new ContractFunctionParameters().addUint224(uint224Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint224Max); } @@ -1205,9 +1453,12 @@ void canCallContractFunctionUint224Array() throws Exception { BigInteger uint224Max = new BigInteger("26959946667150639794667015087019630673637144422540572481103610249215"); BigInteger[] uint224Array = {uint224Min, uint224Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint224Arr", new ContractFunctionParameters().addUint224Array(uint224Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint224Arr", new ContractFunctionParameters().addUint224Array(uint224Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint224[])").get(0); @@ -1217,9 +1468,12 @@ void canCallContractFunctionUint224Array() throws Exception { @Test @DisplayName("Can receive uint232 min value from contract call") void canCallContractFunctionUint232Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint232", new ContractFunctionParameters().addUint232(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint232", new ContractFunctionParameters().addUint232(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1227,12 +1481,15 @@ void canCallContractFunctionUint232Min() throws Exception { @Test @DisplayName("Can receive uint232 max value from contract call") void canCallContractFunctionUint232Max() throws Exception { - BigInteger uint232Max = new BigInteger( - "6901746346790563787434755862277025452451108972170386555162524223799295"); + BigInteger uint232Max = + new BigInteger("6901746346790563787434755862277025452451108972170386555162524223799295"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint232", new ContractFunctionParameters().addUint232(uint232Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint232", new ContractFunctionParameters().addUint232(uint232Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint232Max); } @@ -1241,13 +1498,16 @@ void canCallContractFunctionUint232Max() throws Exception { @DisplayName("Can receive uint232 array value from contract call") void canCallContractFunctionUint232Array() throws Exception { BigInteger uint232Min = BigInteger.ZERO; - BigInteger uint232Max = new BigInteger( - "6901746346790563787434755862277025452451108972170386555162524223799295"); + BigInteger uint232Max = + new BigInteger("6901746346790563787434755862277025452451108972170386555162524223799295"); BigInteger[] uint232Array = {uint232Min, uint232Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint232Arr", new ContractFunctionParameters().addUint232Array(uint232Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint232Arr", new ContractFunctionParameters().addUint232Array(uint232Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint232[])").get(0); @@ -1257,9 +1517,12 @@ void canCallContractFunctionUint232Array() throws Exception { @Test @DisplayName("Can receive uint240 min value from contract call") void canCallContractFunctionUint240Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint240", new ContractFunctionParameters().addUint240(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint240", new ContractFunctionParameters().addUint240(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1267,12 +1530,15 @@ void canCallContractFunctionUint240Min() throws Exception { @Test @DisplayName("Can receive uint240 max value from contract call") void canCallContractFunctionUint240Max() throws Exception { - BigInteger uint240Max = new BigInteger( - "1766847064778384329583297500742918515827483896875618958121606201292619775"); + BigInteger uint240Max = + new BigInteger("1766847064778384329583297500742918515827483896875618958121606201292619775"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint240", new ContractFunctionParameters().addUint240(uint240Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint240", new ContractFunctionParameters().addUint240(uint240Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint240Max); } @@ -1281,13 +1547,16 @@ void canCallContractFunctionUint240Max() throws Exception { @DisplayName("Can receive uint240 array value from contract call") void canCallContractFunctionUint240Array() throws Exception { BigInteger uint240Min = BigInteger.ZERO; - BigInteger uint240Max = new BigInteger( - "1766847064778384329583297500742918515827483896875618958121606201292619775"); + BigInteger uint240Max = + new BigInteger("1766847064778384329583297500742918515827483896875618958121606201292619775"); BigInteger[] uint240Array = {uint240Min, uint240Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint240Arr", new ContractFunctionParameters().addUint240Array(uint240Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint240Arr", new ContractFunctionParameters().addUint240Array(uint240Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint240[])").get(0); @@ -1297,9 +1566,12 @@ void canCallContractFunctionUint240Array() throws Exception { @Test @DisplayName("Can receive uint248 min value from contract call") void canCallContractFunctionUint248Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint248", new ContractFunctionParameters().addUint248(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint248", new ContractFunctionParameters().addUint248(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1307,12 +1579,15 @@ void canCallContractFunctionUint248Min() throws Exception { @Test @DisplayName("Can receive uint248 max value from contract call") void canCallContractFunctionUint248Max() throws Exception { - BigInteger uint248Max = new BigInteger( - "452312848583266388373324160190187140051835877600158453279131187530910662655"); + BigInteger uint248Max = + new BigInteger("452312848583266388373324160190187140051835877600158453279131187530910662655"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint248", new ContractFunctionParameters().addUint248(uint248Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint248", new ContractFunctionParameters().addUint248(uint248Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint248Max); } @@ -1321,13 +1596,16 @@ void canCallContractFunctionUint248Max() throws Exception { @DisplayName("Can receive uint248 array value from contract call") void canCallContractFunctionUint248Array() throws Exception { BigInteger uint248Min = BigInteger.ZERO; - BigInteger uint248Max = new BigInteger( - "452312848583266388373324160190187140051835877600158453279131187530910662655"); + BigInteger uint248Max = + new BigInteger("452312848583266388373324160190187140051835877600158453279131187530910662655"); BigInteger[] uint248Array = {uint248Min, uint248Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint248Arr", new ContractFunctionParameters().addUint248Array(uint248Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint248Arr", new ContractFunctionParameters().addUint248Array(uint248Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint248[])").get(0); @@ -1337,9 +1615,12 @@ void canCallContractFunctionUint248Array() throws Exception { @Test @DisplayName("Can receive uint256 min value from contract call") void canCallContractFunctionUint256Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint256", new ContractFunctionParameters().addUint256(BigInteger.ZERO)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint256", new ContractFunctionParameters().addUint256(BigInteger.ZERO)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(BigInteger.ZERO); } @@ -1349,9 +1630,12 @@ void canCallContractFunctionUint256Min() throws Exception { void canCallContractFunctionUint256Max() throws Exception { BigInteger uint256Max = new BigInteger("2").pow(256).subtract(BigInteger.ONE); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint256", new ContractFunctionParameters().addUint256(uint256Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint256", new ContractFunctionParameters().addUint256(uint256Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint256(0)).isEqualTo(uint256Max); } @@ -1363,9 +1647,12 @@ void canCallContractFunctionUint256Array() throws Exception { BigInteger uint256Max = new BigInteger("2").pow(256).subtract(BigInteger.ONE); BigInteger[] uint256Array = {uint256Min, uint256Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint256Arr", new ContractFunctionParameters().addUint256Array(uint256Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint256Arr", new ContractFunctionParameters().addUint256Array(uint256Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(uint256[])").get(0); @@ -1375,9 +1662,12 @@ void canCallContractFunctionUint256Array() throws Exception { @Test @DisplayName("Can receive int8 min value from contract call") void canCallContractFunctionInt8Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt8", new ContractFunctionParameters().addInt8(Byte.MIN_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt8", new ContractFunctionParameters().addInt8(Byte.MIN_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt8(0)).isEqualTo(Byte.MIN_VALUE); } @@ -1385,9 +1675,12 @@ void canCallContractFunctionInt8Min() throws Exception { @Test @DisplayName("Can receive int8 max value from contract call") void canCallContractFunctionInt8Max() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt8", new ContractFunctionParameters().addInt8(Byte.MAX_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt8", new ContractFunctionParameters().addInt8(Byte.MAX_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt8(0)).isEqualTo(Byte.MAX_VALUE); } @@ -1397,9 +1690,12 @@ void canCallContractFunctionInt8Max() throws Exception { void canCallContractFunctionInt8Array() throws Exception { byte[] int8Array = {Byte.MIN_VALUE, Byte.MAX_VALUE}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt8Arr", new ContractFunctionParameters().addInt8Array(int8Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt8Arr", new ContractFunctionParameters().addInt8Array(int8Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(int8[])").get(0); @@ -1412,9 +1708,12 @@ void canCallContractFunctionInt8Array() throws Exception { void canCallContractFunctionInt16Min() throws Exception { int int16Min = -32768; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt16", new ContractFunctionParameters().addInt16(int16Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt16", new ContractFunctionParameters().addInt16(int16Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt32(0)).isEqualTo(int16Min); } @@ -1424,9 +1723,12 @@ void canCallContractFunctionInt16Min() throws Exception { void canCallContractFunctionInt16Max() throws Exception { int int16Max = 32767; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt16", new ContractFunctionParameters().addInt16(int16Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt16", new ContractFunctionParameters().addInt16(int16Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt32(0)).isEqualTo(int16Max); } @@ -1438,9 +1740,12 @@ void canCallContractFunctionInt16Array() throws Exception { int int16Max = 32767; int[] int16Array = {int16Min, int16Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt16Arr", new ContractFunctionParameters().addInt16Array(int16Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt16Arr", new ContractFunctionParameters().addInt16Array(int16Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(int16[])").get(0); @@ -1452,9 +1757,12 @@ void canCallContractFunctionInt16Array() throws Exception { void canCallContractFunctionInt24Min() throws Exception { int int24Min = -8388608; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt24", new ContractFunctionParameters().addInt24(int24Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt24", new ContractFunctionParameters().addInt24(int24Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt32(0)).isEqualTo(int24Min); } @@ -1464,9 +1772,12 @@ void canCallContractFunctionInt24Min() throws Exception { void canCallContractFunctionInt24Max() throws Exception { int int24Max = 8388607; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt24", new ContractFunctionParameters().addInt24(int24Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt24", new ContractFunctionParameters().addInt24(int24Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt32(0)).isEqualTo(int24Max); } @@ -1478,9 +1789,12 @@ void canCallContractFunctionInt24Array() throws Exception { int int24Max = 8388607; int[] int24Array = {int24Min, int24Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt24Arr", new ContractFunctionParameters().addInt24Array(int24Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt24Arr", new ContractFunctionParameters().addInt24Array(int24Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(int24[])").get(0); @@ -1490,9 +1804,12 @@ void canCallContractFunctionInt24Array() throws Exception { @Test @DisplayName("Can receive int32 min value from contract call") void canCallContractFunctionInt32Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt32", new ContractFunctionParameters().addInt32(Integer.MIN_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt32", new ContractFunctionParameters().addInt32(Integer.MIN_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt32(0)).isEqualTo(Integer.MIN_VALUE); } @@ -1500,9 +1817,12 @@ void canCallContractFunctionInt32Min() throws Exception { @Test @DisplayName("Can receive int32 max value from contract call") void canCallContractFunctionInt32Max() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt32", new ContractFunctionParameters().addInt32(Integer.MAX_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt32", new ContractFunctionParameters().addInt32(Integer.MAX_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt32(0)).isEqualTo(Integer.MAX_VALUE); } @@ -1514,9 +1834,12 @@ void canCallContractFunctionInt32Array() throws Exception { int int32Max = Integer.MAX_VALUE; int[] int32Array = {int32Min, int32Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt32Arr", new ContractFunctionParameters().addInt32Array(int32Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt32Arr", new ContractFunctionParameters().addInt32Array(int32Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (int[]) response.getResult("(int32[])").get(0); @@ -1528,9 +1851,12 @@ void canCallContractFunctionInt32Array() throws Exception { void canCallContractFunctionInt40Min() throws Exception { long int40Min = -549755813888L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt40", new ContractFunctionParameters().addInt40(int40Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt40", new ContractFunctionParameters().addInt40(int40Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int40Min); } @@ -1540,9 +1866,12 @@ void canCallContractFunctionInt40Min() throws Exception { void canCallContractFunctionInt40Max() throws Exception { long int40Max = 549755813887L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt40", new ContractFunctionParameters().addInt40(int40Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt40", new ContractFunctionParameters().addInt40(int40Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int40Max); } @@ -1554,9 +1883,12 @@ void canCallContractFunctionInt40Array() throws Exception { long int40Max = 549755813887L; long[] int40Array = {int40Min, int40Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt40Arr", new ContractFunctionParameters().addInt40Array(int40Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt40Arr", new ContractFunctionParameters().addInt40Array(int40Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(int40[])").get(0); @@ -1568,9 +1900,12 @@ void canCallContractFunctionInt40Array() throws Exception { void canCallContractFunctionInt48Min() throws Exception { long int48Min = -140737488355328L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt48", new ContractFunctionParameters().addInt48(int48Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt48", new ContractFunctionParameters().addInt48(int48Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int48Min); } @@ -1580,9 +1915,12 @@ void canCallContractFunctionInt48Min() throws Exception { void canCallContractFunctionInt48Max() throws Exception { long int48Max = 140737488355327L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt48", new ContractFunctionParameters().addInt48(int48Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt48", new ContractFunctionParameters().addInt48(int48Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int48Max); } @@ -1594,9 +1932,12 @@ void canCallContractFunctionInt48Array() throws Exception { long int48Max = 140737488355327L; long[] int48Array = {int48Min, int48Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt48Arr", new ContractFunctionParameters().addInt48Array(int48Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt48Arr", new ContractFunctionParameters().addInt48Array(int48Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(int48[])").get(0); @@ -1608,9 +1949,12 @@ void canCallContractFunctionInt48Array() throws Exception { void canCallContractFunctionInt56Min() throws Exception { long int56Min = -36028797018963968L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt56", new ContractFunctionParameters().addInt56(int56Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt56", new ContractFunctionParameters().addInt56(int56Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int56Min); } @@ -1620,9 +1964,12 @@ void canCallContractFunctionInt56Min() throws Exception { void canCallContractFunctionInt56Max() throws Exception { long int56Max = 36028797018963967L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt56", new ContractFunctionParameters().addInt56(int56Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt56", new ContractFunctionParameters().addInt56(int56Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int56Max); } @@ -1634,9 +1981,12 @@ void canCallContractFunctionInt56Array() throws Exception { long int56Max = 36028797018963967L; long[] int56Array = {int56Min, int56Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt56Arr", new ContractFunctionParameters().addInt56Array(int56Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt56Arr", new ContractFunctionParameters().addInt56Array(int56Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(int56[])").get(0); @@ -1646,9 +1996,12 @@ void canCallContractFunctionInt56Array() throws Exception { @Test @DisplayName("Can receive int64 min value from contract call") void canCallContractFunctionInt64Min() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt64", new ContractFunctionParameters().addInt64(Long.MIN_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt64", new ContractFunctionParameters().addInt64(Long.MIN_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint64(0)).isEqualTo(Long.MIN_VALUE); } @@ -1656,9 +2009,12 @@ void canCallContractFunctionInt64Min() throws Exception { @Test @DisplayName("Can receive int64 max value from contract call") void canCallContractFunctionInt64Max() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnUint64", new ContractFunctionParameters().addUint64(Long.MAX_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnUint64", new ContractFunctionParameters().addUint64(Long.MAX_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getUint64(0)).isEqualTo(Long.MAX_VALUE); } @@ -1670,9 +2026,12 @@ void canCallContractFunctionInt64Array() throws Exception { long int64Max = Long.MAX_VALUE; long[] int64Array = {int64Min, int64Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt64Arr", new ContractFunctionParameters().addInt64Array(int64Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt64Arr", new ContractFunctionParameters().addInt64Array(int64Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (long[]) response.getResult("(int64[])").get(0); @@ -1684,9 +2043,12 @@ void canCallContractFunctionInt64Array() throws Exception { void canCallContractFunctionInt72Min() throws Exception { BigInteger int72Min = new BigInteger("-2361183241434822606848"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt72", new ContractFunctionParameters().addInt72(int72Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt72", new ContractFunctionParameters().addInt72(int72Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int72Min); } @@ -1696,9 +2058,12 @@ void canCallContractFunctionInt72Min() throws Exception { void canCallContractFunctionInt72Max() throws Exception { BigInteger int72Max = new BigInteger("2361183241434822606847"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt72", new ContractFunctionParameters().addInt72(int72Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt72", new ContractFunctionParameters().addInt72(int72Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int72Max); } @@ -1710,9 +2075,12 @@ void canCallContractFunctionInt72Array() throws Exception { BigInteger int72Max = new BigInteger("2361183241434822606847"); BigInteger[] int72Array = {int72Min, int72Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt72Arr", new ContractFunctionParameters().addInt72Array(int72Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt72Arr", new ContractFunctionParameters().addInt72Array(int72Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int72[])").get(0); @@ -1724,9 +2092,12 @@ void canCallContractFunctionInt72Array() throws Exception { void canCallContractFunctionInt80Min() throws Exception { BigInteger int80Min = new BigInteger("-604462909807314587353088"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt80", new ContractFunctionParameters().addInt80(int80Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt80", new ContractFunctionParameters().addInt80(int80Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int80Min); } @@ -1736,9 +2107,12 @@ void canCallContractFunctionInt80Min() throws Exception { void canCallContractFunctionInt80Max() throws Exception { BigInteger int80Max = new BigInteger("604462909807314587353087"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt80", new ContractFunctionParameters().addInt80(int80Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt80", new ContractFunctionParameters().addInt80(int80Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int80Max); } @@ -1750,9 +2124,12 @@ void canCallContractFunctionInt80Array() throws Exception { BigInteger int80Max = new BigInteger("604462909807314587353087"); BigInteger[] int80Array = {int80Min, int80Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt80Arr", new ContractFunctionParameters().addInt80Array(int80Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt80Arr", new ContractFunctionParameters().addInt80Array(int80Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int80[])").get(0); @@ -1764,9 +2141,12 @@ void canCallContractFunctionInt80Array() throws Exception { void canCallContractFunctionInt88Min() throws Exception { BigInteger int88Min = new BigInteger("-154742504910672534362390528"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt88", new ContractFunctionParameters().addInt88(int88Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt88", new ContractFunctionParameters().addInt88(int88Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int88Min); } @@ -1776,9 +2156,12 @@ void canCallContractFunctionInt88Min() throws Exception { void canCallContractFunctionInt88Max() throws Exception { BigInteger int88Max = new BigInteger("154742504910672534362390527"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt88", new ContractFunctionParameters().addInt88(int88Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt88", new ContractFunctionParameters().addInt88(int88Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int88Max); } @@ -1790,9 +2173,12 @@ void canCallContractFunctionInt88Array() throws Exception { BigInteger int88Max = new BigInteger("154742504910672534362390527"); BigInteger[] int88Array = {int88Min, int88Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt88Arr", new ContractFunctionParameters().addInt88Array(int88Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt88Arr", new ContractFunctionParameters().addInt88Array(int88Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int88[])").get(0); @@ -1804,9 +2190,12 @@ void canCallContractFunctionInt88Array() throws Exception { void canCallContractFunctionInt96Min() throws Exception { BigInteger int96Min = new BigInteger("-39614081257132168796771975168"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt96", new ContractFunctionParameters().addInt96(int96Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt96", new ContractFunctionParameters().addInt96(int96Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int96Min); } @@ -1816,9 +2205,12 @@ void canCallContractFunctionInt96Min() throws Exception { void canCallContractFunctionInt96Max() throws Exception { BigInteger int96Max = new BigInteger("39614081257132168796771975167"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt96", new ContractFunctionParameters().addInt96(int96Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt96", new ContractFunctionParameters().addInt96(int96Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int96Max); } @@ -1830,9 +2222,12 @@ void canCallContractFunctionInt96Array() throws Exception { BigInteger int96Max = new BigInteger("39614081257132168796771975167"); BigInteger[] int96Array = {int96Min, int96Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt96Arr", new ContractFunctionParameters().addInt96Array(int96Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt96Arr", new ContractFunctionParameters().addInt96Array(int96Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int96[])").get(0); @@ -1844,9 +2239,12 @@ void canCallContractFunctionInt96Array() throws Exception { void canCallContractFunctionInt104Min() throws Exception { BigInteger int104Min = new BigInteger("-10141204801825835211973625643008"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt104", new ContractFunctionParameters().addInt104(int104Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt104", new ContractFunctionParameters().addInt104(int104Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int104Min); } @@ -1856,9 +2254,12 @@ void canCallContractFunctionInt104Min() throws Exception { void canCallContractFunctionInt104Max() throws Exception { BigInteger int104Max = new BigInteger("10141204801825835211973625643007"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt104", new ContractFunctionParameters().addInt104(int104Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt104", new ContractFunctionParameters().addInt104(int104Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int104Max); } @@ -1870,9 +2271,12 @@ void canCallContractFunctionInt104Array() throws Exception { BigInteger int104Max = new BigInteger("10141204801825835211973625643007"); BigInteger[] int104Array = {int104Min, int104Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt104Arr", new ContractFunctionParameters().addInt104Array(int104Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt104Arr", new ContractFunctionParameters().addInt104Array(int104Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int104[])").get(0); @@ -1884,9 +2288,12 @@ void canCallContractFunctionInt104Array() throws Exception { void canCallContractFunctionInt112Min() throws Exception { BigInteger int112Min = new BigInteger("-2596148429267413814265248164610048"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt112", new ContractFunctionParameters().addInt112(int112Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt112", new ContractFunctionParameters().addInt112(int112Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int112Min); } @@ -1896,9 +2303,12 @@ void canCallContractFunctionInt112Min() throws Exception { void canCallContractFunctionInt112Max() throws Exception { BigInteger int112Max = new BigInteger("2596148429267413814265248164610047"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt112", new ContractFunctionParameters().addInt112(int112Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt112", new ContractFunctionParameters().addInt112(int112Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int112Max); } @@ -1910,9 +2320,12 @@ void canCallContractFunctionInt112Array() throws Exception { BigInteger int112Max = new BigInteger("2596148429267413814265248164610047"); BigInteger[] int112Array = {int112Min, int112Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt112Arr", new ContractFunctionParameters().addInt112Array(int112Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt112Arr", new ContractFunctionParameters().addInt112Array(int112Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int112[])").get(0); @@ -1924,9 +2337,12 @@ void canCallContractFunctionInt112Array() throws Exception { void canCallContractFunctionInt120Min() throws Exception { BigInteger int120Min = new BigInteger("-664613997892457936451903530140172288"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt120", new ContractFunctionParameters().addInt120(int120Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt120", new ContractFunctionParameters().addInt120(int120Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int120Min); } @@ -1936,9 +2352,12 @@ void canCallContractFunctionInt120Min() throws Exception { void canCallContractFunctionInt120Max() throws Exception { BigInteger int120Max = new BigInteger("664613997892457936451903530140172287"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt120", new ContractFunctionParameters().addInt120(int120Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt120", new ContractFunctionParameters().addInt120(int120Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int120Max); } @@ -1950,9 +2369,12 @@ void canCallContractFunctionInt120Array() throws Exception { BigInteger int120Max = new BigInteger("664613997892457936451903530140172287"); BigInteger[] int120Array = {int120Min, int120Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt120Arr", new ContractFunctionParameters().addInt120Array(int120Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt120Arr", new ContractFunctionParameters().addInt120Array(int120Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int120[])").get(0); @@ -1964,9 +2386,12 @@ void canCallContractFunctionInt120Array() throws Exception { void canCallContractFunctionInt128Min() throws Exception { BigInteger int128Min = new BigInteger("-170141183460469231731687303715884105728"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt128", new ContractFunctionParameters().addInt128(int128Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt128", new ContractFunctionParameters().addInt128(int128Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int128Min); } @@ -1976,9 +2401,12 @@ void canCallContractFunctionInt128Min() throws Exception { void canCallContractFunctionInt128Max() throws Exception { BigInteger int128Max = new BigInteger("170141183460469231731687303715884105727"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt128", new ContractFunctionParameters().addInt128(int128Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt128", new ContractFunctionParameters().addInt128(int128Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int128Max); } @@ -1990,9 +2418,12 @@ void canCallContractFunctionInt128Array() throws Exception { BigInteger int128Max = new BigInteger("170141183460469231731687303715884105727"); BigInteger[] int128Array = {int128Min, int128Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt128Arr", new ContractFunctionParameters().addInt128Array(int128Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt128Arr", new ContractFunctionParameters().addInt128Array(int128Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int128[])").get(0); @@ -2004,9 +2435,12 @@ void canCallContractFunctionInt128Array() throws Exception { void canCallContractFunctionInt136Min() throws Exception { BigInteger int136Min = new BigInteger("-43556142965880123323311949751266331066368"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt136", new ContractFunctionParameters().addInt136(int136Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt136", new ContractFunctionParameters().addInt136(int136Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int136Min); } @@ -2016,9 +2450,12 @@ void canCallContractFunctionInt136Min() throws Exception { void canCallContractFunctionInt136Max() throws Exception { BigInteger int136Max = new BigInteger("43556142965880123323311949751266331066367"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt136", new ContractFunctionParameters().addInt136(int136Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt136", new ContractFunctionParameters().addInt136(int136Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int136Max); } @@ -2030,9 +2467,12 @@ void canCallContractFunctionInt136Array() throws Exception { BigInteger int136Max = new BigInteger("43556142965880123323311949751266331066367"); BigInteger[] int136Array = {int136Min, int136Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt136Arr", new ContractFunctionParameters().addInt136Array(int136Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt136Arr", new ContractFunctionParameters().addInt136Array(int136Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int136[])").get(0); @@ -2044,9 +2484,12 @@ void canCallContractFunctionInt136Array() throws Exception { void canCallContractFunctionInt144Min() throws Exception { BigInteger int144Min = new BigInteger("-11150372599265311570767859136324180752990208"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt144", new ContractFunctionParameters().addInt144(int144Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt144", new ContractFunctionParameters().addInt144(int144Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int144Min); } @@ -2056,9 +2499,12 @@ void canCallContractFunctionInt144Min() throws Exception { void canCallContractFunctionInt144Max() throws Exception { BigInteger int144Max = new BigInteger("11150372599265311570767859136324180752990207"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt144", new ContractFunctionParameters().addInt144(int144Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt144", new ContractFunctionParameters().addInt144(int144Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int144Max); } @@ -2070,9 +2516,12 @@ void canCallContractFunctionInt144Array() throws Exception { BigInteger int144Max = new BigInteger("11150372599265311570767859136324180752990207"); BigInteger[] int144Array = {int144Min, int144Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt144Arr", new ContractFunctionParameters().addInt144Array(int144Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt144Arr", new ContractFunctionParameters().addInt144Array(int144Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int144[])").get(0); @@ -2084,9 +2533,12 @@ void canCallContractFunctionInt144Array() throws Exception { void canCallContractFunctionInt152Min() throws Exception { BigInteger int152Min = new BigInteger("-2854495385411919762116571938898990272765493248"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt152", new ContractFunctionParameters().addInt152(int152Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt152", new ContractFunctionParameters().addInt152(int152Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int152Min); } @@ -2096,9 +2548,12 @@ void canCallContractFunctionInt152Min() throws Exception { void canCallContractFunctionInt152Max() throws Exception { BigInteger int152Max = new BigInteger("2854495385411919762116571938898990272765493247"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt152", new ContractFunctionParameters().addInt152(int152Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt152", new ContractFunctionParameters().addInt152(int152Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int152Max); } @@ -2110,9 +2565,12 @@ void canCallContractFunctionInt152Array() throws Exception { BigInteger int152Max = new BigInteger("2854495385411919762116571938898990272765493247"); BigInteger[] int152Array = {int152Min, int152Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt152Arr", new ContractFunctionParameters().addInt152Array(int152Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt152Arr", new ContractFunctionParameters().addInt152Array(int152Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int152[])").get(0); @@ -2124,9 +2582,12 @@ void canCallContractFunctionInt152Array() throws Exception { void canCallContractFunctionInt160Min() throws Exception { BigInteger int160Min = new BigInteger("-730750818665451459101842416358141509827966271488"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt160", new ContractFunctionParameters().addInt160(int160Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt160", new ContractFunctionParameters().addInt160(int160Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int160Min); } @@ -2136,9 +2597,12 @@ void canCallContractFunctionInt160Min() throws Exception { void canCallContractFunctionInt160Max() throws Exception { BigInteger int160Max = new BigInteger("730750818665451459101842416358141509827966271487"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt160", new ContractFunctionParameters().addInt160(int160Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt160", new ContractFunctionParameters().addInt160(int160Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int160Max); } @@ -2150,9 +2614,12 @@ void canCallContractFunctionInt160Array() throws Exception { BigInteger int160Max = new BigInteger("730750818665451459101842416358141509827966271487"); BigInteger[] int160Array = {int160Min, int160Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt160Arr", new ContractFunctionParameters().addInt160Array(int160Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt160Arr", new ContractFunctionParameters().addInt160Array(int160Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int160[])").get(0); @@ -2164,9 +2631,12 @@ void canCallContractFunctionInt160Array() throws Exception { void canCallContractFunctionInt168Min() throws Exception { BigInteger int168Min = new BigInteger("-187072209578355573530071658587684226515959365500928"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt168", new ContractFunctionParameters().addInt168(int168Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt168", new ContractFunctionParameters().addInt168(int168Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int168Min); } @@ -2176,9 +2646,12 @@ void canCallContractFunctionInt168Min() throws Exception { void canCallContractFunctionInt168Max() throws Exception { BigInteger int168Max = new BigInteger("187072209578355573530071658587684226515959365500927"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt168", new ContractFunctionParameters().addInt168(int168Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt168", new ContractFunctionParameters().addInt168(int168Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int168Max); } @@ -2190,9 +2663,12 @@ void canCallContractFunctionInt168Array() throws Exception { BigInteger int168Max = new BigInteger("187072209578355573530071658587684226515959365500927"); BigInteger[] int168Array = {int168Min, int168Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt168Arr", new ContractFunctionParameters().addInt168Array(int168Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt168Arr", new ContractFunctionParameters().addInt168Array(int168Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int168[])").get(0); @@ -2204,9 +2680,12 @@ void canCallContractFunctionInt168Array() throws Exception { void canCallContractFunctionInt176Min() throws Exception { BigInteger int176Min = new BigInteger("-47890485652059026823698344598447161988085597568237568"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt176", new ContractFunctionParameters().addInt176(int176Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt176", new ContractFunctionParameters().addInt176(int176Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int176Min); } @@ -2216,9 +2695,12 @@ void canCallContractFunctionInt176Min() throws Exception { void canCallContractFunctionInt176Max() throws Exception { BigInteger int176Max = new BigInteger("47890485652059026823698344598447161988085597568237567"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt176", new ContractFunctionParameters().addInt176(int176Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt176", new ContractFunctionParameters().addInt176(int176Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int176Max); } @@ -2230,9 +2712,12 @@ void canCallContractFunctionInt176Array() throws Exception { BigInteger int176Max = new BigInteger("47890485652059026823698344598447161988085597568237567"); BigInteger[] int176Array = {int176Min, int176Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt176Arr", new ContractFunctionParameters().addInt176Array(int176Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt176Arr", new ContractFunctionParameters().addInt176Array(int176Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int176[])").get(0); @@ -2244,9 +2729,12 @@ void canCallContractFunctionInt176Array() throws Exception { void canCallContractFunctionInt184Min() throws Exception { BigInteger int184Min = new BigInteger("-12259964326927110866866776217202473468949912977468817408"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt184", new ContractFunctionParameters().addInt184(int184Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt184", new ContractFunctionParameters().addInt184(int184Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int184Min); } @@ -2256,9 +2744,12 @@ void canCallContractFunctionInt184Min() throws Exception { void canCallContractFunctionInt184Max() throws Exception { BigInteger int184Max = new BigInteger("12259964326927110866866776217202473468949912977468817407"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt184", new ContractFunctionParameters().addInt184(int184Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt184", new ContractFunctionParameters().addInt184(int184Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int184Max); } @@ -2270,9 +2761,12 @@ void canCallContractFunctionInt184Array() throws Exception { BigInteger int184Max = new BigInteger("12259964326927110866866776217202473468949912977468817407"); BigInteger[] int184Array = {int184Min, int184Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt184Arr", new ContractFunctionParameters().addInt184Array(int184Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt184Arr", new ContractFunctionParameters().addInt184Array(int184Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int184[])").get(0); @@ -2284,9 +2778,12 @@ void canCallContractFunctionInt184Array() throws Exception { void canCallContractFunctionInt192Min() throws Exception { BigInteger int192Min = new BigInteger("-3138550867693340381917894711603833208051177722232017256448"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt192", new ContractFunctionParameters().addInt192(int192Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt192", new ContractFunctionParameters().addInt192(int192Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int192Min); } @@ -2296,9 +2793,12 @@ void canCallContractFunctionInt192Min() throws Exception { void canCallContractFunctionInt192Max() throws Exception { BigInteger int192Max = new BigInteger("3138550867693340381917894711603833208051177722232017256447"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt192", new ContractFunctionParameters().addInt192(int192Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt192", new ContractFunctionParameters().addInt192(int192Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int192Max); } @@ -2310,9 +2810,12 @@ void canCallContractFunctionInt192Array() throws Exception { BigInteger int192Max = new BigInteger("3138550867693340381917894711603833208051177722232017256447"); BigInteger[] int192Array = {int192Min, int192Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt192Arr", new ContractFunctionParameters().addInt192Array(int192Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt192Arr", new ContractFunctionParameters().addInt192Array(int192Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int192[])").get(0); @@ -2324,9 +2827,12 @@ void canCallContractFunctionInt192Array() throws Exception { void canCallContractFunctionInt200Min() throws Exception { BigInteger int200Min = new BigInteger("-803469022129495137770981046170581301261101496891396417650688"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt200", new ContractFunctionParameters().addInt200(int200Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt200", new ContractFunctionParameters().addInt200(int200Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int200Min); } @@ -2336,9 +2842,12 @@ void canCallContractFunctionInt200Min() throws Exception { void canCallContractFunctionInt200Max() throws Exception { BigInteger int200Max = new BigInteger("803469022129495137770981046170581301261101496891396417650687"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt200", new ContractFunctionParameters().addInt200(int200Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt200", new ContractFunctionParameters().addInt200(int200Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int200Max); } @@ -2350,9 +2859,12 @@ void canCallContractFunctionInt200Array() throws Exception { BigInteger int200Max = new BigInteger("803469022129495137770981046170581301261101496891396417650687"); BigInteger[] int200Array = {int200Min, int200Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt200Arr", new ContractFunctionParameters().addInt200Array(int200Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt200Arr", new ContractFunctionParameters().addInt200Array(int200Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int200[])").get(0); @@ -2364,9 +2876,12 @@ void canCallContractFunctionInt200Array() throws Exception { void canCallContractFunctionInt208Min() throws Exception { BigInteger int208Min = new BigInteger("-205688069665150755269371147819668813122841983204197482918576128"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt208", new ContractFunctionParameters().addInt208(int208Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt208", new ContractFunctionParameters().addInt208(int208Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int208Min); } @@ -2376,9 +2891,12 @@ void canCallContractFunctionInt208Min() throws Exception { void canCallContractFunctionInt208Max() throws Exception { BigInteger int208Max = new BigInteger("205688069665150755269371147819668813122841983204197482918576127"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt208", new ContractFunctionParameters().addInt208(int208Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt208", new ContractFunctionParameters().addInt208(int208Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int208Max); } @@ -2390,9 +2908,12 @@ void canCallContractFunctionInt208Array() throws Exception { BigInteger int208Max = new BigInteger("205688069665150755269371147819668813122841983204197482918576127"); BigInteger[] int208Array = {int208Min, int208Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt208Arr", new ContractFunctionParameters().addInt208Array(int208Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt208Arr", new ContractFunctionParameters().addInt208Array(int208Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int208[])").get(0); @@ -2404,9 +2925,12 @@ void canCallContractFunctionInt208Array() throws Exception { void canCallContractFunctionInt216Min() throws Exception { BigInteger int216Min = new BigInteger("-52656145834278593348959013841835216159447547700274555627155488768"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt216", new ContractFunctionParameters().addInt216(int216Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt216", new ContractFunctionParameters().addInt216(int216Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int216Min); } @@ -2416,9 +2940,12 @@ void canCallContractFunctionInt216Min() throws Exception { void canCallContractFunctionInt216Max() throws Exception { BigInteger int216Max = new BigInteger("52656145834278593348959013841835216159447547700274555627155488767"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt216", new ContractFunctionParameters().addInt216(int216Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt216", new ContractFunctionParameters().addInt216(int216Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int216Max); } @@ -2430,9 +2957,12 @@ void canCallContractFunctionInt216Array() throws Exception { BigInteger int216Max = new BigInteger("52656145834278593348959013841835216159447547700274555627155488767"); BigInteger[] int216Array = {int216Min, int216Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt216Arr", new ContractFunctionParameters().addInt216Array(int216Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt216Arr", new ContractFunctionParameters().addInt216Array(int216Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int216[])").get(0); @@ -2444,9 +2974,12 @@ void canCallContractFunctionInt216Array() throws Exception { void canCallContractFunctionInt224Min() throws Exception { BigInteger int224Min = new BigInteger("-13479973333575319897333507543509815336818572211270286240551805124608"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt224", new ContractFunctionParameters().addInt224(int224Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt224", new ContractFunctionParameters().addInt224(int224Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int224Min); } @@ -2456,9 +2989,12 @@ void canCallContractFunctionInt224Min() throws Exception { void canCallContractFunctionInt224Max() throws Exception { BigInteger int224Max = new BigInteger("13479973333575319897333507543509815336818572211270286240551805124607"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt224", new ContractFunctionParameters().addInt224(int224Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt224", new ContractFunctionParameters().addInt224(int224Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int224Max); } @@ -2470,9 +3006,12 @@ void canCallContractFunctionInt224Array() throws Exception { BigInteger int224Max = new BigInteger("13479973333575319897333507543509815336818572211270286240551805124607"); BigInteger[] int224Array = {int224Min, int224Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt224Arr", new ContractFunctionParameters().addInt224Array(int224Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt224Arr", new ContractFunctionParameters().addInt224Array(int224Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int224[])").get(0); @@ -2482,12 +3021,15 @@ void canCallContractFunctionInt224Array() throws Exception { @Test @DisplayName("Can receive int232 min value from contract call") void canCallContractFunctionInt232Min() throws Exception { - BigInteger int232Min = new BigInteger( - "-3450873173395281893717377931138512726225554486085193277581262111899648"); + BigInteger int232Min = + new BigInteger("-3450873173395281893717377931138512726225554486085193277581262111899648"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt232", new ContractFunctionParameters().addInt232(int232Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt232", new ContractFunctionParameters().addInt232(int232Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int232Min); } @@ -2497,9 +3039,12 @@ void canCallContractFunctionInt232Min() throws Exception { void canCallContractFunctionInt232Max() throws Exception { BigInteger int232Max = new BigInteger("3450873173395281893717377931138512726225554486085193277581262111899647"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt232", new ContractFunctionParameters().addInt232(int232Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt232", new ContractFunctionParameters().addInt232(int232Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int232Max); } @@ -2507,14 +3052,17 @@ void canCallContractFunctionInt232Max() throws Exception { @Test @DisplayName("Can receive int232 array value from contract call") void canCallContractFunctionInt232Array() throws Exception { - BigInteger int232Min = new BigInteger( - "-3450873173395281893717377931138512726225554486085193277581262111899648"); + BigInteger int232Min = + new BigInteger("-3450873173395281893717377931138512726225554486085193277581262111899648"); BigInteger int232Max = new BigInteger("3450873173395281893717377931138512726225554486085193277581262111899647"); BigInteger[] int232Array = {int232Min, int232Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt232Arr", new ContractFunctionParameters().addInt232Array(int232Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt232Arr", new ContractFunctionParameters().addInt232Array(int232Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int232[])").get(0); @@ -2524,12 +3072,15 @@ void canCallContractFunctionInt232Array() throws Exception { @Test @DisplayName("Can receive int240 min value from contract call") void canCallContractFunctionInt240Min() throws Exception { - BigInteger int240Min = new BigInteger( - "-883423532389192164791648750371459257913741948437809479060803100646309888"); + BigInteger int240Min = + new BigInteger("-883423532389192164791648750371459257913741948437809479060803100646309888"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt240", new ContractFunctionParameters().addInt240(int240Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt240", new ContractFunctionParameters().addInt240(int240Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int240Min); } @@ -2537,12 +3088,15 @@ void canCallContractFunctionInt240Min() throws Exception { @Test @DisplayName("Can receive int240 max value from contract call") void canCallContractFunctionInt240Max() throws Exception { - BigInteger int240Max = new BigInteger( - "883423532389192164791648750371459257913741948437809479060803100646309887"); + BigInteger int240Max = + new BigInteger("883423532389192164791648750371459257913741948437809479060803100646309887"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt240", new ContractFunctionParameters().addInt240(int240Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt240", new ContractFunctionParameters().addInt240(int240Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int240Max); } @@ -2550,15 +3104,18 @@ void canCallContractFunctionInt240Max() throws Exception { @Test @DisplayName("Can receive int240 array value from contract call") void canCallContractFunctionInt240Array() throws Exception { - BigInteger int240Min = new BigInteger( - "-883423532389192164791648750371459257913741948437809479060803100646309888"); - BigInteger int240Max = new BigInteger( - "883423532389192164791648750371459257913741948437809479060803100646309887"); + BigInteger int240Min = + new BigInteger("-883423532389192164791648750371459257913741948437809479060803100646309888"); + BigInteger int240Max = + new BigInteger("883423532389192164791648750371459257913741948437809479060803100646309887"); BigInteger[] int240Array = {int240Min, int240Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt240Arr", new ContractFunctionParameters().addInt240Array(int240Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt240Arr", new ContractFunctionParameters().addInt240Array(int240Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int240[])").get(0); @@ -2568,12 +3125,15 @@ void canCallContractFunctionInt240Array() throws Exception { @Test @DisplayName("Can receive int248 min value from contract call") void canCallContractFunctionInt248Min() throws Exception { - BigInteger int248Min = new BigInteger( - "-226156424291633194186662080095093570025917938800079226639565593765455331328"); + BigInteger int248Min = + new BigInteger("-226156424291633194186662080095093570025917938800079226639565593765455331328"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt248", new ContractFunctionParameters().addInt248(int248Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt248", new ContractFunctionParameters().addInt248(int248Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int248Min); } @@ -2581,12 +3141,15 @@ void canCallContractFunctionInt248Min() throws Exception { @Test @DisplayName("Can receive int248 max value from contract call") void canCallContractFunctionInt248Max() throws Exception { - BigInteger int248Max = new BigInteger( - "226156424291633194186662080095093570025917938800079226639565593765455331327"); + BigInteger int248Max = + new BigInteger("226156424291633194186662080095093570025917938800079226639565593765455331327"); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt248", new ContractFunctionParameters().addInt248(int248Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt248", new ContractFunctionParameters().addInt248(int248Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int248Max); } @@ -2594,15 +3157,18 @@ void canCallContractFunctionInt248Max() throws Exception { @Test @DisplayName("Can receive int248 array value from contract call") void canCallContractFunctionInt248Array() throws Exception { - BigInteger int248Min = new BigInteger( - "-226156424291633194186662080095093570025917938800079226639565593765455331328"); - BigInteger int248Max = new BigInteger( - "226156424291633194186662080095093570025917938800079226639565593765455331327"); + BigInteger int248Min = + new BigInteger("-226156424291633194186662080095093570025917938800079226639565593765455331328"); + BigInteger int248Max = + new BigInteger("226156424291633194186662080095093570025917938800079226639565593765455331327"); BigInteger[] int248Array = {int248Min, int248Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt248Arr", new ContractFunctionParameters().addInt248Array(int248Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt248Arr", new ContractFunctionParameters().addInt248Array(int248Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int248[])").get(0); @@ -2612,11 +3178,15 @@ void canCallContractFunctionInt248Array() throws Exception { @Test @DisplayName("Can receive int256 min value from contract call") void canCallContractFunctionInt256Min() throws Exception { - BigInteger int256Min = new BigInteger("2").pow(256).divide(BigInteger.TWO).negate(); + BigInteger int256Min = + new BigInteger("2").pow(256).divide(BigInteger.TWO).negate(); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt256", new ContractFunctionParameters().addInt256(int256Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt256", new ContractFunctionParameters().addInt256(int256Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int256Min); } @@ -2624,11 +3194,15 @@ void canCallContractFunctionInt256Min() throws Exception { @Test @DisplayName("Can receive int256 max value from contract call") void canCallContractFunctionInt256Max() throws Exception { - BigInteger int256Max = new BigInteger("2").pow(256).subtract(BigInteger.ONE).divide(BigInteger.TWO); + BigInteger int256Max = + new BigInteger("2").pow(256).subtract(BigInteger.ONE).divide(BigInteger.TWO); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt256", new ContractFunctionParameters().addInt256(int256Max)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt256", new ContractFunctionParameters().addInt256(int256Max)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int256Max); } @@ -2636,13 +3210,18 @@ void canCallContractFunctionInt256Max() throws Exception { @Test @DisplayName("Can receive int256 array value from contract call") void canCallContractFunctionInt256Array() throws Exception { - BigInteger int256Min = new BigInteger("2").pow(256).divide(BigInteger.TWO).negate(); - BigInteger int256Max = new BigInteger("2").pow(256).subtract(BigInteger.ONE).divide(BigInteger.TWO); + BigInteger int256Min = + new BigInteger("2").pow(256).divide(BigInteger.TWO).negate(); + BigInteger int256Max = + new BigInteger("2").pow(256).subtract(BigInteger.ONE).divide(BigInteger.TWO); BigInteger[] int256Array = {int256Min, int256Max}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt256Arr", new ContractFunctionParameters().addInt256Array(int256Array)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt256Arr", new ContractFunctionParameters().addInt256Array(int256Array)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (BigInteger[]) response.getResult("(int256[])").get(0); @@ -2652,9 +3231,12 @@ void canCallContractFunctionInt256Array() throws Exception { @Test @DisplayName("Can receive multiple int8 values from contract call") void canCallContractFunctionMultipleInt8() throws Exception { - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnInt8Multiple", new ContractFunctionParameters().addInt8(Byte.MIN_VALUE)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnInt8Multiple", new ContractFunctionParameters().addInt8(Byte.MIN_VALUE)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt8(0)).isEqualTo(Byte.MIN_VALUE); assertThat(response.getInt8(1)).isEqualTo((byte) -108); @@ -2665,9 +3247,12 @@ void canCallContractFunctionMultipleInt8() throws Exception { void canCallContractFunctionMultipleInt40() throws Exception { long int40 = 549755813885L; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnMultipleInt40", new ContractFunctionParameters().addInt40(int40)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnMultipleInt40", new ContractFunctionParameters().addInt40(int40)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt64(0)).isEqualTo(int40); assertThat(response.getInt64(1)).isEqualTo(int40 + 1); @@ -2676,11 +3261,15 @@ void canCallContractFunctionMultipleInt40() throws Exception { @Test @DisplayName("Can receive multiple int256 values from contract call") void canCallContractFunctionMultipleInt256() throws Exception { - BigInteger int256Min = new BigInteger("2").pow(256).divide(BigInteger.TWO).negate(); + BigInteger int256Min = + new BigInteger("2").pow(256).divide(BigInteger.TWO).negate(); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnMultipleInt256", new ContractFunctionParameters().addInt256(int256Min)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnMultipleInt256", new ContractFunctionParameters().addInt256(int256Min)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getInt256(0)).isEqualTo(int256Min); assertThat(response.getInt256(1)).isEqualTo(int256Min.add(BigInteger.ONE)); @@ -2692,9 +3281,12 @@ void canCallContractFunctionMultipleTypes() throws Exception { var uint32Max = "4294967295"; int uint32MaxInt = Integer.parseUnsignedInt(uint32Max); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnMultipleTypeParams", new ContractFunctionParameters().addUint32(uint32MaxInt)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnMultipleTypeParams", new ContractFunctionParameters().addUint32(uint32MaxInt)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(Integer.toUnsignedString(response.getUint32(0))).isEqualTo(uint32Max); assertThat(response.getUint64(1)).isEqualTo(Long.parseUnsignedLong(uint32Max) - 1); @@ -2706,9 +3298,12 @@ void canCallContractFunctionMultipleTypes() throws Exception { void canCallContractFunctionStringType() throws Exception { var testString = "test"; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnString", new ContractFunctionParameters().addString(testString)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnString", new ContractFunctionParameters().addString(testString)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getString(0)).isEqualTo(testString); } @@ -2716,11 +3311,14 @@ void canCallContractFunctionStringType() throws Exception { @Test @DisplayName("Can receive string array value from contract call") void canCallContractFunctionStringArrayType() throws Exception { - var testStringArray = new String[]{"Test1", "Test2"}; + var testStringArray = new String[] {"Test1", "Test2"}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnStringArr", new ContractFunctionParameters().addStringArray(testStringArray)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnStringArr", new ContractFunctionParameters().addStringArray(testStringArray)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getStringArray(0).get(0)).isEqualTo(testStringArray[0]); assertThat(response.getStringArray(0).get(1)).isEqualTo(testStringArray[1]); @@ -2729,11 +3327,14 @@ void canCallContractFunctionStringArrayType() throws Exception { @Test @DisplayName("Can receive string array value from contract call with getResult function") void canCallContractFunctionStringArrayType_getResult() throws Exception { - var testStringArray = new String[]{"Test1", "Test2"}; + var testStringArray = new String[] {"Test1", "Test2"}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnStringArr", new ContractFunctionParameters().addStringArray(testStringArray)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnStringArr", new ContractFunctionParameters().addStringArray(testStringArray)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (String[]) response.getResult("(string[])").get(0); assertThat(responseResult).isEqualTo(testStringArray); @@ -2744,9 +3345,12 @@ void canCallContractFunctionStringArrayType_getResult() throws Exception { void canCallContractFunctionAddressType() throws Exception { var testAddress = "1234567890123456789012345678901234567890"; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnAddress", new ContractFunctionParameters().addAddress(testAddress)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnAddress", new ContractFunctionParameters().addAddress(testAddress)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getAddress(0)).isEqualTo(testAddress); } @@ -2754,17 +3358,22 @@ void canCallContractFunctionAddressType() throws Exception { @Test @DisplayName("Can receive address array value from contract call") void canCallContractFunctionAddressArrayType() throws Exception { - var testAddressArray = new String[]{"1234567890123456789012345678901234567890", - "1234567890123456789012345678901234567891"}; + var testAddressArray = + new String[] {"1234567890123456789012345678901234567890", "1234567890123456789012345678901234567891"}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnAddressArr", new ContractFunctionParameters().addAddressArray(testAddressArray)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnAddressArr", new ContractFunctionParameters().addAddressArray(testAddressArray)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (Address[]) response.getResult("(address[])").get(0); - Address[] testAddressArray_Address = Arrays.stream(testAddressArray).map(addressStr -> "0x" + addressStr) - .map(Address::wrap).toArray(Address[]::new); + Address[] testAddressArray_Address = Arrays.stream(testAddressArray) + .map(addressStr -> "0x" + addressStr) + .map(Address::wrap) + .toArray(Address[]::new); assertThat(responseResult).isEqualTo(testAddressArray_Address); } @@ -2774,9 +3383,12 @@ void canCallContractFunctionAddressArrayType() throws Exception { void canCallContractFunctionBooleanType() throws Exception { var testBoolean = true; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnBoolean", new ContractFunctionParameters().addBool(testBoolean)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnBoolean", new ContractFunctionParameters().addBool(testBoolean)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getBool(0)).isEqualTo(testBoolean); } @@ -2784,11 +3396,14 @@ void canCallContractFunctionBooleanType() throws Exception { @Test @DisplayName("Can receive boolean array value from contract call") void canCallContractFunctionBooleanArrayType() throws Exception { - var testBooleanArray = new boolean[]{true, false}; + var testBooleanArray = new boolean[] {true, false}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnBooleanArr", new ContractFunctionParameters().addBoolArray(testBooleanArray)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnBooleanArr", new ContractFunctionParameters().addBoolArray(testBooleanArray)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (boolean[]) response.getResult("(bool[])").get(0); @@ -2800,9 +3415,12 @@ void canCallContractFunctionBooleanArrayType() throws Exception { void canCallContractFunctionBytesType() throws Exception { var testBytes = "Test".getBytes(); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnBytes", new ContractFunctionParameters().addBytes(testBytes)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnBytes", new ContractFunctionParameters().addBytes(testBytes)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getBytes(0)).isEqualTo(testBytes); } @@ -2810,11 +3428,14 @@ void canCallContractFunctionBytesType() throws Exception { @Test @DisplayName("Can receive bytes array value from contract call") void canCallContractFunctionBytesArrayType() throws Exception { - byte[][] testBytes = new byte[][]{"Test1".getBytes(), "Test2".getBytes()}; + byte[][] testBytes = new byte[][] {"Test1".getBytes(), "Test2".getBytes()}; - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnBytesArr", new ContractFunctionParameters().addBytesArray(testBytes)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnBytesArr", new ContractFunctionParameters().addBytesArray(testBytes)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (byte[][]) response.getResult("(bytes[])").get(0); @@ -2828,9 +3449,12 @@ void canCallContractFunctionBytes32Type() throws Exception { byte[] testBytesLen32 = new byte[32]; System.arraycopy(testBytes, 0, testBytesLen32, 0, testBytes.length); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnBytes32", new ContractFunctionParameters().addBytes32(testBytesLen32)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnBytes32", new ContractFunctionParameters().addBytes32(testBytesLen32)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); assertThat(response.getBytes32(0)).isEqualTo(testBytesLen32); } @@ -2844,9 +3468,12 @@ void canCallContractFunctionBytes32ArrayType() throws Exception { System.arraycopy(testBytes, 0, testBytesLen32[0], 0, testBytes.length); System.arraycopy(testBytes2, 0, testBytesLen32[1], 0, testBytes2.length); - var response = new ContractCallQuery().setContractId(contractId).setGas(1500000) - .setFunction("returnBytes32Arr", new ContractFunctionParameters().addBytes32Array(testBytesLen32)) - .setQueryPayment(new Hbar(10)).execute(testEnv.client); + var response = new ContractCallQuery() + .setContractId(contractId) + .setGas(1500000) + .setFunction("returnBytes32Arr", new ContractFunctionParameters().addBytes32Array(testBytesLen32)) + .setQueryPayment(new Hbar(10)) + .execute(testEnv.client); var responseResult = (byte[][]) response.getResult("(bytes32[])").get(0); diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java index f756c2033f..c5bc55a4ab 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -34,33 +16,32 @@ class ContractIdPopulationIntegrationTest { @Test @DisplayName("Can populate ContractId num from mirror node (using sync method)") void canPopulateContractIdNumSync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - var testContractByteCode = "608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101cb806100606000396000f3fe608060405260043610610046576000357c01000000000000000000000000000000000000000000000000000000009004806341c0e1b51461004b578063cfae321714610062575b600080fd5b34801561005757600080fd5b506100606100f2565b005b34801561006e57600080fd5b50610077610162565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b757808201518184015260208101905061009c565b50505050905090810190601f1680156100e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610160573373ffffffffffffffffffffffffffffffffffffffff16ff5b565b60606040805190810160405280600d81526020017f48656c6c6f2c20776f726c64210000000000000000000000000000000000000081525090509056fea165627a7a72305820ae96fb3af7cde9c0abfe365272441894ab717f816f07f41f07b1cbede54e256e0029"; + var testContractByteCode = + "608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101cb806100606000396000f3fe608060405260043610610046576000357c01000000000000000000000000000000000000000000000000000000009004806341c0e1b51461004b578063cfae321714610062575b600080fd5b34801561005757600080fd5b506100606100f2565b005b34801561006e57600080fd5b50610077610162565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b757808201518184015260208101905061009c565b50505050905090810190601f1680156100e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610160573373ffffffffffffffffffffffffffffffffffffffff16ff5b565b60606040805190810160405280600d81526020017f48656c6c6f2c20776f726c64210000000000000000000000000000000000000081525090509056fea165627a7a72305820ae96fb3af7cde9c0abfe365272441894ab717f816f07f41f07b1cbede54e256e0029"; var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(testContractByteCode) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(testContractByteCode) + .execute(testEnv.client); var receipt = response.setValidateStatus(true).getReceipt(testEnv.client); var fileId = Objects.requireNonNull(receipt.fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(100000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::canPopulateContractIdNum]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(100000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::canPopulateContractIdNum]") + .execute(testEnv.client); receipt = response.setValidateStatus(true).getReceipt(testEnv.client); var contractId = Objects.requireNonNull(receipt.contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); var idMirror = ContractId.fromEvmAddress(0, 0, info.contractAccountId); Thread.sleep(5000); @@ -74,41 +55,40 @@ void canPopulateContractIdNumSync() throws Exception { @Test @DisplayName("Can populate ContractId num from mirror node (using async method)") void canPopulateContractIdNumAsync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - var testContractByteCode = "608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101cb806100606000396000f3fe608060405260043610610046576000357c01000000000000000000000000000000000000000000000000000000009004806341c0e1b51461004b578063cfae321714610062575b600080fd5b34801561005757600080fd5b506100606100f2565b005b34801561006e57600080fd5b50610077610162565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b757808201518184015260208101905061009c565b50505050905090810190601f1680156100e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610160573373ffffffffffffffffffffffffffffffffffffffff16ff5b565b60606040805190810160405280600d81526020017f48656c6c6f2c20776f726c64210000000000000000000000000000000000000081525090509056fea165627a7a72305820ae96fb3af7cde9c0abfe365272441894ab717f816f07f41f07b1cbede54e256e0029"; + var testContractByteCode = + "608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101cb806100606000396000f3fe608060405260043610610046576000357c01000000000000000000000000000000000000000000000000000000009004806341c0e1b51461004b578063cfae321714610062575b600080fd5b34801561005757600080fd5b506100606100f2565b005b34801561006e57600080fd5b50610077610162565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b757808201518184015260208101905061009c565b50505050905090810190601f1680156100e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610160573373ffffffffffffffffffffffffffffffffffffffff16ff5b565b60606040805190810160405280600d81526020017f48656c6c6f2c20776f726c64210000000000000000000000000000000000000081525090509056fea165627a7a72305820ae96fb3af7cde9c0abfe365272441894ab717f816f07f41f07b1cbede54e256e0029"; var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(testContractByteCode) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(testContractByteCode) + .execute(testEnv.client); var receipt = response.setValidateStatus(true).getReceipt(testEnv.client); var fileId = Objects.requireNonNull(receipt.fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(100000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::canPopulateContractIdNum]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(100000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::canPopulateContractIdNum]") + .execute(testEnv.client); receipt = response.setValidateStatus(true).getReceipt(testEnv.client); var contractId = Objects.requireNonNull(receipt.contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); var idMirror = ContractId.fromEvmAddress(0, 0, info.contractAccountId); Thread.sleep(5000); - var newContractId = idMirror.populateContractNumAsync(testEnv.client).get(); + var newContractId = + idMirror.populateContractNumAsync(testEnv.client).get(); assertThat(contractId.num).isEqualTo(newContractId.num); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java index 7c8e51e672..64b0fb8b42 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java @@ -1,34 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.*; + import com.hiero.sdk.*; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.*; - public class ContractInfoIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Can query contract info") @@ -36,48 +18,47 @@ void canQueryContractInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); assertThat(contractId.hashCode()).isGreaterThan(0); - assertThat(contractId.compareTo(ContractId.fromBytes(contractId.toBytes()))).isZero(); + assertThat(contractId.compareTo(ContractId.fromBytes(contractId.toBytes()))) + .isZero(); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); assertThat(Objects.requireNonNull(info.accountId).toString()).isEqualTo(contractId.toString()); assertThat(info.adminKey).isNotNull(); - assertThat(Objects.requireNonNull(info.adminKey).toString()).isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); + assertThat(Objects.requireNonNull(info.adminKey).toString()) + .isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -87,24 +68,22 @@ void canQueryContractInfoWhenAdminKeyIsNull() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); @@ -114,7 +93,6 @@ void canQueryContractInfoWhenAdminKeyIsNull() throws Exception { // assertEquals(info.adminKey, contractId); assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); - } } @@ -123,11 +101,11 @@ void canQueryContractInfoWhenAdminKeyIsNull() throws Exception { void cannotQueryContractInfoWhenContractIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractInfoQuery() - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractInfoQuery().execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); } } @@ -138,42 +116,38 @@ void getCostBigMaxContractInfoFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var infoQuery = new ContractInfoQuery() - .setContractId(contractId) - .setMaxQueryPayment(new Hbar(10000)); + var infoQuery = new ContractInfoQuery().setContractId(contractId).setMaxQueryPayment(new Hbar(10000)); var cost = infoQuery.getCost(testEnv.client); - var result = infoQuery - .execute(testEnv.client); + var result = infoQuery.execute(testEnv.client); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -183,41 +157,38 @@ void getCostSmallMaxContractInfoFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var infoQuery = new ContractInfoQuery() - .setContractId(contractId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var infoQuery = new ContractInfoQuery().setContractId(contractId).setMaxQueryPayment(Hbar.fromTinybars(1)); assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { infoQuery.execute(testEnv.client); }); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -227,41 +198,40 @@ void getCostInsufficientTxFeeContractInfoFunction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var infoQuery = new ContractInfoQuery() - .setContractId(contractId) - .setMaxQueryPayment(new Hbar(100)); + var infoQuery = new ContractInfoQuery().setContractId(contractId).setMaxQueryPayment(new Hbar(100)); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java index 250d7a4bb6..88043c20ad 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -32,7 +14,8 @@ import org.junit.jupiter.api.Test; public class ContractNonceInfoIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "6080604052348015600f57600080fd5b50604051601a90603b565b604051809103906000f0801580156035573d6000803e3d6000fd5b50506047565b605c8061009483390190565b603f806100556000396000f3fe6080604052600080fdfea2646970667358221220a20122cbad3457fedcc0600363d6e895f17048f5caa4afdab9e655123737567d64736f6c634300081200336080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122053dfd8835e3dc6fedfb8b4806460b9b7163f8a7248bac510c6d6808d9da9d6d364736f6c63430008120033"; + private static final String SMART_CONTRACT_BYTECODE = + "6080604052348015600f57600080fd5b50604051601a90603b565b604051809103906000f0801580156035573d6000803e3d6000fd5b50506047565b605c8061009483390190565b603f806100556000396000f3fe6080604052600080fdfea2646970667358221220a20122cbad3457fedcc0600363d6e895f17048f5caa4afdab9e655123737567d64736f6c634300081200336080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122053dfd8835e3dc6fedfb8b4806460b9b7163f8a7248bac510c6d6808d9da9d6d364736f6c63430008120033"; @Test @DisplayName("Contract Create of A nonce, which deploys contract B in CONSTRUCTOR") @@ -40,29 +23,36 @@ void canIncrementNonceThroughContractConstructor() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(100000) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractADeploysContractBInConstructor]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(100000) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractADeploysContractBInConstructor]") + .execute(testEnv.client); var contractFunctionResult = response.getRecord(testEnv.client).contractFunctionResult; ContractId contractA = contractFunctionResult.contractId; ContractId contractB = contractFunctionResult.contractNonces.stream() - .filter(contractNonce -> !contractNonce.contractId.equals(contractA)).findFirst().get().contractId; + .filter(contractNonce -> !contractNonce.contractId.equals(contractA)) + .findFirst() + .get() + .contractId; ContractNonceInfo contractANonceInfo = contractFunctionResult.contractNonces.stream() - .filter(contractNonce -> contractNonce.contractId.equals(contractA)).findFirst().get(); + .filter(contractNonce -> contractNonce.contractId.equals(contractA)) + .findFirst() + .get(); ContractNonceInfo contractBNonceInfo = contractFunctionResult.contractNonces.stream() - .filter(contractNonce -> contractNonce.contractId.equals(contractB)).findFirst().get(); + .filter(contractNonce -> contractNonce.contractId.equals(contractB)) + .findFirst() + .get(); // A.nonce = 2 assertThat(contractANonceInfo.nonce).isEqualTo(2); @@ -74,16 +64,15 @@ void canIncrementNonceThroughContractConstructor() throws Exception { var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java index a7682e6751..141dce31c0 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ContractCreateTransaction; import com.hiero.sdk.ContractDeleteTransaction; import com.hiero.sdk.ContractFunctionParameters; @@ -29,16 +14,13 @@ import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class ContractUpdateIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("Can update contract") @@ -46,63 +28,60 @@ void canUpdateContract() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); - var info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); assertThat(Objects.requireNonNull(info.accountId).toString()).isEqualTo(contractId.toString()); assertThat(info.adminKey).isNotNull(); - assertThat(Objects.requireNonNull(info.adminKey).toString()).isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); + assertThat(Objects.requireNonNull(info.adminKey).toString()) + .isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractCreateTransaction]"); new ContractUpdateTransaction() - .setContractId(contractId) - .setContractMemo("[e2e::ContractUpdateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setContractMemo("[e2e::ContractUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + info = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(info.contractId).isEqualTo(contractId); assertThat(info.accountId).isNotNull(); assertThat(Objects.requireNonNull(info.accountId).toString()).isEqualTo(contractId.toString()); assertThat(info.adminKey).isNotNull(); - assertThat(Objects.requireNonNull(info.adminKey).toString()).isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); + assertThat(Objects.requireNonNull(info.adminKey).toString()) + .isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); assertThat(info.storage).isEqualTo(128); assertThat(info.contractMemo).isEqualTo("[e2e::ContractUpdateTransaction]"); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -111,13 +90,14 @@ void canUpdateContract() throws Exception { void cannotUpdateContractWhenContractIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new ContractUpdateTransaction() - .setContractMemo("[e2e::ContractUpdateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new ContractUpdateTransaction() + .setContractMemo("[e2e::ContractUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CONTRACT_ID.toString()); } } @@ -127,31 +107,30 @@ void cannotUpdateContractThatIsImmutable() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .contractId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new ContractUpdateTransaction() - .setContractId(contractId) - .setContractMemo("[e2e::ContractUpdateTransaction]") + var contractId = Objects.requireNonNull(new ContractCreateTransaction() + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.MODIFYING_IMMUTABLE_CONTRACT.toString()); - + .getReceipt(testEnv.client) + .contractId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new ContractUpdateTransaction() + .setContractId(contractId) + .setContractMemo("[e2e::ContractUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.MODIFYING_IMMUTABLE_CONTRACT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java index fcdec63407..713ea90fc0 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import com.hiero.sdk.AccountCreateTransaction; @@ -54,23 +36,23 @@ private EntityHelper() {} * @throws ReceiptStatusException */ public static TokenId createNft(IntegrationTestEnv testEnv) - throws PrecheckStatusException, TimeoutException, ReceiptStatusException { + throws PrecheckStatusException, TimeoutException, ReceiptStatusException { return new TokenCreateTransaction() - .setTokenName("Test NFT") - .setTokenSymbol("TNFT") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setSupplyType(TokenSupplyType.FINITE) - .setMaxSupply(10) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("Test NFT") + .setTokenSymbol("TNFT") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setSupplyType(TokenSupplyType.FINITE) + .setMaxSupply(10) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; } /** @@ -84,24 +66,24 @@ public static TokenId createNft(IntegrationTestEnv testEnv) * @throws ReceiptStatusException If the receipt status is not success. */ public static TokenId createFungibleToken(IntegrationTestEnv testEnv, int decimals) - throws PrecheckStatusException, TimeoutException, ReceiptStatusException { + throws PrecheckStatusException, TimeoutException, ReceiptStatusException { return new TokenCreateTransaction() - .setTokenName("Test Fungible Token") - .setTokenSymbol("TFT") - .setTokenMemo("I was created for integration tests") - .setDecimals(decimals) - .setInitialSupply(fungibleInitialBalance) - .setMaxSupply(fungibleInitialBalance) - .setTreasuryAccountId(testEnv.operatorId) - .setSupplyType(TokenSupplyType.FINITE) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("Test Fungible Token") + .setTokenSymbol("TFT") + .setTokenMemo("I was created for integration tests") + .setDecimals(decimals) + .setInitialSupply(fungibleInitialBalance) + .setMaxSupply(fungibleInitialBalance) + .setTreasuryAccountId(testEnv.operatorId) + .setSupplyType(TokenSupplyType.FINITE) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; } /** @@ -116,14 +98,14 @@ public static TokenId createFungibleToken(IntegrationTestEnv testEnv, int decima * @throws ReceiptStatusException If the receipt status is not success. */ public static AccountId createAccount(IntegrationTestEnv testEnv, Key accountKey, int maxAutomaticTokenAssociations) - throws PrecheckStatusException, TimeoutException, ReceiptStatusException { + throws PrecheckStatusException, TimeoutException, ReceiptStatusException { return new AccountCreateTransaction() - .setKey(accountKey) - .setInitialBalance(new Hbar(10)) - .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(accountKey) + .setInitialBalance(new Hbar(10)) + .setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; } /** @@ -137,18 +119,18 @@ public static AccountId createAccount(IntegrationTestEnv testEnv, Key accountKey * @throws ReceiptStatusException if the receipt status is not success. */ public static ContractId createContract(IntegrationTestEnv testEnv, Key contractKey) - throws PrecheckStatusException, TimeoutException, ReceiptStatusException { - final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + throws PrecheckStatusException, TimeoutException, ReceiptStatusException { + final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; return new ContractCreateFlow() - .setAdminKey(contractKey) - .setGas(200_000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecode(SMART_CONTRACT_BYTECODE) - .setContractMemo("[e2e::ContractMemo]") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .contractId; + .setAdminKey(contractKey) + .setGas(200_000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecode(SMART_CONTRACT_BYTECODE) + .setContractMemo("[e2e::ContractMemo]") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .contractId; } } - diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java index 3a4f7112d7..c52e51d01d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -38,13 +20,13 @@ import java.util.List; import java.util.Objects; import org.bouncycastle.util.encoders.Hex; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; public class EthereumTransactionIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; /** * @notice E2E-HIP-844 @@ -59,28 +41,28 @@ void signerNonceChangedOnEthereumTransaction() throws Exception { var newAccountAliasId = privateKey.toAccountId(0, 0); new TransferTransaction() - .addHbarTransfer(testEnv.operatorId, new Hbar(1).negated()) - .addHbarTransfer(newAccountAliasId, new Hbar(1)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addHbarTransfer(testEnv.operatorId, new Hbar(1).negated()) + .addHbarTransfer(newAccountAliasId, new Hbar(1)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var fileCreateTransactionResponse = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(fileCreateTransactionResponse.getReceipt(testEnv.client).fileId); var contractCreateTransactionResponse = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) - .setBytecodeFileId(fileId) - .setContractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) + .setBytecodeFileId(fileId) + .setContractMemo("[e2e::ContractCreateTransaction]") + .execute(testEnv.client); - var contractId = Objects.requireNonNull( - contractCreateTransactionResponse.getReceipt(testEnv.client).contractId); + var contractId = + Objects.requireNonNull(contractCreateTransactionResponse.getReceipt(testEnv.client).contractId); int nonce = 0; byte[] chainId = Hex.decode("012a"); @@ -88,11 +70,11 @@ void signerNonceChangedOnEthereumTransaction() throws Exception { byte[] maxGas = Hex.decode("d1385c7bf0"); byte[] to = Hex.decode(contractId.toSolidityAddress()); byte[] callData = new ContractExecuteTransaction() - .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) - .getFunctionParameters() - .toByteArray(); + .setFunction("setMessage", new ContractFunctionParameters().addString("new message")) + .getFunctionParameters() + .toByteArray(); - var sequence = RLPEncoder.sequence(Integers.toBytes(2), new Object[]{ + var sequence = RLPEncoder.sequence(Integers.toBytes(2), new Object[] { chainId, Integers.toBytes(nonce), // nonce maxPriorityGas, @@ -115,39 +97,38 @@ void signerNonceChangedOnEthereumTransaction() throws Exception { final int recId = ((PrivateKeyECDSA) privateKey).getRecoveryId(r, s, sequence); byte[] ethereumData = RLPEncoder.sequence( - Integers.toBytes(0x02), - List.of( - chainId, - Integers.toBytes(nonce), // nonce - maxPriorityGas, - maxGas, - Integers.toBytes(150000), // gasLimit - to, - Integers.toBytesUnsigned(BigInteger.ZERO), // value - callData, - List.of(/*accessList*/), - Integers.toBytes(recId), // recId - r, - s)); - - EthereumTransaction ethereumTransaction = new EthereumTransaction() - .setEthereumData(ethereumData); + Integers.toBytes(0x02), + List.of( + chainId, + Integers.toBytes(nonce), // nonce + maxPriorityGas, + maxGas, + Integers.toBytes(150000), // gasLimit + to, + Integers.toBytesUnsigned(BigInteger.ZERO), // value + callData, + List.of(/*accessList*/ ), + Integers.toBytes(recId), // recId + r, + s)); + + EthereumTransaction ethereumTransaction = new EthereumTransaction().setEthereumData(ethereumData); var ethereumTransactionResponse = ethereumTransaction.execute(testEnv.client); var ethereumTransactionRecord = ethereumTransactionResponse.getRecord(testEnv.client); - assertThat(ethereumTransactionRecord.contractFunctionResult.signerNonce).isEqualTo(1); + assertThat(ethereumTransactionRecord.contractFunctionResult.signerNonce) + .isEqualTo(1); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java index 31cfe72a00..922054a3e8 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.protobuf.ByteString; import com.hiero.sdk.FeeSchedules; import com.hiero.sdk.FileContentsQuery; @@ -26,25 +10,21 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class FeeSchedulesTest { @Test @DisplayName("FeeSchedules (CurrentAndNextFeeSchedule) is fetched and parsed from file 0.0.111") void canFetchFeeSchedules() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - ByteString feeSchedulesBytes = new FileContentsQuery() - .setFileId(new FileId(0, 0, 111)) - .execute(testEnv.client); + ByteString feeSchedulesBytes = + new FileContentsQuery().setFileId(new FileId(0, 0, 111)).execute(testEnv.client); FeeSchedules feeSchedules = FeeSchedules.fromBytes(feeSchedulesBytes.toByteArray()); /* - * Test whether the file 0.0.111 actually contains stuff - */ + * Test whether the file 0.0.111 actually contains stuff + */ assertThat(feeSchedules.getCurrent()).isNotNull(); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java index c29caa880e..0d25f12e06 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java @@ -1,55 +1,34 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.FileAppendTransaction; import com.hiero.sdk.FileContentsQuery; import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; import com.hiero.sdk.FileInfoQuery; import com.hiero.sdk.KeyList; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import java.time.Duration; - import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; public class FileAppendIntegrationTest { @Test @DisplayName("Can append to file") void canAppendToFile() throws Exception { // There are potential bugs in FileAppendTransaction which require more than one node to trigger. - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -59,14 +38,12 @@ void canAppendToFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileAppendTransaction() - .setFileId(fileId) - .setContents("[e2e::FileAppendTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .setContents("[e2e::FileAppendTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(56); @@ -76,10 +53,9 @@ void canAppendToFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -87,24 +63,22 @@ void canAppendToFile() throws Exception { @DisplayName("Can append large contents to file") void canAppendLargeContentsToFile() throws Exception { // There are potential bugs in FileAppendTransaction which require more than one node to trigger. - try(var testEnv = new IntegrationTestEnv(2)){ + try (var testEnv = new IntegrationTestEnv(2)) { // Skip if using local node. // Note: this check should be removed once the local node is supporting multiple nodes. testEnv.assumeNotLocalNode(); var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); Thread.sleep(5000); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -114,20 +88,16 @@ void canAppendLargeContentsToFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileAppendTransaction() - .setFileId(fileId) - .setContents(Contents.BIG_CONTENTS) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .setContents(Contents.BIG_CONTENTS) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var contents = new FileContentsQuery() - .setFileId(fileId) - .execute(testEnv.client); + var contents = new FileContentsQuery().setFileId(fileId).execute(testEnv.client); assertThat(contents.toStringUtf8()).isEqualTo("[e2e::FileCreateTransaction]" + Contents.BIG_CONTENTS); - info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(13522); @@ -137,10 +107,9 @@ void canAppendLargeContentsToFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -148,24 +117,22 @@ void canAppendLargeContentsToFile() throws Exception { @DisplayName("Can append large contents to file despite TRANSACTION_EXPIRATION response codes") void canAppendLargeContentsToFileDespiteExpiration() throws Exception { // There are potential bugs in FileAppendTransaction which require more than one node to trigger. - try(var testEnv = new IntegrationTestEnv(2)){ + try (var testEnv = new IntegrationTestEnv(2)) { // Skip if using local node. // Note: this check should be removed once the local node is supporting multiple nodes. testEnv.assumeNotLocalNode(); var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); Thread.sleep(5000); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -175,21 +142,17 @@ void canAppendLargeContentsToFileDespiteExpiration() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); var appendTx = new FileAppendTransaction() - .setFileId(fileId) - .setContents(Contents.BIG_CONTENTS) - .setTransactionValidDuration(Duration.ofSeconds(25)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .setContents(Contents.BIG_CONTENTS) + .setTransactionValidDuration(Duration.ofSeconds(25)) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var contents = new FileContentsQuery() - .setFileId(fileId) - .execute(testEnv.client); + var contents = new FileContentsQuery().setFileId(fileId).execute(testEnv.client); assertThat(contents.toStringUtf8()).isEqualTo("[e2e::FileCreateTransaction]" + Contents.BIG_CONTENTS); - info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(13522); @@ -199,10 +162,9 @@ void canAppendLargeContentsToFileDespiteExpiration() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java index a28a771ac4..cba57659aa 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.FileContentsQuery; import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; @@ -26,161 +11,143 @@ import com.hiero.sdk.MaxQueryPaymentExceededException; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class FileContentsIntegrationTest { @Test @DisplayName("Can query file contents") void canQueryFileContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contents = new FileContentsQuery() - .setFileId(fileId) - .execute(testEnv.client); + var contents = new FileContentsQuery().setFileId(fileId).execute(testEnv.client); assertThat(contents.toStringUtf8()).isEqualTo("[e2e::FileCreateTransaction]"); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can query empty file contents") void canQueryEmptyFileContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .execute(testEnv.client); + var response = + new FileCreateTransaction().setKeys(testEnv.operatorKey).execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contents = new FileContentsQuery() - .setFileId(fileId) - .execute(testEnv.client); + var contents = new FileContentsQuery().setFileId(fileId).execute(testEnv.client); assertThat(contents.size()).isEqualTo(0); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot query file contents when file ID is not set") void cannotQueryFileContentsWhenFileIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new FileContentsQuery() - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_FILE_ID.toString()); + try (var testEnv = new IntegrationTestEnv(1)) { + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new FileContentsQuery().execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_FILE_ID.toString()); } } @Test @DisplayName("Can get cost, even with a big max") void getCostBigMaxQueryFileContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contentsQuery = new FileContentsQuery() - .setFileId(fileId) - .setMaxQueryPayment(new Hbar(1000)); + var contentsQuery = new FileContentsQuery().setFileId(fileId).setMaxQueryPayment(new Hbar(1000)); var contents = contentsQuery.execute(testEnv.client); assertThat(contents.toStringUtf8()).isEqualTo("[e2e::FileCreateTransaction]"); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Error, max is smaller than set payment.") void getCostSmallMaxQueryFileContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contentsQuery = new FileContentsQuery() - .setFileId(fileId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var contentsQuery = new FileContentsQuery().setFileId(fileId).setMaxQueryPayment(Hbar.fromTinybars(1)); assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { contentsQuery.execute(testEnv.client); }); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Insufficient tx fee error.") void getCostInsufficientTxFeeQueryFileContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var contentsQuery = new FileContentsQuery() - .setFileId(fileId) - .setMaxQueryPayment(new Hbar(100)); + var contentsQuery = new FileContentsQuery().setFileId(fileId).setMaxQueryPayment(new Hbar(100)); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - contentsQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + contentsQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java index ef53d14a1c..28ac9b9c3d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java @@ -1,51 +1,30 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; import com.hiero.sdk.FileInfoQuery; import com.hiero.sdk.KeyList; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; - public class FileCreateIntegrationTest { @Test @DisplayName("Can create file") void canCreateFile() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -55,27 +34,23 @@ void canCreateFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can create file with no contents") void canCreateFileWithNoContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .execute(testEnv.client); + var response = + new FileCreateTransaction().setKeys(testEnv.operatorKey).execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(0); @@ -85,32 +60,27 @@ void canCreateFileWithNoContents() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can create file with no keys") void canCreateFileWithNoKeys() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - var response = new FileCreateTransaction() - .execute(testEnv.client); + var response = new FileCreateTransaction().execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(0); assertThat(info.isDeleted).isFalse(); assertThat(info.keys).isNull(); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java index fe178aece9..a6583c862d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java @@ -1,54 +1,33 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; import com.hiero.sdk.FileInfoQuery; import com.hiero.sdk.KeyList; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class FileDeleteIntegrationTest { @Test @DisplayName("Can delete file") void canDeleteFile() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -58,40 +37,38 @@ void canDeleteFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot delete immutable file") void cannotDeleteImmutableFile() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); assertThat(info.isDeleted).isFalse(); assertThat(info.keys).isNull(); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.UNAUTHORIZED.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new FileDeleteTransaction() + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.UNAUTHORIZED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java index d9cd09a17d..0bd4b72e1b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; import com.hiero.sdk.FileInfoQuery; @@ -26,30 +11,24 @@ import com.hiero.sdk.KeyList; import com.hiero.sdk.MaxQueryPaymentExceededException; import com.hiero.sdk.PrecheckStatusException; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class FileInfoIntegrationTest { @Test @DisplayName("Can query file info") void canQueryFileInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -59,32 +38,27 @@ void canQueryFileInfo() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can query file info with no admin key or contents") void canQueryFileInfoWithNoAdminKeyOrContents() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { - var response = new FileCreateTransaction() - .execute(testEnv.client); + var response = new FileCreateTransaction().execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(0); assertThat(info.isDeleted).isFalse(); assertThat(info.keys).isNull(); - } } @@ -92,84 +66,77 @@ void canQueryFileInfoWithNoAdminKeyOrContents() throws Exception { @DisplayName("Can get cost, even with a big max") @SuppressWarnings("UnusedVariable") void getCostBigMaxQueryFileInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var infoQuery = new FileInfoQuery() - .setFileId(fileId) - .setMaxQueryPayment(new Hbar(1000)); + var infoQuery = new FileInfoQuery().setFileId(fileId).setMaxQueryPayment(new Hbar(1000)); var cost = infoQuery.getCost(testEnv.client); var info = infoQuery.setQueryPayment(cost).execute(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Error, max is smaller than set payment.") void getCostSmallMaxQueryFileInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var infoQuery = new FileInfoQuery() - .setFileId(fileId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var infoQuery = new FileInfoQuery().setFileId(fileId).setMaxQueryPayment(Hbar.fromTinybars(1)); assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { infoQuery.execute(testEnv.client); }); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Insufficient tx fee error.") void getCostInsufficientTxFeeQueryFileInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var infoQuery = new FileInfoQuery() - .setFileId(fileId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var infoQuery = new FileInfoQuery().setFileId(fileId).setMaxQueryPayment(Hbar.fromTinybars(1)); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java index 28383e34c1..0f495f86bf 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountId; import com.hiero.sdk.FileCreateTransaction; import com.hiero.sdk.FileDeleteTransaction; @@ -30,30 +15,24 @@ import com.hiero.sdk.PrivateKey; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class FileUpdateIntegrationTest { @Test @DisplayName("Can update file") void canUpdateFile() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -63,14 +42,12 @@ void canUpdateFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileUpdateTransaction() - .setFileId(fileId) - .setContents("[e2e::FileUpdateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .setContents("[e2e::FileUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -80,72 +57,73 @@ void canUpdateFile() throws Exception { assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot update immutable file") void cannotUpdateImmutableFile() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setContents("[e2e::FileCreateTransaction]") - .execute(testEnv.client); + .setContents("[e2e::FileCreateTransaction]") + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); assertThat(info.isDeleted).isFalse(); assertThat(info.keys).isNull(); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new FileUpdateTransaction() - .setFileId(fileId) - .setContents("[e2e::FileUpdateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.UNAUTHORIZED.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new FileUpdateTransaction() + .setFileId(fileId) + .setContents("[e2e::FileUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.UNAUTHORIZED.toString()); } } @Test @DisplayName("Cannot update file when file ID is not set") void cannotUpdateFileWhenFileIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new FileUpdateTransaction() - .setContents("[e2e::FileUpdateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_FILE_ID.toString()); - + try (var testEnv = new IntegrationTestEnv(1)) { + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new FileUpdateTransaction() + .setContents("[e2e::FileUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_FILE_ID.toString()); } } @Test @DisplayName("Can update fee schedule file") void canUpdateFeeScheduleFile() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ - testEnv.client.setOperator(new AccountId(0, 0, 2), PrivateKey.fromString( - "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137")); + try (var testEnv = new IntegrationTestEnv(1)) { + testEnv.client.setOperator( + new AccountId(0, 0, 2), + PrivateKey.fromString( + "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137")); var fileId = new FileId(0, 0, 111); var receipt = new FileUpdateTransaction() - .setFileId(fileId) - .setContents("[e2e::FileUpdateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .setContents("[e2e::FileUpdateTransaction]") + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.FEE_SCHEDULE_FILE_PART_UPLOADED); } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java index 17857f7358..3ff7d41931 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -28,7 +10,6 @@ import com.hiero.sdk.Hbar; import com.hiero.sdk.PrivateKey; import com.hiero.sdk.PublicKey; -import com.hiero.sdk.TokenId; import com.hiero.sdk.TransferTransaction; import java.util.ArrayList; import java.util.Collections; @@ -38,7 +19,6 @@ import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import javax.annotation.Nullable; import org.junit.jupiter.api.Assumptions; public class IntegrationTestEnv implements AutoCloseable { @@ -50,7 +30,8 @@ public class IntegrationTestEnv implements AutoCloseable { public PublicKey operatorKey; public AccountId operatorId; public boolean isLocalNode = false; - private static ExecutorService clientExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + private static ExecutorService clientExecutor = + Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); public IntegrationTestEnv() throws Exception { this(0); @@ -106,9 +87,8 @@ private static Client createTestEnvClient() throws Exception { var network = new HashMap(); network.put(LOCAL_CONSENSUS_NODE_ENDPOINT, LOCAL_CONSENSUS_NODE_ACCOUNT_ID); - return Client - .forNetwork(network, clientExecutor) - .setMirrorNetwork(List.of(LOCAL_MIRROR_NODE_GRPC_ENDPOINT)); + return Client.forNetwork(network, clientExecutor) + .setMirrorNetwork(List.of(LOCAL_MIRROR_NODE_GRPC_ENDPOINT)); } else if (!System.getProperty("CONFIG_FILE").equals("")) { try { return Client.fromConfigFile(System.getProperty("CONFIG_FILE")); @@ -123,11 +103,11 @@ public IntegrationTestEnv useThrowawayAccount(Hbar initialBalance) throws Except var key = PrivateKey.generateED25519(); operatorKey = key.getPublicKey(); operatorId = new AccountCreateTransaction() - .setInitialBalance(initialBalance) - .setKey(key) - .execute(client) - .getReceipt(client) - .accountId; + .setInitialBalance(initialBalance) + .setKey(key) + .execute(client) + .getReceipt(client) + .accountId; client = Client.forNetwork(originalClient.getNetwork()); client.setMirrorNetwork(originalClient.getMirrorNetwork()); @@ -156,17 +136,15 @@ public void assumeNotLocalNode() throws Exception { public void close() throws Exception { if (!operatorId.equals(originalClient.getOperatorAccountId())) { try { - var hbarsBalance = new AccountBalanceQuery() - .setAccountId(operatorId) - .execute(originalClient) - .hbars; + var hbarsBalance = + new AccountBalanceQuery().setAccountId(operatorId).execute(originalClient).hbars; new TransferTransaction() - .addHbarTransfer(operatorId, hbarsBalance.negated()) - .addHbarTransfer(Objects.requireNonNull(originalClient.getOperatorAccountId()), hbarsBalance) - .freezeWith(originalClient) - .signWithOperator(client) - .execute(originalClient) - .getReceipt(originalClient); + .addHbarTransfer(operatorId, hbarsBalance.negated()) + .addHbarTransfer(Objects.requireNonNull(originalClient.getOperatorAccountId()), hbarsBalance) + .freezeWith(originalClient) + .signWithOperator(client) + .execute(originalClient) + .getReceipt(originalClient); } catch (Exception e) { client.close(); @@ -189,18 +167,20 @@ public TestEnvNodeGetter(Client client) { public void nextNode(Map outMap) throws Exception { if (nodes.isEmpty()) { throw new IllegalStateException( - "IntegrationTestEnv needs another node, but there aren't enough nodes in client network"); + "IntegrationTestEnv needs another node, but there aren't enough nodes in client network"); } for (; index < nodes.size(); index++) { var node = nodes.get(index); try { new TransferTransaction() - .setNodeAccountIds(Collections.singletonList(node.getValue())) - .setMaxAttempts(1) - .addHbarTransfer(client.getOperatorAccountId(), Hbar.fromTinybars(1).negated()) - .addHbarTransfer(AccountId.fromString("0.0.3"), Hbar.fromTinybars(1)) - .execute(client) - .getReceipt(client); + .setNodeAccountIds(Collections.singletonList(node.getValue())) + .setMaxAttempts(1) + .addHbarTransfer( + client.getOperatorAccountId(), + Hbar.fromTinybars(1).negated()) + .addHbarTransfer(AccountId.fromString("0.0.3"), Hbar.fromTinybars(1)) + .execute(client) + .getReceipt(client); nodes.remove(index); outMap.put(node.getKey(), node.getValue()); return; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java index ee4878f675..adf475f4b4 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java @@ -1,66 +1,49 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.LiveHashAddTransaction; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.PrivateKey; import com.hiero.sdk.Status; +import java.time.Duration; +import java.util.Objects; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.time.Duration; - -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; class LiveHashAddIntegrationTest { - private static final byte[] HASH = Hex.decode("100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"); + private static final byte[] HASH = Hex.decode( + "100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"); @Test @DisplayName("Cannot create live hash because it's not supported") void cannotCreateLiveHashBecauseItsNotSupported() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new LiveHashAddTransaction() - .setAccountId(accountId) - .setDuration(Duration.ofDays(30)) - .setHash(HASH) - .setKeys(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new LiveHashAddTransaction() + .setAccountId(accountId) + .setDuration(Duration.ofDays(30)) + .setHash(HASH) + .setKeys(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java index daaea4443f..732edee28b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java @@ -1,63 +1,46 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.LiveHashDeleteTransaction; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.PrivateKey; import com.hiero.sdk.Status; +import java.util.Objects; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class LiveHashDeleteIntegrationTest { - private static final byte[] HASH = Hex.decode("100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"); + private static final byte[] HASH = Hex.decode( + "100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"); @Test @DisplayName("Cannot delete live hash because it's not supported") void cannotDeleteLiveHashBecauseItsNotSupported() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new LiveHashDeleteTransaction() - .setAccountId(accountId) - .setHash(HASH) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new LiveHashDeleteTransaction() + .setAccountId(accountId) + .setHash(HASH) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java index 6b0692598a..0c002594c2 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.fail; @@ -29,7 +10,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -54,14 +34,13 @@ void loadTest() throws Exception { for (int i = 0; i < nThreads; i++) { int finalI = i; threadPoolExecutor.submit(() -> { - try (var client = Client.forNetwork(testEnv.client.getNetwork(), clientExecutor); - ) { + try (var client = Client.forNetwork(testEnv.client.getNetwork(), clientExecutor); ) { client.setOperator(operatorId, operatorPrivateKey); client.setMaxAttempts(10); new AccountCreateTransaction() - .setKey(PrivateKey.generateED25519()) - .execute(client) - .getReceipt(client); + .setKey(PrivateKey.generateED25519()) + .execute(client) + .getReceipt(client); System.out.println(finalI); } catch (Exception e) { fail("AccountCreateTransaction failed, " + e); @@ -86,7 +65,6 @@ void loadTest() throws Exception { long executionTime = endTime - startTime; System.out.println("All tasks have finished execution in " + executionTime + "ms"); clientExecutor.shutdownNow(); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java index af59ed4f10..1650bb1176 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static com.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; @@ -36,7 +17,6 @@ import com.hiero.sdk.Hbar; import com.hiero.sdk.MirrorNodeContractCallQuery; import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.MirrorNodeContractQuery; import com.hiero.sdk.PrivateKey; import java.util.Objects; import java.util.concurrent.ExecutionException; @@ -44,7 +24,8 @@ import org.junit.jupiter.api.Test; class MirrorNodeContractQueryIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "6080604052348015600e575f80fd5b50335f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506104a38061005b5f395ff3fe608060405260043610610033575f3560e01c8063607a4427146100375780637065cb4814610053578063893d20e81461007b575b5f80fd5b610051600480360381019061004c919061033c565b6100a5565b005b34801561005e575f80fd5b50610079600480360381019061007491906103a2565b610215565b005b348015610086575f80fd5b5061008f6102b7565b60405161009c91906103dc565b60405180910390f35b3373ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146100fb575f80fd5b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f8173ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f19350505050905080610211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102089061044f565b60405180910390fd5b5050565b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61030b826102e2565b9050919050565b61031b81610301565b8114610325575f80fd5b50565b5f8135905061033681610312565b92915050565b5f60208284031215610351576103506102de565b5b5f61035e84828501610328565b91505092915050565b5f610371826102e2565b9050919050565b61038181610367565b811461038b575f80fd5b50565b5f8135905061039c81610378565b92915050565b5f602082840312156103b7576103b66102de565b5b5f6103c48482850161038e565b91505092915050565b6103d681610367565b82525050565b5f6020820190506103ef5f8301846103cd565b92915050565b5f82825260208201905092915050565b7f5472616e73666572206661696c656400000000000000000000000000000000005f82015250565b5f610439600f836103f5565b915061044482610405565b602082019050919050565b5f6020820190508181035f8301526104668161042d565b905091905056fea26469706673582212206c46ddb2acdbcc4290e15be83eb90cd0b2ce5bd82b9bfe58a0709c5aec96305564736f6c634300081a0033"; + private static final String SMART_CONTRACT_BYTECODE = + "6080604052348015600e575f80fd5b50335f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506104a38061005b5f395ff3fe608060405260043610610033575f3560e01c8063607a4427146100375780637065cb4814610053578063893d20e81461007b575b5f80fd5b610051600480360381019061004c919061033c565b6100a5565b005b34801561005e575f80fd5b50610079600480360381019061007491906103a2565b610215565b005b348015610086575f80fd5b5061008f6102b7565b60405161009c91906103dc565b60405180910390f35b3373ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146100fb575f80fd5b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f8173ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f19350505050905080610211576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102089061044f565b60405180910390fd5b5050565b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61030b826102e2565b9050919050565b61031b81610301565b8114610325575f80fd5b50565b5f8135905061033681610312565b92915050565b5f60208284031215610351576103506102de565b5b5f61035e84828501610328565b91505092915050565b5f610371826102e2565b9050919050565b61038181610367565b811461038b575f80fd5b50565b5f8135905061039c81610378565b92915050565b5f602082840312156103b7576103b66102de565b5b5f6103c48482850161038e565b91505092915050565b6103d681610367565b82525050565b5f6020820190506103ef5f8301846103cd565b92915050565b5f82825260208201905092915050565b7f5472616e73666572206661696c656400000000000000000000000000000000005f82015250565b5f610439600f836103f5565b915061044482610405565b602082019050919050565b5f6020820190508181035f8301526104668161042d565b905091905056fea26469706673582212206c46ddb2acdbcc4290e15be83eb90cd0b2ce5bd82b9bfe58a0709c5aec96305564736f6c634300081a0033"; private static final String ADDRESS = "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4"; @Test @@ -52,17 +33,17 @@ class MirrorNodeContractQueryIntegrationTest { void canSimulateTransaction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setBytecodeFileId(fileId) - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setBytecodeFileId(fileId) + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); @@ -70,51 +51,51 @@ void canSimulateTransaction() throws Exception { Thread.sleep(2000); var gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("getOwner") - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("getOwner") + .execute(testEnv.client); var result = new ContractCallQuery() - .setContractId(contractId) - .setGas(gas) - .setFunction("getOwner") - .setQueryPayment(new Hbar(1)) - .execute(testEnv.client); + .setContractId(contractId) + .setGas(gas) + .setFunction("getOwner") + .setQueryPayment(new Hbar(1)) + .execute(testEnv.client); var simulationResult = new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setFunction("getOwner") - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("getOwner") + .execute(testEnv.client); assertThat(result.getAddress(0)).isEqualTo(simulationResult.substring(26)); gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("addOwner", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("addOwner", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client); new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(gas) - .setFunction("addOwner", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setGas(gas) + .setFunction("addOwner", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setFunction("addOwner", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client); + .setContractId(contractId) + .setFunction("addOwner", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new FileDeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setFileId(fileId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -124,19 +105,23 @@ void failsWhenContractIsNotDeployed() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var contractId = new ContractId(1231456); - assertThatExceptionOfType(ExecutionException.class).isThrownBy(() -> { - new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("getOwner") - .execute(testEnv.client); - }).withMessageContaining("Received non-200 response from Mirror Node"); - - assertThatExceptionOfType(ExecutionException.class).isThrownBy(() -> { - new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setFunction("getOwner") - .execute(testEnv.client); - }).withMessageContaining("Received non-200 response from Mirror Node"); + assertThatExceptionOfType(ExecutionException.class) + .isThrownBy(() -> { + new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction("getOwner") + .execute(testEnv.client); + }) + .withMessageContaining("Received non-200 response from Mirror Node"); + + assertThatExceptionOfType(ExecutionException.class) + .isThrownBy(() -> { + new MirrorNodeContractCallQuery() + .setContractId(contractId) + .setFunction("getOwner") + .execute(testEnv.client); + }) + .withMessageContaining("Received non-200 response from Mirror Node"); } } @@ -145,38 +130,44 @@ void failsWhenContractIsNotDeployed() throws Exception { void failsWhenGasLimitIsLow() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setBytecodeFileId(fileId) - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setBytecodeFileId(fileId) + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); // Wait for mirror node to import data Thread.sleep(2000); - assertThatExceptionOfType(ExecutionException.class).isThrownBy(() -> { - new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setGasLimit(100) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client); - }).withMessageContaining("Received non-200 response from Mirror Node"); - - assertThatExceptionOfType(ExecutionException.class).isThrownBy(() -> { - new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setGasLimit(100) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client); - }).withMessageContaining("Received non-200 response from Mirror Node"); + assertThatExceptionOfType(ExecutionException.class) + .isThrownBy(() -> { + new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setGasLimit(100) + .setFunction( + "addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client); + }) + .withMessageContaining("Received non-200 response from Mirror Node"); + + assertThatExceptionOfType(ExecutionException.class) + .isThrownBy(() -> { + new MirrorNodeContractCallQuery() + .setContractId(contractId) + .setGasLimit(100) + .setFunction( + "addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client); + }) + .withMessageContaining("Received non-200 response from Mirror Node"); } } @@ -185,37 +176,42 @@ void failsWhenGasLimitIsLow() throws Exception { void failsWhenSenderIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setBytecodeFileId(fileId) - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setBytecodeFileId(fileId) + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); // Wait for mirror node to import data Thread.sleep(2000); - assertThatExceptionOfType(ExecutionException.class).isThrownBy(() -> { - new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client); - }).withMessageContaining("Received non-200 response from Mirror Node"); - - assertThatExceptionOfType(ExecutionException.class).isThrownBy(() -> { - new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) - .execute(testEnv.client); - }).withMessageContaining("Received non-200 response from Mirror Node"); - + assertThatExceptionOfType(ExecutionException.class) + .isThrownBy(() -> { + new MirrorNodeContractEstimateGasQuery() + .setContractId(contractId) + .setFunction( + "addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client); + }) + .withMessageContaining("Received non-200 response from Mirror Node"); + + assertThatExceptionOfType(ExecutionException.class) + .isThrownBy(() -> { + new MirrorNodeContractCallQuery() + .setContractId(contractId) + .setFunction( + "addOwnerAndTransfer", new ContractFunctionParameters().addAddress(ADDRESS)) + .execute(testEnv.client); + }) + .withMessageContaining("Received non-200 response from Mirror Node"); } } @@ -224,61 +220,62 @@ void failsWhenSenderIsNotSet() throws Exception { void canSimulateWithSenderSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new FileCreateTransaction() - .setKeys(testEnv.operatorKey) - .setContents(SMART_CONTRACT_BYTECODE) - .execute(testEnv.client); + .setKeys(testEnv.operatorKey) + .setContents(SMART_CONTRACT_BYTECODE) + .execute(testEnv.client); var fileId = Objects.requireNonNull(response.getReceipt(testEnv.client).fileId); response = new ContractCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setGas(200000) - .setBytecodeFileId(fileId) - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setGas(200000) + .setBytecodeFileId(fileId) + .execute(testEnv.client); var contractId = Objects.requireNonNull(response.getReceipt(testEnv.client).contractId); var receiverAccountId = new AccountCreateTransaction() - .setKey(PrivateKey.generateED25519()) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(PrivateKey.generateED25519()) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Wait for mirror node to import data Thread.sleep(2000); - var receiverEvmAddress = getEvmAddressFromMirrorNodeAsync(testEnv.client, receiverAccountId.num).get() - .toString(); + var receiverEvmAddress = getEvmAddressFromMirrorNodeAsync(testEnv.client, receiverAccountId.num) + .get() + .toString(); var owner = new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setFunction("getOwner") - .execute(testEnv.client) - .substring(26); + .setContractId(contractId) + .setFunction("getOwner") + .execute(testEnv.client) + .substring(26); var gas = new MirrorNodeContractEstimateGasQuery() - .setContractId(contractId) - .setGasLimit(1_000_000) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(receiverEvmAddress)) - .setSenderEvmAddress(owner) - .setValue(123) - .execute(testEnv.client); + .setContractId(contractId) + .setGasLimit(1_000_000) + .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(receiverEvmAddress)) + .setSenderEvmAddress(owner) + .setValue(123) + .execute(testEnv.client); new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(gas) - .setPayableAmount(new Hbar(1)) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(receiverEvmAddress)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setContractId(contractId) + .setGas(gas) + .setPayableAmount(new Hbar(1)) + .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(receiverEvmAddress)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new MirrorNodeContractCallQuery() - .setContractId(contractId) - .setGasLimit(1_000_000) - .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(receiverEvmAddress)) - .setSenderEvmAddress(owner) - .setValue(123) - .execute(testEnv.client); + .setContractId(contractId) + .setGasLimit(1_000_000) + .setFunction("addOwnerAndTransfer", new ContractFunctionParameters().addAddress(receiverEvmAddress)) + .setSenderEvmAddress(owner) + .setValue(123) + .execute(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java index 67c85e393c..f07028d1b5 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import com.hiero.sdk.NetworkVersionInfoQuery; @@ -29,9 +11,7 @@ public class NetworkVersionInfoIntegrationTest { void cannotQueryNetworkVersionInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - new NetworkVersionInfoQuery() - .execute(testEnv.client); - + new NetworkVersionInfoQuery().execute(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java index 638ca67627..ee96c61616 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -47,252 +29,248 @@ public class NftAllowancesIntegrationTest { @Test @DisplayName("Cannot transfer on behalf of `spender` account without allowance approval") void cannotTransferWithoutAllowanceApproval() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var spenderKey = PrivateKey.generateED25519(); var spenderAccountId = new AccountCreateTransaction() - .setKey(spenderKey) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(spenderKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var receiverKey = PrivateKey.generateED25519(); var receiverAccountId = new AccountCreateTransaction() - .setKey(receiverKey) - .setMaxAutomaticTokenAssociations(10) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(receiverKey) + .setMaxAutomaticTokenAssociations(10) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; TokenId nftTokenId = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; new TokenAssociateTransaction() - .setAccountId(spenderAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client); + .setAccountId(spenderAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client); var serials = new TokenMintTransaction() - .setTokenId(nftTokenId) - .addMetadata("asd".getBytes(StandardCharsets.UTF_8)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .serials; + .setTokenId(nftTokenId) + .addMetadata("asd".getBytes(StandardCharsets.UTF_8)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .serials; var nft1 = new NftId(nftTokenId, serials.get(0)); var onBehalfOfTransactionId = TransactionId.generate(spenderAccountId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> new TransferTransaction() - .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.SPENDER_DOES_NOT_HAVE_ALLOWANCE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> new TransferTransaction() + .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.SPENDER_DOES_NOT_HAVE_ALLOWANCE.toString()); } } @Test @DisplayName("Cannot transfer on behalf of `spender` account after removing the allowance approval") void cannotTransferAfterAllowanceRemove() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var spenderKey = PrivateKey.generateED25519(); var spenderAccountId = new AccountCreateTransaction() - .setKey(spenderKey) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(spenderKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var receiverKey = PrivateKey.generateED25519(); var receiverAccountId = new AccountCreateTransaction() - .setKey(receiverKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(receiverKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; TokenId nftTokenId = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; new TokenAssociateTransaction() - .setAccountId(spenderAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client); + .setAccountId(spenderAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client); new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverKey) - .execute(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverKey) + .execute(testEnv.client); var serials = new TokenMintTransaction() - .setTokenId(nftTokenId) - .addMetadata("asd1".getBytes(StandardCharsets.UTF_8)) - .addMetadata("asd2".getBytes(StandardCharsets.UTF_8)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .serials; + .setTokenId(nftTokenId) + .addMetadata("asd1".getBytes(StandardCharsets.UTF_8)) + .addMetadata("asd2".getBytes(StandardCharsets.UTF_8)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .serials; var nft1 = new NftId(nftTokenId, serials.get(0)); var nft2 = new NftId(nftTokenId, serials.get(1)); new AccountAllowanceApproveTransaction() - .approveTokenNftAllowance(nft1, testEnv.operatorId, spenderAccountId) - .approveTokenNftAllowance(nft2, testEnv.operatorId, spenderAccountId) - .execute(testEnv.client); + .approveTokenNftAllowance(nft1, testEnv.operatorId, spenderAccountId) + .approveTokenNftAllowance(nft2, testEnv.operatorId, spenderAccountId) + .execute(testEnv.client); new AccountAllowanceDeleteTransaction() - .deleteAllTokenNftAllowances(nft2, testEnv.operatorId) - .execute(testEnv.client); + .deleteAllTokenNftAllowances(nft2, testEnv.operatorId) + .execute(testEnv.client); var onBehalfOfTransactionId = TransactionId.generate(spenderAccountId); new TransferTransaction() - .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var info = new TokenNftInfoQuery() - .setNftId(nft1) - .execute(testEnv.client); + .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var info = new TokenNftInfoQuery().setNftId(nft1).execute(testEnv.client); assertThat(info.get(0).accountId).isEqualTo(receiverAccountId); var onBehalfOfTransactionId2 = TransactionId.generate(spenderAccountId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> new TransferTransaction() - .addApprovedNftTransfer(nft2, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId2) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.SPENDER_DOES_NOT_HAVE_ALLOWANCE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> new TransferTransaction() + .addApprovedNftTransfer(nft2, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId2) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.SPENDER_DOES_NOT_HAVE_ALLOWANCE.toString()); } } @Test @DisplayName("Cannot remove single serial number allowance when the allowance is given for all serials at once") void cannotRemoveSingleSerialWhenAllowanceIsGivenForAll() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var spenderKey = PrivateKey.generateED25519(); var spenderAccountId = new AccountCreateTransaction() - .setKey(spenderKey) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(spenderKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var receiverKey = PrivateKey.generateED25519(); var receiverAccountId = new AccountCreateTransaction() - .setKey(receiverKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(receiverKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; TokenId nftTokenId = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; new TokenAssociateTransaction() - .setAccountId(spenderAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client); + .setAccountId(spenderAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client); new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverKey) - .execute(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverKey) + .execute(testEnv.client); var serials = new TokenMintTransaction() - .setTokenId(nftTokenId) - .addMetadata("asd1".getBytes(StandardCharsets.UTF_8)) - .addMetadata("asd2".getBytes(StandardCharsets.UTF_8)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .serials; + .setTokenId(nftTokenId) + .addMetadata("asd1".getBytes(StandardCharsets.UTF_8)) + .addMetadata("asd2".getBytes(StandardCharsets.UTF_8)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .serials; var nft1 = new NftId(nftTokenId, serials.get(0)); var nft2 = new NftId(nftTokenId, serials.get(1)); new AccountAllowanceApproveTransaction() - .approveTokenNftAllowanceAllSerials(nftTokenId, testEnv.operatorId, spenderAccountId) - .execute(testEnv.client); + .approveTokenNftAllowanceAllSerials(nftTokenId, testEnv.operatorId, spenderAccountId) + .execute(testEnv.client); var onBehalfOfTransactionId = TransactionId.generate(spenderAccountId); new TransferTransaction() - .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // hopefully in the future this should end up with a precheck error provided from services new AccountAllowanceDeleteTransaction() - .deleteAllTokenNftAllowances(nft2, testEnv.operatorId) - .execute(testEnv.client); + .deleteAllTokenNftAllowances(nft2, testEnv.operatorId) + .execute(testEnv.client); var onBehalfOfTransactionId2 = TransactionId.generate(spenderAccountId); new TransferTransaction() - .addApprovedNftTransfer(nft2, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId2) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addApprovedNftTransfer(nft2, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId2) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var infoNft1 = new TokenNftInfoQuery() - .setNftId(nft1) - .execute(testEnv.client); + var infoNft1 = new TokenNftInfoQuery().setNftId(nft1).execute(testEnv.client); - var infoNft2 = new TokenNftInfoQuery() - .setNftId(nft2) - .execute(testEnv.client); + var infoNft2 = new TokenNftInfoQuery().setNftId(nft2).execute(testEnv.client); assertThat(infoNft1.get(0).accountId).isEqualTo(receiverAccountId); assertThat(infoNft2.get(0).accountId).isEqualTo(receiverAccountId); @@ -300,113 +278,111 @@ void cannotRemoveSingleSerialWhenAllowanceIsGivenForAll() throws Exception { } @Test - @DisplayName("Account, which given the allowance for all serials at once, should be able to give allowances for single serial numbers to other accounts") + @DisplayName( + "Account, which given the allowance for all serials at once, should be able to give allowances for single serial numbers to other accounts") void accountGivenAllowanceForAllShouldBeAbleToGiveAllowanceForSingle() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var delegatingSpenderKey = PrivateKey.generateED25519(); var delegatingSpenderAccountId = new AccountCreateTransaction() - .setKey(delegatingSpenderKey) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(delegatingSpenderKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var spenderKey = PrivateKey.generateED25519(); var spenderAccountId = new AccountCreateTransaction() - .setKey(spenderKey) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(spenderKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var receiverKey = PrivateKey.generateED25519(); var receiverAccountId = new AccountCreateTransaction() - .setKey(receiverKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(receiverKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; TokenId nftTokenId = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; new TokenAssociateTransaction() - .setAccountId(delegatingSpenderAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client); + .setAccountId(delegatingSpenderAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client); new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverKey) - .execute(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverKey) + .execute(testEnv.client); var serials = new TokenMintTransaction() - .setTokenId(nftTokenId) - .addMetadata("asd1".getBytes(StandardCharsets.UTF_8)) - .addMetadata("asd2".getBytes(StandardCharsets.UTF_8)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .serials; + .setTokenId(nftTokenId) + .addMetadata("asd1".getBytes(StandardCharsets.UTF_8)) + .addMetadata("asd2".getBytes(StandardCharsets.UTF_8)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .serials; var nft1 = new NftId(nftTokenId, serials.get(0)); var nft2 = new NftId(nftTokenId, serials.get(1)); new AccountAllowanceApproveTransaction() - .approveTokenNftAllowanceAllSerials(nftTokenId, testEnv.operatorId, delegatingSpenderAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveTokenNftAllowanceAllSerials(nftTokenId, testEnv.operatorId, delegatingSpenderAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new AccountAllowanceApproveTransaction() - .approveTokenNftAllowance(nft1, testEnv.operatorId, spenderAccountId, delegatingSpenderAccountId) - .freezeWith(testEnv.client) - .sign(delegatingSpenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveTokenNftAllowance(nft1, testEnv.operatorId, spenderAccountId, delegatingSpenderAccountId) + .freezeWith(testEnv.client) + .sign(delegatingSpenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); var onBehalfOfTransactionId = TransactionId.generate(spenderAccountId); new TransferTransaction() - .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addApprovedNftTransfer(nft1, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); var onBehalfOfTransactionId2 = TransactionId.generate(spenderAccountId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> new TransferTransaction() - .addApprovedNftTransfer(nft2, testEnv.operatorId, receiverAccountId) - .setTransactionId(onBehalfOfTransactionId2) - .freezeWith(testEnv.client) - .sign(spenderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client)).withMessageContaining(Status.SPENDER_DOES_NOT_HAVE_ALLOWANCE.toString()); + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> new TransferTransaction() + .addApprovedNftTransfer(nft2, testEnv.operatorId, receiverAccountId) + .setTransactionId(onBehalfOfTransactionId2) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.SPENDER_DOES_NOT_HAVE_ALLOWANCE.toString()); - var infoNft1 = new TokenNftInfoQuery() - .setNftId(nft1) - .execute(testEnv.client); + var infoNft1 = new TokenNftInfoQuery().setNftId(nft1).execute(testEnv.client); - var infoNft2 = new TokenNftInfoQuery() - .setNftId(nft2) - .execute(testEnv.client); + var infoNft2 = new TokenNftInfoQuery().setNftId(nft2).execute(testEnv.client); assertThat(infoNft1.get(0).accountId).isEqualTo(receiverAccountId); assertThat(infoNft2.get(0).accountId).isEqualTo(testEnv.operatorId); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java index aed75ab689..408588bba2 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import java.util.ArrayList; @@ -26,8 +8,7 @@ import java.util.stream.IntStream; public class NftMetadataGenerator { - private NftMetadataGenerator() { - } + private NftMetadataGenerator() {} public static List generate(byte metadataCount) { List metadatas = new ArrayList<>(); @@ -39,9 +20,7 @@ public static List generate(byte metadataCount) { } public static List generate(byte[] metadata, int count) { - return IntStream.range(0, count) - .mapToObj(i -> metadata.clone()) - .collect(Collectors.toList()); + return IntStream.range(0, count).mapToObj(i -> metadata.clone()).collect(Collectors.toList()); } public static List generateOneLarge() { diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java index ade4449aed..b35fd2b934 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static com.hiero.sdk.test.integration.IntegrationTestEnv.LOCAL_CONSENSUS_NODE_ACCOUNT_ID; @@ -35,7 +17,8 @@ import org.junit.jupiter.api.Test; class NodeCreateTransactionIntegrationTest { - String validGossipCertDER = "3082052830820310a003020102020101300d06092a864886f70d01010c05003010310e300c060355040313056e6f6465333024170d3234313030383134333233395a181332313234313030383134333233392e3337395a3010310e300c060355040313056e6f64653330820222300d06092a864886f70d01010105000382020f003082020a0282020100af111cff0c4ad8125d2f4b8691ce87332fecc867f7a94ddc0f3f96514cc4224d44af516394f7384c1ef0a515d29aa6116b65bc7e4d7e2d848cf79fbfffedae3a6583b3957a438bdd780c4981b800676ea509bc8c619ae04093b5fc642c4484152f0e8bcaabf19eae025b630028d183a2f47caf6d9f1075efb30a4248679d871beef1b7e9115382270cbdb68682fae4b1fd592cadb414d918c0a8c23795c7c5a91e22b3e90c410825a2bc1a840efc5bf9976a7f474c7ed7dc047e4ddd2db631b68bb4475f173baa3edc234c4bed79c83e2f826f79e07d0aade2d984da447a8514135bfa4145274a7f62959a23c4f0fae5adc6855974e7c04164951d052beb5d45cb1f3cdfd005da894dea9151cb62ba43f4731c6bb0c83e10fd842763ba6844ef499f71bc67fa13e4917fb39f2ad18112170d31cdcb3c61c9e3253accf703dbd8427fdcb87ece78b787b6cfdc091e8fedea8ad95dc64074e1fc6d0e42ea2337e18a5e54e4aaab3791a98dfcef282e2ae1caec9cf986fabe8f36e6a21c8711647177e492d264415e765a86c58599cd97b103cb4f6a01d2edd06e3b60470cf64daca7aecf831197b466cae04baeeac19840a05394bef628aed04b611cfa13677724b08ddfd662b02fd0ef0af17eb7f4fb8c1c17fbe9324f6dc7bcc02449622636cc45ec04909b3120ab4df4726b21bf79e955fe8f832699d2196dcd7a58bfeafb170203010001a38186308183300f0603551d130101ff04053003020100300e0603551d0f0101ff0404030204b030200603551d250101ff0416301406082b0601050507030106082b06010505070302301d0603551d0e04160414643118e05209035edd83d44a0c368de2fb2fe4c0301f0603551d23041830168014643118e05209035edd83d44a0c368de2fb2fe4c0300d06092a864886f70d01010c05000382020100ad41c32bb52650eb4b76fce439c9404e84e4538a94916b3dc7983e8b5c58890556e7384601ca7440dde68233bb07b97bf879b64487b447df510897d2a0a4e789c409a9b237a6ad240ad5464f2ce80c58ddc4d07a29a74eb25e1223db6c00e334d7a27d32bfa6183a82f5e35bccf497c2445a526eabb0c068aba9b94cc092ea4756b0dcfb574f6179f0089e52b174ccdbd04123eeb6d70daeabd8513fcba6be0bc2b45ca9a69802dae11cc4d9ff6053b3a87fd8b0c6bf72fffc3b81167f73cca2b3fd656c5d353c8defca8a76e2ad535f984870a590af4e28fed5c5a125bf360747c5e7742e7813d1bd39b5498c8eb6ba72f267eda034314fdbc596f6b967a0ef8be5231d364e634444c84e64bd7919425171016fcd9bb05f01c58a303dee28241f6e860fc3aac3d92aad7dac2801ce79a3b41a0e1f1509fc0d86e96d94edb18616c000152490f64561713102128990fedd3a5fa642f2ff22dc11bc4dc5b209986a0c3e4eb2bdfdd40e9fdf246f702441cac058dd8d0d51eb0796e2bea2ce1b37b2a2f468505e1f8980a9f66d719df034a6fbbd2f9585991d259678fb9a4aebdc465d22c240351ed44abffbdd11b79a706fdf7c40158d3da87f68d7bd557191a8016b5b899c07bf1b87590feb4fa4203feea9a2a7a73ec224813a12b7a21e5dc93fcde4f0a7620f570d31fe27e9b8d65b74db7dc18a5e51adc42d7805d4661938"; + String validGossipCertDER = + "3082052830820310a003020102020101300d06092a864886f70d01010c05003010310e300c060355040313056e6f6465333024170d3234313030383134333233395a181332313234313030383134333233392e3337395a3010310e300c060355040313056e6f64653330820222300d06092a864886f70d01010105000382020f003082020a0282020100af111cff0c4ad8125d2f4b8691ce87332fecc867f7a94ddc0f3f96514cc4224d44af516394f7384c1ef0a515d29aa6116b65bc7e4d7e2d848cf79fbfffedae3a6583b3957a438bdd780c4981b800676ea509bc8c619ae04093b5fc642c4484152f0e8bcaabf19eae025b630028d183a2f47caf6d9f1075efb30a4248679d871beef1b7e9115382270cbdb68682fae4b1fd592cadb414d918c0a8c23795c7c5a91e22b3e90c410825a2bc1a840efc5bf9976a7f474c7ed7dc047e4ddd2db631b68bb4475f173baa3edc234c4bed79c83e2f826f79e07d0aade2d984da447a8514135bfa4145274a7f62959a23c4f0fae5adc6855974e7c04164951d052beb5d45cb1f3cdfd005da894dea9151cb62ba43f4731c6bb0c83e10fd842763ba6844ef499f71bc67fa13e4917fb39f2ad18112170d31cdcb3c61c9e3253accf703dbd8427fdcb87ece78b787b6cfdc091e8fedea8ad95dc64074e1fc6d0e42ea2337e18a5e54e4aaab3791a98dfcef282e2ae1caec9cf986fabe8f36e6a21c8711647177e492d264415e765a86c58599cd97b103cb4f6a01d2edd06e3b60470cf64daca7aecf831197b466cae04baeeac19840a05394bef628aed04b611cfa13677724b08ddfd662b02fd0ef0af17eb7f4fb8c1c17fbe9324f6dc7bcc02449622636cc45ec04909b3120ab4df4726b21bf79e955fe8f832699d2196dcd7a58bfeafb170203010001a38186308183300f0603551d130101ff04053003020100300e0603551d0f0101ff0404030204b030200603551d250101ff0416301406082b0601050507030106082b06010505070302301d0603551d0e04160414643118e05209035edd83d44a0c368de2fb2fe4c0301f0603551d23041830168014643118e05209035edd83d44a0c368de2fb2fe4c0300d06092a864886f70d01010c05000382020100ad41c32bb52650eb4b76fce439c9404e84e4538a94916b3dc7983e8b5c58890556e7384601ca7440dde68233bb07b97bf879b64487b447df510897d2a0a4e789c409a9b237a6ad240ad5464f2ce80c58ddc4d07a29a74eb25e1223db6c00e334d7a27d32bfa6183a82f5e35bccf497c2445a526eabb0c068aba9b94cc092ea4756b0dcfb574f6179f0089e52b174ccdbd04123eeb6d70daeabd8513fcba6be0bc2b45ca9a69802dae11cc4d9ff6053b3a87fd8b0c6bf72fffc3b81167f73cca2b3fd656c5d353c8defca8a76e2ad535f984870a590af4e28fed5c5a125bf360747c5e7742e7813d1bd39b5498c8eb6ba72f267eda034314fdbc596f6b967a0ef8be5231d364e634444c84e64bd7919425171016fcd9bb05f01c58a303dee28241f6e860fc3aac3d92aad7dac2801ce79a3b41a0e1f1509fc0d86e96d94edb18616c000152490f64561713102128990fedd3a5fa642f2ff22dc11bc4dc5b209986a0c3e4eb2bdfdd40e9fdf246f702441cac058dd8d0d51eb0796e2bea2ce1b37b2a2f468505e1f8980a9f66d719df034a6fbbd2f9585991d259678fb9a4aebdc465d22c240351ed44abffbdd11b79a706fdf7c40158d3da87f68d7bd557191a8016b5b899c07bf1b87590feb4fa4203feea9a2a7a73ec224813a12b7a21e5dc93fcde4f0a7620f570d31fe27e9b8d65b74db7dc18a5e51adc42d7805d4661938"; @Test @Disabled("The test has to be disabled so it doesn't fail calls to local-node") @@ -45,13 +28,11 @@ void canCreateNewNetworkNode() throws Exception { var network = new HashMap(); network.put("localhost:50211", LOCAL_CONSENSUS_NODE_ACCOUNT_ID); - try (var client = Client - .forNetwork(network) - .setMirrorNetwork(List.of("localhost:5600"))) { + try (var client = Client.forNetwork(network).setMirrorNetwork(List.of("localhost:5600"))) { // Set the operator to be account 0.0.2 var originalOperatorKey = PrivateKey.fromString( - "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"); + "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"); client.setOperator(new AccountId(2), originalOperatorKey); // The account of the new node @@ -71,16 +52,16 @@ void canCreateNewNetworkNode() throws Exception { var adminKey = PrivateKeyECDSA.generateED25519(); new NodeCreateTransaction() - .setAccountId(accountID) - .setAdminKey(adminKey) - .setDescription(description) - .setGossipCaCertificate(validGossipCert) - .setGossipEndpoints(List.of(endpoint, endpoint2)) - .setServiceEndpoints(List.of(endpoint, endpoint2)) - .freezeWith(client) - .sign(adminKey) - .execute(client) - .getReceipt(client); + .setAccountId(accountID) + .setAdminKey(adminKey) + .setDescription(description) + .setGossipCaCertificate(validGossipCert) + .setGossipEndpoints(List.of(endpoint, endpoint2)) + .setServiceEndpoints(List.of(endpoint, endpoint2)) + .freezeWith(client) + .sign(adminKey) + .execute(client) + .getReceipt(client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java index 0208677f93..d95965d0a1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -28,46 +13,37 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class ReceiptQueryIntegrationTest { @Test @DisplayName("Can get Receipt") void canGetTransactionReceipt() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); var receipt = new TransactionReceiptQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); - + .setTransactionId(response.transactionId) + .execute(testEnv.client); } } @Test @DisplayName("Can get Record") void canGetTransactionRecord() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); new TransactionReceiptQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); + .setTransactionId(response.transactionId) + .execute(testEnv.client); new TransactionRecordQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); - + .setTransactionId(response.transactionId) + .execute(testEnv.client); } } @@ -75,23 +51,19 @@ void canGetTransactionRecord() throws Exception { @DisplayName("Can get Record cost") @SuppressWarnings("UnusedVariable") void getCostTransactionRecord() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); new TransactionReceiptQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); + .setTransactionId(response.transactionId) + .execute(testEnv.client); - var recordQuery = new TransactionRecordQuery() - .setTransactionId(response.transactionId); + var recordQuery = new TransactionRecordQuery().setTransactionId(response.transactionId); recordQuery.getCost(testEnv.client); recordQuery.execute(testEnv.client); - } } @@ -99,76 +71,71 @@ void getCostTransactionRecord() throws Exception { @DisplayName("Can get Record cost with big max set") @SuppressWarnings("UnusedVariable") void getCostBigMaxTransactionRecord() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); new TransactionReceiptQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); + .setTransactionId(response.transactionId) + .execute(testEnv.client); var recordQuery = new TransactionRecordQuery() - .setTransactionId(response.transactionId) - .setMaxQueryPayment(new Hbar(1000)); + .setTransactionId(response.transactionId) + .setMaxQueryPayment(new Hbar(1000)); recordQuery.getCost(testEnv.client); recordQuery.execute(testEnv.client); - } } @Test @DisplayName("Error at very small max, getRecord") void getCostSmallMaxTransactionRecord() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); var receipt = new TransactionReceiptQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); + .setTransactionId(response.transactionId) + .execute(testEnv.client); var recordQuery = new TransactionRecordQuery() - .setTransactionId(response.transactionId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + .setTransactionId(response.transactionId) + .setMaxQueryPayment(Hbar.fromTinybars(1)); var cost = recordQuery.getCost(testEnv.client); - assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> { - recordQuery.execute(testEnv.client); - }).withMessage("cost for TransactionRecordQuery, of " + cost.toString() + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); - + assertThatExceptionOfType(RuntimeException.class) + .isThrownBy(() -> { + recordQuery.execute(testEnv.client); + }) + .withMessage("cost for TransactionRecordQuery, of " + cost.toString() + + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); } } @Test @DisplayName("Insufficient transaction fee error for transaction record query") void getCostInsufficientTxFeeTransactionRecord() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); - var response = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var response = new AccountCreateTransaction().setKey(key).execute(testEnv.client); var receipt = new TransactionReceiptQuery() - .setTransactionId(response.transactionId) - .execute(testEnv.client); - - var recordQuery = new TransactionRecordQuery() - .setTransactionId(response.transactionId); + .setTransactionId(response.transactionId) + .execute(testEnv.client); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - recordQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + var recordQuery = new TransactionRecordQuery().setTransactionId(response.transactionId); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + recordQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java index 7087b0c6d7..8972070d1d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -66,24 +48,19 @@ void canCreateSchedule() throws Exception { var key = PrivateKey.generateED25519(); - var transaction = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(10)); + var transaction = new AccountCreateTransaction().setKey(key).setInitialBalance(new Hbar(10)); var response = new ScheduleCreateTransaction() - .setScheduledTransaction(transaction) - .setAdminKey(testEnv.operatorKey) - .setPayerAccountId(testEnv.operatorId) - .execute(testEnv.client); + .setScheduledTransaction(transaction) + .setAdminKey(testEnv.operatorKey) + .setPayerAccountId(testEnv.operatorId) + .execute(testEnv.client); var scheduleId = Objects.requireNonNull(response.getReceipt(testEnv.client).scheduleId); - var info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info.executedAt).isNotNull(); - } } @@ -95,25 +72,20 @@ void canGetTransactionSchedule() throws Exception { var key = PrivateKey.generateED25519(); - var transaction = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(10)); + var transaction = new AccountCreateTransaction().setKey(key).setInitialBalance(new Hbar(10)); var response = new ScheduleCreateTransaction() - .setScheduledTransaction(transaction) - .setAdminKey(testEnv.operatorKey) - .setPayerAccountId(testEnv.operatorId) - .execute(testEnv.client); + .setScheduledTransaction(transaction) + .setAdminKey(testEnv.operatorKey) + .setPayerAccountId(testEnv.operatorId) + .execute(testEnv.client); var scheduleId = Objects.requireNonNull(response.getReceipt(testEnv.client).scheduleId); - var info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info.executedAt).isNotNull(); assertThat(info.getScheduledTransaction()).isNotNull(); - } } @@ -125,26 +97,20 @@ void canCreateWithSchedule() throws Exception { var key = PrivateKey.generateED25519(); - var transaction = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(10)); + var transaction = new AccountCreateTransaction().setKey(key).setInitialBalance(new Hbar(10)); var tx = transaction.schedule(); - var response = tx - .setAdminKey(testEnv.operatorKey) - .setPayerAccountId(testEnv.operatorId) - .execute(testEnv.client); + var response = tx.setAdminKey(testEnv.operatorKey) + .setPayerAccountId(testEnv.operatorId) + .execute(testEnv.client); var scheduleId = Objects.requireNonNull(response.getReceipt(testEnv.client).scheduleId); - var info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info.executedAt).isNotNull(); assertThat(info.getScheduledTransaction()).isNotNull(); - } } @@ -165,9 +131,9 @@ void canSignSchedule2() throws Exception { // Creat the account with the `KeyList` TransactionResponse response = new AccountCreateTransaction() - .setKey(keyList) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client); + .setKey(keyList) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client); // This will wait for the receipt to become available TransactionReceipt receipt = response.getReceipt(testEnv.client); @@ -180,9 +146,9 @@ void canSignSchedule2() throws Exception { // Create a transfer transaction with 2/3 signatures. TransferTransaction transfer = new TransferTransaction() - .setTransactionId(transactionId) - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .setTransactionId(transactionId) + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction ScheduleCreateTransaction scheduled = transfer.schedule(); @@ -193,38 +159,41 @@ void canSignSchedule2() throws Exception { ScheduleId scheduleId = Objects.requireNonNull(receipt.scheduleId); // Get the schedule info to see if `signatories` is populated with 2/3 signatures - ScheduleInfo info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + ScheduleInfo info = + new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info.executedAt).isNull(); // Finally send this last signature to Hedera. This last signature _should_ mean the transaction executes // since all 3 signatures have been provided. - ScheduleSignTransaction signTransaction = new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client); + ScheduleSignTransaction signTransaction = + new ScheduleSignTransaction().setScheduleId(scheduleId).freezeWith(testEnv.client); - signTransaction.sign(key1).sign(key2).sign(key3).execute(testEnv.client).getReceipt(testEnv.client); + signTransaction + .sign(key1) + .sign(key2) + .sign(key3) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info.executedAt).isNotNull(); assertThat(scheduleId.getChecksum()).isNull(); assertThat(scheduleId.hashCode()).isNotZero(); - assertThat(scheduleId.compareTo(ScheduleId.fromBytes(scheduleId.toBytes()))).isZero(); + assertThat(scheduleId.compareTo(ScheduleId.fromBytes(scheduleId.toBytes()))) + .isZero(); new AccountDeleteTransaction() - .setAccountId(accountId) - .setTransferAccountId(testEnv.operatorId) - .freezeWith(testEnv.client) - .sign(key1).sign(key2).sign(key3) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .setTransferAccountId(testEnv.operatorId) + .freezeWith(testEnv.client) + .sign(key1) + .sign(key2) + .sign(key3) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -236,66 +205,63 @@ void canScheduleTokenTransfer() throws Exception { PrivateKey key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setReceiverSignatureRequired(true) - .setKey(key) - .setInitialBalance(new Hbar(10)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setReceiverSignatureRequired(true) + .setKey(key) + .setInitialBalance(new Hbar(10)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; Objects.requireNonNull(accountId); var tokenId = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setInitialSupply(100) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("ffff") + .setTokenSymbol("F") + .setInitialSupply(100) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; Objects.requireNonNull(tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); var scheduleId = new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, accountId, 10) - .schedule() - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, accountId, 10) + .schedule() + .execute(testEnv.client) + .getReceipt(testEnv.client) + .scheduleId; Objects.requireNonNull(scheduleId); - var balanceQuery1 = new AccountBalanceQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var balanceQuery1 = + new AccountBalanceQuery().setAccountId(accountId).execute(testEnv.client); assertThat(balanceQuery1.tokens.get(tokenId)).isEqualTo(0); new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var balanceQuery2 = new AccountBalanceQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var balanceQuery2 = + new AccountBalanceQuery().setAccountId(accountId).execute(testEnv.client); assertThat(balanceQuery2.tokens.get(tokenId)).isEqualTo(10); - } } @@ -306,24 +272,19 @@ void cannotScheduleTwoTransactions() throws Exception { var key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setInitialBalance(new Hbar(10)) - .setKey(key) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setInitialBalance(new Hbar(10)) + .setKey(key) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var transferTx = new TransferTransaction() - .addHbarTransfer(testEnv.operatorId, new Hbar(-10)) - .addHbarTransfer(accountId, new Hbar(10)); + .addHbarTransfer(testEnv.operatorId, new Hbar(-10)) + .addHbarTransfer(accountId, new Hbar(10)); - var scheduleId1 = transferTx.schedule() - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; + var scheduleId1 = transferTx.schedule().execute(testEnv.client).getReceipt(testEnv.client).scheduleId; - var info1 = new ScheduleInfoQuery() - .setScheduleId(scheduleId1) - .execute(testEnv.client); + var info1 = new ScheduleInfoQuery().setScheduleId(scheduleId1).execute(testEnv.client); assertThat(info1.executedAt).isNotNull(); @@ -334,12 +295,11 @@ void cannotScheduleTwoTransactions() throws Exception { assertThat(scheduleCreateTx2.toString()).isEqualTo(scheduleCreateTx1.toString()); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - transferTxFromInfo.schedule() - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("IDENTICAL_SCHEDULE_ALREADY_CREATED"); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + transferTxFromInfo.schedule().execute(testEnv.client).getReceipt(testEnv.client); + }) + .withMessageContaining("IDENTICAL_SCHEDULE_ALREADY_CREATED"); } } @@ -363,42 +323,39 @@ void canScheduleTopicMessage() throws Exception { keyList.add(key3.getPublicKey()); var response = new AccountCreateTransaction() - .setInitialBalance(new Hbar(100)) - .setKey(keyList) - .execute(testEnv.client); + .setInitialBalance(new Hbar(100)) + .setKey(keyList) + .execute(testEnv.client); assertThat(response.getReceipt(testEnv.client).accountId).isNotNull(); var topicId = Objects.requireNonNull(new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setAutoRenewAccountId(testEnv.operatorId) - .setTopicMemo("HCS Topic_") - .setSubmitKey(key2.getPublicKey()) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .topicId - ); + .setAdminKey(testEnv.operatorKey) + .setAutoRenewAccountId(testEnv.operatorId) + .setTopicMemo("HCS Topic_") + .setSubmitKey(key2.getPublicKey()) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .topicId); var transaction = new TopicMessageSubmitTransaction() - .setTopicId(topicId) - .setMessage("scheduled hcs message".getBytes(StandardCharsets.UTF_8)); + .setTopicId(topicId) + .setMessage("scheduled hcs message".getBytes(StandardCharsets.UTF_8)); // create schedule - var scheduledTx = transaction.schedule() - .setAdminKey(testEnv.operatorKey) - .setPayerAccountId(testEnv.operatorId) - .setScheduleMemo("mirror scheduled E2E signature on create and sign_" + Instant.now()); + var scheduledTx = transaction + .schedule() + .setAdminKey(testEnv.operatorKey) + .setPayerAccountId(testEnv.operatorId) + .setScheduleMemo("mirror scheduled E2E signature on create and sign_" + Instant.now()); var scheduled = scheduledTx.freezeWith(testEnv.client); - var scheduleId = Objects.requireNonNull(scheduled - .execute(testEnv.client) - .getReceipt(testEnv.client).scheduleId); + var scheduleId = + Objects.requireNonNull(scheduled.execute(testEnv.client).getReceipt(testEnv.client).scheduleId); // verify schedule has been created and has 1 of 2 signatures - var info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info).isNotNull(); assertThat(info.scheduleId).isEqualTo(scheduleId); @@ -408,21 +365,14 @@ void canScheduleTopicMessage() throws Exception { assertThat(transaction.getTopicId()).isEqualTo(infoTransaction.getTopicId()); assertThat(transaction.getNodeAccountIds()).isEqualTo(infoTransaction.getNodeAccountIds()); - var scheduleSign = new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client); + var scheduleSign = + new ScheduleSignTransaction().setScheduleId(scheduleId).freezeWith(testEnv.client); - scheduleSign - .sign(key2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + scheduleSign.sign(key2).execute(testEnv.client).getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); assertThat(info.executedAt).isNotNull(); - } } @@ -434,51 +384,48 @@ void canSignSchedule() throws Exception { PrivateKey key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setKey(key.getPublicKey()) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key.getPublicKey()) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - var scheduleId = transfer - .schedule() - .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; - - ScheduleInfo info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var scheduleId = transfer.schedule() + .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .scheduleId; + + ScheduleInfo info = + new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is not yet executed assertThat(info.executedAt).isNull(); // Schedule sign new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is executed assertThat(info.executedAt).isNotNull(); assertThat(scheduleId.getChecksum()).isNull(); assertThat(scheduleId.hashCode()).isNotZero(); - assertThat(scheduleId.compareTo(ScheduleId.fromBytes(scheduleId.toBytes()))).isZero(); + assertThat(scheduleId.compareTo(ScheduleId.fromBytes(scheduleId.toBytes()))) + .isZero(); } } @@ -490,26 +437,25 @@ void cannotScheduleTransactionOneYearIntoTheFuture() throws Exception { PrivateKey key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setKey(key.getPublicKey()) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key.getPublicKey()) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> - transfer - .schedule() - .setExpirationTime(Instant.now().plus(Duration.ofDays(365))) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client)) - .withMessageContaining(Status.SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE.toString()); + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> transfer.schedule() + .setExpirationTime(Instant.now().plus(Duration.ofDays(365))) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining(Status.SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE.toString()); } } @@ -521,26 +467,26 @@ void cannotScheduleTransactionInThePast() throws Exception { PrivateKey key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setKey(key.getPublicKey()) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key.getPublicKey()) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> - transfer - .schedule() - .setExpirationTime(Instant.now().minusSeconds(10)) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client)) - .withMessageContaining(Status.SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME.toString()); + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> transfer.schedule() + .setExpirationTime(Instant.now().minusSeconds(10)) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client)) + .withMessageContaining( + Status.SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME.toString()); } } @@ -552,52 +498,49 @@ void canSignScheduleAndWaitForExpiry() throws Exception { PrivateKey key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setKey(key.getPublicKey()) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key.getPublicKey()) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - var scheduleId = transfer - .schedule() - .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) - .setWaitForExpiry(true) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; - - ScheduleInfo info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var scheduleId = transfer.schedule() + .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) + .setWaitForExpiry(true) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .scheduleId; + + ScheduleInfo info = + new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is not yet executed assertThat(info.executedAt).isNull(); // Schedule sign new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is still not executed assertThat(info.executedAt).isNull(); assertThat(scheduleId.getChecksum()).isNull(); assertThat(scheduleId.hashCode()).isNotZero(); - assertThat(scheduleId.compareTo(ScheduleId.fromBytes(scheduleId.toBytes()))).isZero(); + assertThat(scheduleId.compareTo(ScheduleId.fromBytes(scheduleId.toBytes()))) + .isZero(); } } @@ -618,77 +561,69 @@ void canSignWithMultiSigAndUpdateSigningRequirements() throws Exception { keyList.add(key3.getPublicKey()); var accountId = new AccountCreateTransaction() - .setKey(keyList) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(keyList) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - var scheduleId = transfer - .schedule() - .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; - - ScheduleInfo info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var scheduleId = transfer.schedule() + .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .scheduleId; + + ScheduleInfo info = + new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is not executed assertThat(info.executedAt).isNull(); // Sign with one key new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key1) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is still not executed assertThat(info.executedAt).isNull(); // Update the signing requirements new AccountUpdateTransaction() - .setAccountId(accountId) - .setKey(key4.getPublicKey()) - .freezeWith(testEnv.client) - .sign(key1) - .sign(key2) - .sign(key4) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + .setAccountId(accountId) + .setKey(key4.getPublicKey()) + .freezeWith(testEnv.client) + .sign(key1) + .sign(key2) + .sign(key4) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is still not executed assertThat(info.executedAt).isNull(); // Sign with the updated key new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key4) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key4) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is executed assertThat(info.executedAt).isNotNull(); @@ -711,76 +646,68 @@ void canSignWithMultiSig() throws Exception { keyList.add(key3.getPublicKey()); var accountId = new AccountCreateTransaction() - .setKey(keyList) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(keyList) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - var scheduleId = transfer - .schedule() - .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; - - ScheduleInfo info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var scheduleId = transfer.schedule() + .setExpirationTime(Instant.now().plusSeconds(oneDayInSecs)) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .scheduleId; + + ScheduleInfo info = + new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is not executed assertThat(info.executedAt).isNull(); // Sign with one key new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key1) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is still not executed assertThat(info.executedAt).isNull(); // Update the signing requirements new AccountUpdateTransaction() - .setAccountId(accountId) - .setKey(key1.getPublicKey()) - .freezeWith(testEnv.client) - .sign(key1) - .sign(key2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + .setAccountId(accountId) + .setKey(key1.getPublicKey()) + .freezeWith(testEnv.client) + .sign(key1) + .sign(key2) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is still not executed assertThat(info.executedAt).isNull(); // Sign with one more key new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key2) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is executed assertThat(info.executedAt).isNotNull(); @@ -795,61 +722,56 @@ void canExecuteWithShortExpirationTime() throws Exception { PrivateKey key1 = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setKey(key1) - .setInitialBalance(new Hbar(10)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key1) + .setInitialBalance(new Hbar(10)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // Create the transaction TransferTransaction transfer = new TransferTransaction() - .addHbarTransfer(accountId, new Hbar(1).negated()) - .addHbarTransfer(testEnv.operatorId, new Hbar(1)); + .addHbarTransfer(accountId, new Hbar(1).negated()) + .addHbarTransfer(testEnv.operatorId, new Hbar(1)); // Schedule the transaction - var scheduleId = transfer - .schedule() - .setExpirationTime(Instant.now().plusSeconds(10)) - .setWaitForExpiry(true) - .setScheduleMemo("HIP-423 Integration Test") - .execute(testEnv.client) - .getReceipt(testEnv.client) - .scheduleId; - - ScheduleInfo info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + var scheduleId = transfer.schedule() + .setExpirationTime(Instant.now().plusSeconds(10)) + .setWaitForExpiry(true) + .setScheduleMemo("HIP-423 Integration Test") + .execute(testEnv.client) + .getReceipt(testEnv.client) + .scheduleId; + + ScheduleInfo info = + new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is not executed assertThat(info.executedAt).isNull(); // Sign new ScheduleSignTransaction() - .setScheduleId(scheduleId) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setScheduleId(scheduleId) + .freezeWith(testEnv.client) + .sign(key1) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new ScheduleInfoQuery() - .setScheduleId(scheduleId) - .execute(testEnv.client); + info = new ScheduleInfoQuery().setScheduleId(scheduleId).execute(testEnv.client); // Verify the transaction is still not executed assertThat(info.executedAt).isNull(); - var accountBalanceBefore = new AccountBalanceQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var accountBalanceBefore = + new AccountBalanceQuery().setAccountId(accountId).execute(testEnv.client); Thread.sleep(10_000); - var accountBalanceAfter = new AccountBalanceQuery() - .setAccountId(accountId) - .execute(testEnv.client); + var accountBalanceAfter = + new AccountBalanceQuery().setAccountId(accountId).execute(testEnv.client); // Verify the transaction executed after 10 seconds - assertThat(accountBalanceBefore.hbars.compareTo(accountBalanceAfter.hbars)).isEqualTo(1); + assertThat(accountBalanceBefore.hbars.compareTo(accountBalanceAfter.hbars)) + .isEqualTo(1); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java index 694a454783..2bef94a680 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ContractCreateTransaction; import com.hiero.sdk.ContractFunctionParameters; import com.hiero.sdk.FileCreateTransaction; @@ -26,31 +10,27 @@ import com.hiero.sdk.Status; import com.hiero.sdk.SystemDeleteTransaction; import com.hiero.sdk.SystemUndeleteTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import java.time.Instant; - import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; public class SystemIntegrationTest { - private static final String SMART_CONTRACT_BYTECODE = "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; + private static final String SMART_CONTRACT_BYTECODE = + "608060405234801561001057600080fd5b506040516104d73803806104d78339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b0319163317905550805161010890600190602084019061010f565b50506101aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061015057805160ff191683800117855561017d565b8280016001018555821561017d579182015b8281111561017d578251825591602001919060010190610162565b5061018992915061018d565b5090565b6101a791905b808211156101895760008155600101610193565b90565b61031e806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063368b87721461004657806341c0e1b5146100ee578063ce6d41de146100f6575b600080fd5b6100ec6004803603602081101561005c57600080fd5b81019060208101813564010000000081111561007757600080fd5b82018360208201111561008957600080fd5b803590602001918460018302840111640100000000831117156100ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610173945050505050565b005b6100ec6101a2565b6100fe6101ba565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610138578181015183820152602001610120565b50505050905090810190601f1680156101655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6000546001600160a01b0316331461018a5761019f565b805161019d906001906020840190610250565b505b50565b6000546001600160a01b03163314156101b85733ff5b565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156102455780601f1061021a57610100808354040283529160200191610245565b820191906000526020600020905b81548152906001019060200180831161022857829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029157805160ff19168380011785556102be565b828001600101855582156102be579182015b828111156102be5782518255916020019190600101906102a3565b506102ca9291506102ce565b5090565b61024d91905b808211156102ca57600081556001016102d456fea264697066735822122084964d4c3f6bc912a9d20e14e449721012d625aa3c8a12de41ae5519752fc89064736f6c63430006000033"; @Test @DisplayName("All system transactions are not supported") void allSystemTransactionsAreNotSupported() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var fileId = Objects.requireNonNull( - new FileCreateTransaction() + var fileId = Objects.requireNonNull(new FileCreateTransaction() .setContents(SMART_CONTRACT_BYTECODE) .execute(testEnv.client) .getReceipt(testEnv.client) .fileId); - var contractId = Objects.requireNonNull( - new ContractCreateTransaction() + var contractId = Objects.requireNonNull(new ContractCreateTransaction() .setAdminKey(testEnv.operatorKey) .setGas(200000) .setConstructorParameters(new ContractFunctionParameters().addString("Hello from Hedera.")) @@ -58,35 +38,39 @@ void allSystemTransactionsAreNotSupported() throws Exception { .setContractMemo("[e2e::ContractCreateTransaction]") .execute(testEnv.client) .getReceipt(testEnv.client) - .contractId - ); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new SystemDeleteTransaction() - .setContractId(contractId) - .setExpirationTime(Instant.now()) - .execute(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); + .contractId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new SystemDeleteTransaction() - .setFileId(fileId) - .setExpirationTime(Instant.now()) - .execute(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new SystemDeleteTransaction() + .setContractId(contractId) + .setExpirationTime(Instant.now()) + .execute(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new SystemUndeleteTransaction() - .setContractId(contractId) - .execute(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new SystemDeleteTransaction() + .setFileId(fileId) + .setExpirationTime(Instant.now()) + .execute(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new SystemUndeleteTransaction() - .setFileId(fileId) - .execute(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new SystemUndeleteTransaction() + .setContractId(contractId) + .execute(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new SystemUndeleteTransaction().setFileId(fileId).execute(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java index b0284e4286..36dc1a57d7 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; @@ -59,10 +41,10 @@ void canCancelTokens() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with 0 auto associations @@ -71,38 +53,35 @@ void canCancelTokens() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // sender cancels the tokens record = new TokenCancelAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .addPendingAirdrop(record.pendingAirdropRecords.get(1).getPendingAirdropId()) - .addPendingAirdrop(record.pendingAirdropRecords.get(2).getPendingAirdropId()) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addPendingAirdrop(record.pendingAirdropRecords.get(1).getPendingAirdropId()) + .addPendingAirdrop(record.pendingAirdropRecords.get(2).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify in the transaction record the pending airdrop ids for nft and ft - should no longer exist assertEquals(0, record.pendingAirdropRecords.size()); // verify the receiver does not hold the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertNull(receiverAccountBalance.tokens.get(tokenID)); assertNull(receiverAccountBalance.tokens.get(nftID)); // verify the operator does hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts, operatorBalance.tokens.get(nftID)); - } } @@ -120,33 +99,32 @@ void canCancelTokensWhenTokenIsFrozen() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // associate new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(tokenID)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(tokenID)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // freeze the token new TokenFreezeTransaction() - .setAccountId(receiverAccountId) - .setTokenId(tokenID) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenId(tokenID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // cancel new TokenCancelAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .execute(testEnv.client) - .getRecord(testEnv.client); - + .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); } } @@ -164,20 +142,22 @@ void canCancelTokensWhenTokenIsPaused() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // pause the token - new TokenPauseTransaction().setTokenId(tokenID).execute(testEnv.client).getReceipt(testEnv.client); + new TokenPauseTransaction() + .setTokenId(tokenID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // cancel new TokenCancelAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .execute(testEnv.client) - .getRecord(testEnv.client); - + .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); } } @@ -195,20 +175,22 @@ void canCancelTokensWhenTokenIsDeleted() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // delete the token - new TokenDeleteTransaction().setTokenId(tokenID).execute(testEnv.client).getReceipt(testEnv.client); + new TokenDeleteTransaction() + .setTokenId(tokenID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // cancel new TokenCancelAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .execute(testEnv.client) - .getRecord(testEnv.client); - + .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); } } @@ -222,10 +204,10 @@ void canCancelTokensToMultipleReceivers() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver1 with 0 auto associations @@ -253,7 +235,8 @@ var record = new TokenAirdropTransaction() assertEquals(6, record.pendingAirdropRecords.size()); // cancel the tokens signing with receiver1 and receiver2 - var pendingAirdropIDs = record.pendingAirdropRecords.stream().map(PendingAirdropRecord::getPendingAirdropId) + var pendingAirdropIDs = record.pendingAirdropRecords.stream() + .map(PendingAirdropRecord::getPendingAirdropId) .toList(); record = new TokenCancelAirdropTransaction() .setPendingAirdropIds(pendingAirdropIDs) @@ -264,26 +247,22 @@ record = new TokenCancelAirdropTransaction() assertEquals(0, record.pendingAirdropRecords.size()); // verify receiver1 does not hold the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiver1AccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiver1AccountId).execute(testEnv.client); assertNull(receiverAccountBalance.tokens.get(tokenID)); assertNull(receiverAccountBalance.tokens.get(nftID)); // verify receiver2 does not hold the tokens via query - var receiver2AccountBalance = new AccountBalanceQuery() - .setAccountId(receiver1AccountId) - .execute(testEnv.client); + var receiver2AccountBalance = + new AccountBalanceQuery().setAccountId(receiver1AccountId).execute(testEnv.client); assertNull(receiver2AccountBalance.tokens.get(tokenID)); assertNull(receiver2AccountBalance.tokens.get(nftID)); // verify the operator does hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts, operatorBalance.tokens.get(nftID)); - } } @@ -297,10 +276,10 @@ void canCancelTokensFromMultipleAirdropTxns() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with 0 auto associations @@ -309,20 +288,20 @@ void canCancelTokensFromMultipleAirdropTxns() throws Exception { // airdrop some of the tokens to the receiver var record1 = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getRecord(testEnv.client); // airdrop some of the tokens to the receiver var record2 = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getRecord(testEnv.client); // airdrop some of the tokens to the receiver var record3 = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // get the PendingIds from the records var pendingAirdropIDs = new ArrayList(); @@ -332,27 +311,24 @@ void canCancelTokensFromMultipleAirdropTxns() throws Exception { // cancel the all the tokens with the receiver var record = new TokenCancelAirdropTransaction() - .setPendingAirdropIds(pendingAirdropIDs) - .execute(testEnv.client) - .getRecord(testEnv.client); + .setPendingAirdropIds(pendingAirdropIDs) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify in the transaction record the pending airdrop ids for nft and ft - should no longer exist assertEquals(0, record.pendingAirdropRecords.size()); // verify the receiver does not hold the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertNull(receiverAccountBalance.tokens.get(tokenID)); assertNull(receiverAccountBalance.tokens.get(nftID)); // verify the operator does hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts, operatorBalance.tokens.get(nftID)); - } } @@ -370,10 +346,10 @@ void cannotCancelTokensForNonExistingAirdrop() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // create receiver with 0 auto associations var randomAccountKey = PrivateKey.generateED25519(); @@ -381,14 +357,16 @@ var record = new TokenAirdropTransaction() // cancel the tokens with the random account which has not created pending airdrops // fails with INVALID_SIGNATURE - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenCancelAirdropTransaction() - .setTransactionId(TransactionId.generate(randomAccount)) - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .execute(testEnv.client) - .getRecord(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenCancelAirdropTransaction() + .setTransactionId(TransactionId.generate(randomAccount)) + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -406,26 +384,28 @@ void canonCancelTokensForAlreadyCanceledAirdrop() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // cancel the tokens with the receiver new TokenCancelAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .execute(testEnv.client) - .getRecord(testEnv.client); - - // cancel the tokens with the receiver again - // fails with INVALID_PENDING_AIRDROP_ID - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCancelAirdropTransaction() .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) .execute(testEnv.client) .getRecord(testEnv.client); - }).withMessageContaining(Status.INVALID_PENDING_AIRDROP_ID.toString()); + // cancel the tokens with the receiver again + // fails with INVALID_PENDING_AIRDROP_ID + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCancelAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.INVALID_PENDING_AIRDROP_ID.toString()); } } @@ -436,12 +416,13 @@ void canonCancelWithEmptyPendingAirdropsList() throws Exception { // cancel the tokens with the receiver without setting pendingAirdropIds // fails with EMPTY_PENDING_AIRDROP_ID_LIST - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenCancelAirdropTransaction() - .execute(testEnv.client) - .getRecord(testEnv.client); - }).withMessageContaining(Status.EMPTY_PENDING_AIRDROP_ID_LIST.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenCancelAirdropTransaction() + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.EMPTY_PENDING_AIRDROP_ID_LIST.toString()); } } @@ -459,21 +440,24 @@ void cannotCancelTokensWithDuplicateEntries() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); - - // cancel the tokens with duplicate pending airdrop token ids - // fails with PENDING_AIRDROP_ID_REPEATED - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenCancelAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) .execute(testEnv.client) .getRecord(testEnv.client); - }).withMessageContaining(Status.PENDING_AIRDROP_ID_REPEATED.toString()); + // cancel the tokens with duplicate pending airdrop token ids + // fails with PENDING_AIRDROP_ID_REPEATED + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenCancelAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.PENDING_AIRDROP_ID_REPEATED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java index de3954fcc6..0dea6fb01d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; @@ -58,10 +40,10 @@ void canClaimTokens() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with 0 auto associations @@ -70,55 +52,58 @@ void canClaimTokens() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify the txn record assertEquals(3, record.pendingAirdropRecords.size()); assertEquals(100, record.pendingAirdropRecords.get(0).getPendingAirdropAmount()); - assertEquals(tokenID, record.pendingAirdropRecords.get(0).getPendingAirdropId().getTokenId()); + assertEquals( + tokenID, + record.pendingAirdropRecords.get(0).getPendingAirdropId().getTokenId()); assertNull(record.pendingAirdropRecords.get(0).getPendingAirdropId().getNftId()); assertEquals(0, record.pendingAirdropRecords.get(1).getPendingAirdropAmount()); - assertEquals(nftID.nft(1), record.pendingAirdropRecords.get(1).getPendingAirdropId().getNftId()); + assertEquals( + nftID.nft(1), + record.pendingAirdropRecords.get(1).getPendingAirdropId().getNftId()); assertNull(record.pendingAirdropRecords.get(1).getPendingAirdropId().getTokenId()); assertEquals(0, record.pendingAirdropRecords.get(2).getPendingAirdropAmount()); - assertEquals(nftID.nft(2), record.pendingAirdropRecords.get(2).getPendingAirdropId().getNftId()); + assertEquals( + nftID.nft(2), + record.pendingAirdropRecords.get(2).getPendingAirdropId().getNftId()); assertNull(record.pendingAirdropRecords.get(2).getPendingAirdropId().getTokenId()); // claim the tokens with the receiver record = new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .addPendingAirdrop(record.pendingAirdropRecords.get(1).getPendingAirdropId()) - .addPendingAirdrop(record.pendingAirdropRecords.get(2).getPendingAirdropId()) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addPendingAirdrop(record.pendingAirdropRecords.get(1).getPendingAirdropId()) + .addPendingAirdrop(record.pendingAirdropRecords.get(2).getPendingAirdropId()) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify in the transaction record the pending airdrop ids for nft and ft - should no longer exist assertEquals(0, record.pendingAirdropRecords.size()); // verify the receiver holds the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertEquals(amount, receiverAccountBalance.tokens.get(tokenID)); assertEquals(2, receiverAccountBalance.tokens.get(nftID)); // verify the operator does not hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance - amount, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts - 2, operatorBalance.tokens.get(nftID)); - } } @@ -132,10 +117,10 @@ void canClaimTokensToMultipleReceivers() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver1 with 0 auto associations @@ -148,54 +133,51 @@ void canClaimTokensToMultipleReceivers() throws Exception { // airdrop the tokens to both var record = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiver1AccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiver1AccountId) - .addTokenTransfer(tokenID, receiver1AccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .addNftTransfer(nftID.nft(nftSerials.get(2)), testEnv.operatorId, receiver2AccountId) - .addNftTransfer(nftID.nft(nftSerials.get(3)), testEnv.operatorId, receiver2AccountId) - .addTokenTransfer(tokenID, receiver2AccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiver1AccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiver1AccountId) + .addTokenTransfer(tokenID, receiver1AccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .addNftTransfer(nftID.nft(nftSerials.get(2)), testEnv.operatorId, receiver2AccountId) + .addNftTransfer(nftID.nft(nftSerials.get(3)), testEnv.operatorId, receiver2AccountId) + .addTokenTransfer(tokenID, receiver2AccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify the txn record assertEquals(6, record.pendingAirdropRecords.size()); // claim the tokens signing with receiver1 and receiver2 - var pendingAirdropIDs = record.pendingAirdropRecords.stream().map(PendingAirdropRecord::getPendingAirdropId) + var pendingAirdropIDs = record.pendingAirdropRecords.stream() + .map(PendingAirdropRecord::getPendingAirdropId) .toList(); record = new TokenClaimAirdropTransaction() - .setPendingAirdropIds(pendingAirdropIDs) - .freezeWith(testEnv.client) - .sign(receiver1AccountKey) - .sign(receiver2AccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); + .setPendingAirdropIds(pendingAirdropIDs) + .freezeWith(testEnv.client) + .sign(receiver1AccountKey) + .sign(receiver2AccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify in the transaction record the pending airdrop ids for nft and ft - should no longer exist assertEquals(0, record.pendingAirdropRecords.size()); // verify receiver1 holds the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiver1AccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiver1AccountId).execute(testEnv.client); assertEquals(amount, receiverAccountBalance.tokens.get(tokenID)); assertEquals(2, receiverAccountBalance.tokens.get(nftID)); // verify receiver2 holds the tokens via query - var receiver2AccountBalance = new AccountBalanceQuery() - .setAccountId(receiver1AccountId) - .execute(testEnv.client); + var receiver2AccountBalance = + new AccountBalanceQuery().setAccountId(receiver1AccountId).execute(testEnv.client); assertEquals(amount, receiver2AccountBalance.tokens.get(tokenID)); assertEquals(2, receiver2AccountBalance.tokens.get(nftID)); // verify the operator does not hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance - amount * 2, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts - 4, operatorBalance.tokens.get(nftID)); - } } @@ -209,10 +191,10 @@ void canClaimTokensFromMultipleAirdropTxns() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with 0 auto associations @@ -221,20 +203,20 @@ void canClaimTokensFromMultipleAirdropTxns() throws Exception { // airdrop some of the tokens to the receiver var record1 = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getRecord(testEnv.client); // airdrop some of the tokens to the receiver var record2 = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getRecord(testEnv.client); // airdrop some of the tokens to the receiver var record3 = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // get the PendingIds from the records var pendingAirdropIDs = new ArrayList(); @@ -244,29 +226,26 @@ void canClaimTokensFromMultipleAirdropTxns() throws Exception { // claim the all the tokens with the receiver var record = new TokenClaimAirdropTransaction() - .setPendingAirdropIds(pendingAirdropIDs) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); + .setPendingAirdropIds(pendingAirdropIDs) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); // verify in the transaction record the pending airdrop ids for nft and ft - should no longer exist assertEquals(0, record.pendingAirdropRecords.size()); // verify the receiver holds the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertEquals(amount, receiverAccountBalance.tokens.get(tokenID)); assertEquals(2, receiverAccountBalance.tokens.get(nftID)); // verify the operator does not hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance - amount, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts - 2, operatorBalance.tokens.get(nftID)); - } } @@ -284,20 +263,22 @@ void cannotClaimTokensForNonExistingAirdrop() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); - - // claim the tokens with the operator which does not have pending airdrops - // fails with INVALID_SIGNATURE - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) .execute(testEnv.client) .getRecord(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); + // claim the tokens with the operator which does not have pending airdrops + // fails with INVALID_SIGNATURE + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -315,30 +296,32 @@ void cannotClaimTokensForAlreadyClaimedAirdrop() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // claim the tokens with the receiver new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); - - // claim the tokens with the receiver again - // fails with INVALID_PENDING_AIRDROP_ID - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) .freezeWith(testEnv.client) .sign(receiverAccountKey) .execute(testEnv.client) .getRecord(testEnv.client); - }).withMessageContaining(Status.INVALID_PENDING_AIRDROP_ID.toString()); + // claim the tokens with the receiver again + // fails with INVALID_PENDING_AIRDROP_ID + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.INVALID_PENDING_AIRDROP_ID.toString()); } } @@ -349,12 +332,13 @@ void cannotClaimWithEmptyPendingAirdropsList() throws Exception { // claim the tokens with the receiver without setting pendingAirdropIds // fails with EMPTY_PENDING_AIRDROP_ID_LIST - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() - .execute(testEnv.client) - .getRecord(testEnv.client); - }).withMessageContaining(Status.EMPTY_PENDING_AIRDROP_ID_LIST.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.EMPTY_PENDING_AIRDROP_ID_LIST.toString()); } } @@ -372,21 +356,24 @@ void cannotClaimTokensWithDuplicateEntries() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); - - // claim the tokens with duplicate pending airdrop token ids - // fails with PENDING_AIRDROP_ID_REPEATED - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) .execute(testEnv.client) .getRecord(testEnv.client); - }).withMessageContaining(Status.PENDING_AIRDROP_ID_REPEATED.toString()); + // claim the tokens with duplicate pending airdrop token ids + // fails with PENDING_AIRDROP_ID_REPEATED + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.PENDING_AIRDROP_ID_REPEATED.toString()); } } @@ -404,25 +391,30 @@ void cannotClaimTokensWhenTokenIsPaused() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // pause the token - new TokenPauseTransaction().setTokenId(tokenID).execute(testEnv.client).getReceipt(testEnv.client); + new TokenPauseTransaction() + .setTokenId(tokenID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // claim the tokens with receiver // fails with TOKEN_IS_PAUSED - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_PAUSED.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_PAUSED.toString()); } } @@ -440,25 +432,30 @@ void cannotClaimTokensWhenTokenIsDeleted() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // delete the token - new TokenDeleteTransaction().setTokenId(tokenID).execute(testEnv.client).getReceipt(testEnv.client); + new TokenDeleteTransaction() + .setTokenId(tokenID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // claim the tokens with receiver // fails with TOKEN_IS_DELETED - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); - }).withMessageContaining(Status.TOKEN_WAS_DELETED.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_WAS_DELETED.toString()); } } @@ -476,38 +473,40 @@ void cannotClaimTokensWhenTokenIsFrozen() throws Exception { // airdrop the tokens var record = new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getRecord(testEnv.client); // associate new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(tokenID)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(tokenID)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // freeze the token new TokenFreezeTransaction() - .setAccountId(receiverAccountId) - .setTokenId(tokenID) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenId(tokenID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // claim the tokens with receiver // fails with ACCOUNT_FROZEN_FOR_TOKEN - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenClaimAirdropTransaction() - .addPendingAirdrop(record.pendingAirdropRecords.get(0).getPendingAirdropId()) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); - }).withMessageContaining(Status.ACCOUNT_FROZEN_FOR_TOKEN.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenClaimAirdropTransaction() + .addPendingAirdrop( + record.pendingAirdropRecords.get(0).getPendingAirdropId()) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); + }) + .withMessageContaining(Status.ACCOUNT_FROZEN_FOR_TOKEN.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java index 1575309589..b1c84217f5 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; @@ -62,10 +44,10 @@ void canAirdropAssociatedTokens() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with unlimited auto associations and receiverSig = false @@ -74,27 +56,24 @@ void canAirdropAssociatedTokens() throws Exception { // airdrop the tokens new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the receiver holds the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertEquals(amount, receiverAccountBalance.tokens.get(tokenID)); assertEquals(2, receiverAccountBalance.tokens.get(nftID)); // verify the operator does not hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance - amount, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts - 2, operatorBalance.tokens.get(nftID)); - } } @@ -108,10 +87,10 @@ void canAirdropNonAssociatedTokens() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with 0 auto associations and receiverSig = false @@ -120,11 +99,11 @@ void canAirdropNonAssociatedTokens() throws Exception { // airdrop the tokens var txn = new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client); txn.setValidateStatus(true).getReceipt(testEnv.client); var record = txn.getRecord(testEnv.client); @@ -133,19 +112,16 @@ var record = txn.getRecord(testEnv.client); assertFalse(record.pendingAirdropRecords.isEmpty()); // verify the receiver does not hold the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertNull(receiverAccountBalance.tokens.get(tokenID)); assertNull(receiverAccountBalance.tokens.get(nftID)); // verify the operator does hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts, operatorBalance.tokens.get(nftID)); - } } @@ -159,10 +135,10 @@ void canAirdropToAlias() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // airdrop the tokens to an alias @@ -173,27 +149,24 @@ void canAirdropToAlias() throws Exception { // should lazy-create and transfer the tokens new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, aliasAccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, aliasAccountId) - .addTokenTransfer(tokenID, aliasAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, aliasAccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, aliasAccountId) + .addTokenTransfer(tokenID, aliasAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the receiver holds the tokens via query - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(aliasAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(aliasAccountId).execute(testEnv.client); assertEquals(amount, receiverAccountBalance.tokens.get(tokenID)); assertEquals(2, receiverAccountBalance.tokens.get(nftID)); // verify the operator does not hold the tokens - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance - amount, operatorBalance.tokens.get(tokenID)); assertEquals(mitedNfts - 2, operatorBalance.tokens.get(nftID)); - } } @@ -211,29 +184,29 @@ void canAirdropWithCustomFee() throws Exception { // make the custom fee to be paid by the sender and the fee collector to be the operator account CustomFixedFee fee = new CustomFixedFee() - .setFeeCollectorAccountId(testEnv.operatorId) - .setDenominatingTokenId(customFeeTokenID) - .setAmount(1) - .setAllCollectorsAreExempt(true); + .setFeeCollectorAccountId(testEnv.operatorId) + .setDenominatingTokenId(customFeeTokenID) + .setAmount(1) + .setAllCollectorsAreExempt(true); var tokenID = new TokenCreateTransaction() - .setTokenName("Test Fungible Token") - .setTokenSymbol("TFT") - .setTokenMemo("I was created for integration tests") - .setDecimals(3) - .setInitialSupply(fungibleInitialBalance) - .setMaxSupply(fungibleInitialBalance) - .setTreasuryAccountId(testEnv.operatorId) - .setSupplyType(TokenSupplyType.FINITE) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey) - .setCustomFees(Collections.singletonList(fee)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("Test Fungible Token") + .setTokenSymbol("TFT") + .setTokenMemo("I was created for integration tests") + .setDecimals(3) + .setInitialSupply(fungibleInitialBalance) + .setMaxSupply(fungibleInitialBalance) + .setTreasuryAccountId(testEnv.operatorId) + .setSupplyType(TokenSupplyType.FINITE) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .setCustomFees(Collections.singletonList(fee)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; // create sender account with unlimited associations and send some tokens to it var senderKey = PrivateKey.generateED25519(); @@ -241,53 +214,49 @@ void canAirdropWithCustomFee() throws Exception { // associate the token to the sender new TokenAssociateTransaction() - .setAccountId(senderAccountID) - .setTokenIds(Collections.singletonList(customFeeTokenID)) - .freezeWith(testEnv.client) - .sign(senderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(senderAccountID) + .setTokenIds(Collections.singletonList(customFeeTokenID)) + .freezeWith(testEnv.client) + .sign(senderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // send tokens to the sender new TransferTransaction() - .addTokenTransfer(customFeeTokenID, testEnv.operatorId, -amount) - .addTokenTransfer(customFeeTokenID, senderAccountID, amount) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(customFeeTokenID, testEnv.operatorId, -amount) + .addTokenTransfer(customFeeTokenID, senderAccountID, amount) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .addTokenTransfer(tokenID, senderAccountID, amount) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .addTokenTransfer(tokenID, senderAccountID, amount) + .execute(testEnv.client) + .getReceipt(testEnv.client); // airdrop the tokens from the sender to the receiver new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, senderAccountID, -amount) - .freezeWith(testEnv.client) - .sign(senderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, senderAccountID, -amount) + .freezeWith(testEnv.client) + .sign(senderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the custom fee has been paid by the sender to the collector - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertEquals(amount, receiverAccountBalance.tokens.get(tokenID)); - var senderAccountBalance = new AccountBalanceQuery() - .setAccountId(senderAccountID) - .execute(testEnv.client); + var senderAccountBalance = + new AccountBalanceQuery().setAccountId(senderAccountID).execute(testEnv.client); assertEquals(0, senderAccountBalance.tokens.get(tokenID)); assertEquals(amount - 1, senderAccountBalance.tokens.get(customFeeTokenID)); - var operatorBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var operatorBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertEquals(fungibleInitialBalance - amount + 1, operatorBalance.tokens.get(customFeeTokenID)); assertEquals(fungibleInitialBalance - amount, operatorBalance.tokens.get(tokenID)); - } } @@ -302,23 +271,22 @@ void canAirdropTokensWithReceiverSigRequiredFungible() throws Exception { // create receiver with unlimited auto associations and receiverSig = true var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = new AccountCreateTransaction() - .setKey(receiverAccountKey) - .setInitialBalance(new Hbar(1)) - .setReceiverSignatureRequired(true) - .setMaxAutomaticTokenAssociations(-1) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(receiverAccountKey) + .setInitialBalance(new Hbar(1)) + .setReceiverSignatureRequired(true) + .setMaxAutomaticTokenAssociations(-1) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // airdrop the tokens new TokenAirdropTransaction() - .addTokenTransfer(tokenID, receiverAccountId, amount) - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .addTokenTransfer(tokenID, receiverAccountId, amount) + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -331,32 +299,31 @@ void canAirdropTokensWithReceiverSigRequiredNFT() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create receiver with unlimited auto associations and receiverSig = true var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = new AccountCreateTransaction() - .setKey(receiverAccountKey) - .setInitialBalance(new Hbar(1)) - .setReceiverSignatureRequired(true) - .setMaxAutomaticTokenAssociations(-1) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(receiverAccountKey) + .setInitialBalance(new Hbar(1)) + .setReceiverSignatureRequired(true) + .setMaxAutomaticTokenAssociations(-1) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; // airdrop the tokens new TokenAirdropTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -378,32 +345,33 @@ void cannotAirdropTokensWithAllowanceAndWithoutBalanceFungible() throws Exceptio // transfer ft to sender new TransferTransaction() - .addTokenTransfer(tokenID, testEnv.operatorId, -amount) - .addTokenTransfer(tokenID, senderAccountID, amount) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenID, testEnv.operatorId, -amount) + .addTokenTransfer(tokenID, senderAccountID, amount) + .execute(testEnv.client) + .getReceipt(testEnv.client); // approve allowance to the spender new AccountAllowanceApproveTransaction() - .approveTokenAllowance(tokenID, senderAccountID, spenderAccountID, amount) - .freezeWith(testEnv.client) - .sign(senderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // airdrop the tokens from the sender to the spender via approval - // fails with NOT_SUPPORTED - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenAirdropTransaction() - .addTokenTransfer(tokenID, spenderAccountID, amount) - .addApprovedTokenTransfer(tokenID, spenderAccountID, -amount) - .setTransactionId(TransactionId.generate(spenderAccountID)) + .approveTokenAllowance(tokenID, senderAccountID, spenderAccountID, amount) .freezeWith(testEnv.client) - .sign(spenderKey) + .sign(senderKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); + // airdrop the tokens from the sender to the spender via approval + // fails with NOT_SUPPORTED + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenAirdropTransaction() + .addTokenTransfer(tokenID, spenderAccountID, amount) + .addApprovedTokenTransfer(tokenID, spenderAccountID, -amount) + .setTransactionId(TransactionId.generate(spenderAccountID)) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); } } @@ -416,10 +384,10 @@ void cannotAirdropTokensWithAllowanceAndWithoutBalanceNFT() throws Exception { var nftID = EntityHelper.createNft(testEnv); // mint some NFTs var mintReceipt = new TokenMintTransaction() - .setTokenId(nftID) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftID) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // create spender and approve to it some tokens @@ -432,33 +400,34 @@ void cannotAirdropTokensWithAllowanceAndWithoutBalanceNFT() throws Exception { // transfer ft to sender new TransferTransaction() - .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, senderAccountID) - .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, senderAccountID) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftID.nft(nftSerials.get(0)), testEnv.operatorId, senderAccountID) + .addNftTransfer(nftID.nft(nftSerials.get(1)), testEnv.operatorId, senderAccountID) + .execute(testEnv.client) + .getReceipt(testEnv.client); // approve allowance to the spender new AccountAllowanceApproveTransaction() - .approveTokenNftAllowance(nftID.nft(nftSerials.get(0)), senderAccountID, spenderAccountID) - .approveTokenNftAllowance(nftID.nft(nftSerials.get(1)), senderAccountID, spenderAccountID) - .freezeWith(testEnv.client) - .sign(senderKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // airdrop the tokens from the sender to the spender via approval - // fails with NOT_SUPPORTED - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenAirdropTransaction() - .addApprovedNftTransfer(nftID.nft(nftSerials.get(0)), senderAccountID, spenderAccountID) - .addApprovedNftTransfer(nftID.nft(nftSerials.get(1)), senderAccountID, spenderAccountID) - .setTransactionId(TransactionId.generate(spenderAccountID)) + .approveTokenNftAllowance(nftID.nft(nftSerials.get(0)), senderAccountID, spenderAccountID) + .approveTokenNftAllowance(nftID.nft(nftSerials.get(1)), senderAccountID, spenderAccountID) .freezeWith(testEnv.client) - .sign(spenderKey) + .sign(senderKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.NOT_SUPPORTED.toString()); + // airdrop the tokens from the sender to the spender via approval + // fails with NOT_SUPPORTED + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenAirdropTransaction() + .addApprovedNftTransfer(nftID.nft(nftSerials.get(0)), senderAccountID, spenderAccountID) + .addApprovedNftTransfer(nftID.nft(nftSerials.get(1)), senderAccountID, spenderAccountID) + .setTransactionId(TransactionId.generate(spenderAccountID)) + .freezeWith(testEnv.client) + .sign(spenderKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.NOT_SUPPORTED.toString()); } } @@ -469,25 +438,26 @@ void cannotAirdropTokensWithInvalidBody() throws Exception { // airdrop with no tokenID or NftID // fails with EMPTY_TOKEN_TRANSFER_BODY - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenAirdropTransaction() - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.EMPTY_TOKEN_TRANSFER_BODY.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenAirdropTransaction().execute(testEnv.client).getReceipt(testEnv.client); + }) + .withMessageContaining(Status.EMPTY_TOKEN_TRANSFER_BODY.toString()); // create fungible token var tokenID = EntityHelper.createFungibleToken(testEnv, 3); // airdrop with invalid transfers // fails with INVALID_TRANSACTION_BODY - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenAirdropTransaction() - .addTokenTransfer(tokenID, testEnv.operatorId, 100) - .addTokenTransfer(tokenID, testEnv.operatorId, 100) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TRANSACTION_BODY.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenAirdropTransaction() + .addTokenTransfer(tokenID, testEnv.operatorId, 100) + .addTokenTransfer(tokenID, testEnv.operatorId, 100) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TRANSACTION_BODY.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java index 350aeb682f..f1bb4aba9a 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountAllowanceApproveTransaction; import com.hiero.sdk.AccountBalanceQuery; import com.hiero.sdk.AccountCreateTransaction; @@ -33,156 +18,159 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class TokenAutomaticAssociationIntegrationTest { @Test @DisplayName("Can transfer Fungible Tokens to accounts with Limited Max Auto Associations") void canTransferFungibleTokensToAccountsWithLimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createFungibleToken(testEnv, 0); var tokenId2 = EntityHelper.createFungibleToken(testEnv, 0); var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 1; - var receiverAccountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); - - var accountInfoBeforeTokenAssociation = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); - assertThat(accountInfoBeforeTokenAssociation.maxAutomaticTokenAssociations).isEqualTo(1); - assertThat(accountInfoBeforeTokenAssociation.tokenRelationships.size()).isEqualTo(0); + var receiverAccountId = + EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); + var accountInfoBeforeTokenAssociation = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); + assertThat(accountInfoBeforeTokenAssociation.maxAutomaticTokenAssociations) + .isEqualTo(1); + assertThat(accountInfoBeforeTokenAssociation.tokenRelationships.size()) + .isEqualTo(0); var transferRecord = new TransferTransaction() - .addTokenTransfer(tokenId1, testEnv.operatorId, -1) - .addTokenTransfer(tokenId1, receiverAccountId, 1) - .execute(testEnv.client) - .getRecord(testEnv.client); + .addTokenTransfer(tokenId1, testEnv.operatorId, -1) + .addTokenTransfer(tokenId1, receiverAccountId, 1) + .execute(testEnv.client) + .getRecord(testEnv.client); assertThat(transferRecord.automaticTokenAssociations.size()).isEqualTo(1); - assertThat(transferRecord.automaticTokenAssociations.get(0).accountId).isEqualTo(receiverAccountId); + assertThat(transferRecord.automaticTokenAssociations.get(0).accountId) + .isEqualTo(receiverAccountId); assertThat(transferRecord.automaticTokenAssociations.get(0).tokenId).isEqualTo(tokenId1); - var accountInfoAfterTokenAssociation = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); - assertThat(accountInfoAfterTokenAssociation.tokenRelationships.size()).isEqualTo(1); - assertThat(accountInfoAfterTokenAssociation.tokenRelationships.get(tokenId1).automaticAssociation).isTrue(); + var accountInfoAfterTokenAssociation = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); + assertThat(accountInfoAfterTokenAssociation.tokenRelationships.size()) + .isEqualTo(1); + assertThat(accountInfoAfterTokenAssociation.tokenRelationships.get(tokenId1).automaticAssociation) + .isTrue(); + + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TransferTransaction() + .addTokenTransfer(tokenId2, testEnv.operatorId, -1) + .addTokenTransfer(tokenId2, receiverAccountId, 1) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("NO_REMAINING_AUTOMATIC_ASSOCIATIONS"); - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TransferTransaction() - .addTokenTransfer(tokenId2, testEnv.operatorId, -1) - .addTokenTransfer(tokenId2, receiverAccountId, 1) + new AccountUpdateTransaction() + .setAccountId(receiverAccountId) + .setMaxAutomaticTokenAssociations(2) + .freezeWith(testEnv.client) + .sign(accountKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("NO_REMAINING_AUTOMATIC_ASSOCIATIONS"); - new AccountUpdateTransaction() - .setAccountId(receiverAccountId) - .setMaxAutomaticTokenAssociations(2) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var accountInfoAfterMaxAssocUpdate = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); - assertThat(accountInfoAfterMaxAssocUpdate.maxAutomaticTokenAssociations).isEqualTo(2); + var accountInfoAfterMaxAssocUpdate = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); + assertThat(accountInfoAfterMaxAssocUpdate.maxAutomaticTokenAssociations) + .isEqualTo(2); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can transfer Nfts to accounts with Limited Max Auto Associations") void canTransferNftsToAccountsWithLimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createNft(testEnv); var tokenId2 = EntityHelper.createNft(testEnv); var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 1; - var receiverAccountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); + var receiverAccountId = + EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); var mintReceiptToken1 = new TokenMintTransaction() - .setTokenId(tokenId1) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var mintReceiptToken2 = new TokenMintTransaction() - .setTokenId(tokenId2) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var accountInfoBeforeTokenAssociation = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); - assertThat(accountInfoBeforeTokenAssociation.maxAutomaticTokenAssociations).isEqualTo(1); - assertThat(accountInfoBeforeTokenAssociation.tokenRelationships.size()).isEqualTo(0); + .setTokenId(tokenId2) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); + var accountInfoBeforeTokenAssociation = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); + assertThat(accountInfoBeforeTokenAssociation.maxAutomaticTokenAssociations) + .isEqualTo(1); + assertThat(accountInfoBeforeTokenAssociation.tokenRelationships.size()) + .isEqualTo(0); var serialsToTransfer = new ArrayList<>(mintReceiptToken2.serials); var nftTransferTransaction = new TransferTransaction(); for (var serial : serialsToTransfer) { nftTransferTransaction.addNftTransfer(tokenId1.nft(serial), testEnv.operatorId, receiverAccountId); } - var transferRecord = nftTransferTransaction - .execute(testEnv.client) - .getRecord(testEnv.client); + var transferRecord = nftTransferTransaction.execute(testEnv.client).getRecord(testEnv.client); assertThat(transferRecord.automaticTokenAssociations.size()).isEqualTo(1); - assertThat(transferRecord.automaticTokenAssociations.get(0).accountId).isEqualTo(receiverAccountId); + assertThat(transferRecord.automaticTokenAssociations.get(0).accountId) + .isEqualTo(receiverAccountId); assertThat(transferRecord.automaticTokenAssociations.get(0).tokenId).isEqualTo(tokenId1); - var accountInfoAfterTokenAssociation = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); - assertThat(accountInfoAfterTokenAssociation.tokenRelationships.size()).isEqualTo(1); - assertThat(accountInfoAfterTokenAssociation.tokenRelationships.get(tokenId1).automaticAssociation).isTrue(); + var accountInfoAfterTokenAssociation = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); + assertThat(accountInfoAfterTokenAssociation.tokenRelationships.size()) + .isEqualTo(1); + assertThat(accountInfoAfterTokenAssociation.tokenRelationships.get(tokenId1).automaticAssociation) + .isTrue(); + + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + var serial = mintReceiptToken2.serials.get(0); + new TransferTransaction() + .addNftTransfer(tokenId2.nft(serial), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("NO_REMAINING_AUTOMATIC_ASSOCIATIONS"); - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - var serial = mintReceiptToken2.serials.get(0); - new TransferTransaction() - .addNftTransfer(tokenId2.nft(serial), testEnv.operatorId, receiverAccountId) + new AccountUpdateTransaction() + .setAccountId(receiverAccountId) + .setMaxAutomaticTokenAssociations(2) + .freezeWith(testEnv.client) + .sign(accountKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("NO_REMAINING_AUTOMATIC_ASSOCIATIONS"); - new AccountUpdateTransaction() - .setAccountId(receiverAccountId) - .setMaxAutomaticTokenAssociations(2) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var accountInfoAfterMaxAssocUpdate = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); - assertThat(accountInfoAfterMaxAssocUpdate.maxAutomaticTokenAssociations).isEqualTo(2); + var accountInfoAfterMaxAssocUpdate = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); + assertThat(accountInfoAfterMaxAssocUpdate.maxAutomaticTokenAssociations) + .isEqualTo(2); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -193,24 +181,23 @@ void canTransferNftsToAccountsWithLimitedMaxAutoAssociations() throws Exception @Test @DisplayName("Can set unlimited max auto associations for Account") void canSetUnlimitedMaxAutoAssociationsForAccount() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = -1; var accountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); new AccountUpdateTransaction() - .setAccountId(accountId) - .setMaxAutomaticTokenAssociations(accountMaxAutomaticTokenAssociations) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var accountInfoBeforeTokenAssociation = new AccountInfoQuery() - .setAccountId(accountId) - .execute(testEnv.client); - assertThat(accountInfoBeforeTokenAssociation.maxAutomaticTokenAssociations).isEqualTo(-1); + .setAccountId(accountId) + .setMaxAutomaticTokenAssociations(accountMaxAutomaticTokenAssociations) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + var accountInfoBeforeTokenAssociation = + new AccountInfoQuery().setAccountId(accountId).execute(testEnv.client); + assertThat(accountInfoBeforeTokenAssociation.maxAutomaticTokenAssociations) + .isEqualTo(-1); } } @@ -221,7 +208,7 @@ void canSetUnlimitedMaxAutoAssociationsForAccount() throws Exception { @Test @DisplayName("Can transfer Fungible Tokens to accounts with Unlimited Max Auto Associations") void canTransferFungibleTokensToAccountsWithUnlimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createFungibleToken(testEnv, 3); var tokenId2 = EntityHelper.createFungibleToken(testEnv, 3); var accountKey = PrivateKey.generateED25519(); @@ -229,56 +216,53 @@ void canTransferFungibleTokensToAccountsWithUnlimitedMaxAutoAssociations() throw var accountId2 = EntityHelper.createAccount(testEnv, accountKey, 100); new AccountUpdateTransaction() - .setAccountId(accountId2) - .setMaxAutomaticTokenAssociations(-1) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId2) + .setMaxAutomaticTokenAssociations(-1) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer to both receivers some token1 tokens new TransferTransaction() - .addTokenTransfer(tokenId1, testEnv.operatorId, -1000) - .addTokenTransfer(tokenId1, accountId1, 1000) - .addTokenTransfer(tokenId1, testEnv.operatorId, -1000) - .addTokenTransfer(tokenId1, accountId2, 1000) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenId1, testEnv.operatorId, -1000) + .addTokenTransfer(tokenId1, accountId1, 1000) + .addTokenTransfer(tokenId1, testEnv.operatorId, -1000) + .addTokenTransfer(tokenId1, accountId2, 1000) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer to both receivers some token2 tokens new TransferTransaction() - .addTokenTransfer(tokenId2, testEnv.operatorId, -1000) - .addTokenTransfer(tokenId2, accountId1, 1000) - .addTokenTransfer(tokenId2, testEnv.operatorId, -1000) - .addTokenTransfer(tokenId2, accountId2, 1000) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenId2, testEnv.operatorId, -1000) + .addTokenTransfer(tokenId2, accountId1, 1000) + .addTokenTransfer(tokenId2, testEnv.operatorId, -1000) + .addTokenTransfer(tokenId2, accountId2, 1000) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance of the receivers is 1000 - var accountId1Balance = new AccountBalanceQuery() - .setAccountId(accountId1) - .execute(testEnv.client); + var accountId1Balance = + new AccountBalanceQuery().setAccountId(accountId1).execute(testEnv.client); assertThat(accountId1Balance.tokens.get(tokenId1)).isEqualTo(1000); assertThat(accountId1Balance.tokens.get(tokenId2)).isEqualTo(1000); - var accountId2Balance = new AccountBalanceQuery() - .setAccountId(accountId2) - .execute(testEnv.client); + var accountId2Balance = + new AccountBalanceQuery().setAccountId(accountId2).execute(testEnv.client); assertThat(accountId2Balance.tokens.get(tokenId1)).isEqualTo(1000); assertThat(accountId2Balance.tokens.get(tokenId2)).isEqualTo(1000); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -289,7 +273,7 @@ void canTransferFungibleTokensToAccountsWithUnlimitedMaxAutoAssociations() throw @Test @DisplayName("Can transfer Fungible Tokens (With Decimals) to accounts with Unlimited Max Auto Associations") void canTransferFungibleTokensWithDecimalsToAccountsWithUnlimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenDecimals = 10; var tokenId1 = EntityHelper.createFungibleToken(testEnv, tokenDecimals); var tokenId2 = EntityHelper.createFungibleToken(testEnv, tokenDecimals); @@ -297,30 +281,28 @@ void canTransferFungibleTokensWithDecimalsToAccountsWithUnlimitedMaxAutoAssociat var receiverAccountId = EntityHelper.createAccount(testEnv, accountKey, -1); new TransferTransaction() - .addTokenTransferWithDecimals(tokenId1, testEnv.operatorId, -1000, tokenDecimals) - .addTokenTransferWithDecimals(tokenId1, receiverAccountId, 1000, tokenDecimals) - .addTokenTransferWithDecimals(tokenId2, testEnv.operatorId, -1000, tokenDecimals) - .addTokenTransferWithDecimals(tokenId2, receiverAccountId, 1000, tokenDecimals) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransferWithDecimals(tokenId1, testEnv.operatorId, -1000, tokenDecimals) + .addTokenTransferWithDecimals(tokenId1, receiverAccountId, 1000, tokenDecimals) + .addTokenTransferWithDecimals(tokenId2, testEnv.operatorId, -1000, tokenDecimals) + .addTokenTransferWithDecimals(tokenId2, receiverAccountId, 1000, tokenDecimals) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(receiverAccountBalance.tokens.get(tokenId1)).isEqualTo(1000); assertThat(receiverAccountBalance.tokens.get(tokenId2)).isEqualTo(1000); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -331,7 +313,7 @@ void canTransferFungibleTokensWithDecimalsToAccountsWithUnlimitedMaxAutoAssociat @Test @DisplayName("Can transfer Fungible Tokens on Behalf Of Owner to account with Unlimited Max Auto Associations") void canTransferFungibleTokensOnBehalfOfOwnerToAccountWithUnlimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createFungibleToken(testEnv, 3); var tokenId2 = EntityHelper.createFungibleToken(testEnv, 3); var accountKey = PrivateKey.generateED25519(); @@ -340,39 +322,37 @@ void canTransferFungibleTokensOnBehalfOfOwnerToAccountWithUnlimitedMaxAutoAssoci var spenderAccountId = EntityHelper.createAccount(testEnv, spenderAccountKey, -1); new AccountAllowanceApproveTransaction() - .approveTokenAllowance(tokenId1, testEnv.operatorId, spenderAccountId, 2000) - .approveTokenAllowance(tokenId2, testEnv.operatorId, spenderAccountId, 2000) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveTokenAllowance(tokenId1, testEnv.operatorId, spenderAccountId, 2000) + .approveTokenAllowance(tokenId2, testEnv.operatorId, spenderAccountId, 2000) + .execute(testEnv.client) + .getReceipt(testEnv.client); var record = new TransferTransaction() - .addApprovedTokenTransfer(tokenId1, testEnv.operatorId, -1000) - .addTokenTransfer(tokenId1, accountId, 1000) - .addApprovedTokenTransfer(tokenId2, testEnv.operatorId, -1000) - .addTokenTransfer(tokenId2, accountId, 1000) - .setTransactionId(TransactionId.generate(spenderAccountId)) - .freezeWith(testEnv.client) - .sign(spenderAccountKey) - .execute(testEnv.client) - .getRecord(testEnv.client); - - var accountBalance = new AccountBalanceQuery() - .setAccountId(accountId) - .execute(testEnv.client); + .addApprovedTokenTransfer(tokenId1, testEnv.operatorId, -1000) + .addTokenTransfer(tokenId1, accountId, 1000) + .addApprovedTokenTransfer(tokenId2, testEnv.operatorId, -1000) + .addTokenTransfer(tokenId2, accountId, 1000) + .setTransactionId(TransactionId.generate(spenderAccountId)) + .freezeWith(testEnv.client) + .sign(spenderAccountKey) + .execute(testEnv.client) + .getRecord(testEnv.client); + + var accountBalance = + new AccountBalanceQuery().setAccountId(accountId).execute(testEnv.client); assertThat(accountBalance.tokens.get(tokenId1)).isEqualTo(1000); assertThat(accountBalance.tokens.get(tokenId2)).isEqualTo(1000); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -383,7 +363,7 @@ var record = new TransferTransaction() @Test @DisplayName("Can transfer Nfts to accounts with Unlimited Max Auto Associations") void canTransferNftsToAccountsWithUnlimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createNft(testEnv); var tokenId2 = EntityHelper.createNft(testEnv); var accountKey = PrivateKey.generateED25519(); @@ -391,70 +371,67 @@ void canTransferNftsToAccountsWithUnlimitedMaxAutoAssociations() throws Exceptio var accountId2 = EntityHelper.createAccount(testEnv, accountKey, 100); var mintReceiptToken1 = new TokenMintTransaction() - .setTokenId(tokenId1) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var mintReceiptToken2 = new TokenMintTransaction() - .setTokenId(tokenId2) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId2) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptToken2.serials; new AccountUpdateTransaction() - .setAccountId(accountId2) - .setMaxAutomaticTokenAssociations(-1) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId2) + .setMaxAutomaticTokenAssociations(-1) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer nft1 to both receivers, 2 for each new TransferTransaction() - .addNftTransfer(tokenId1.nft(nftSerials.get(0)), testEnv.operatorId, accountId1) - .addNftTransfer(tokenId1.nft(nftSerials.get(1)), testEnv.operatorId, accountId1) - .addNftTransfer(tokenId1.nft(nftSerials.get(2)), testEnv.operatorId, accountId2) - .addNftTransfer(tokenId1.nft(nftSerials.get(3)), testEnv.operatorId, accountId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(tokenId1.nft(nftSerials.get(0)), testEnv.operatorId, accountId1) + .addNftTransfer(tokenId1.nft(nftSerials.get(1)), testEnv.operatorId, accountId1) + .addNftTransfer(tokenId1.nft(nftSerials.get(2)), testEnv.operatorId, accountId2) + .addNftTransfer(tokenId1.nft(nftSerials.get(3)), testEnv.operatorId, accountId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer nft2 to both receivers, 2 for each new TransferTransaction() - .addNftTransfer(tokenId2.nft(nftSerials.get(0)), testEnv.operatorId, accountId1) - .addNftTransfer(tokenId2.nft(nftSerials.get(1)), testEnv.operatorId, accountId1) - .addNftTransfer(tokenId2.nft(nftSerials.get(2)), testEnv.operatorId, accountId2) - .addNftTransfer(tokenId2.nft(nftSerials.get(3)), testEnv.operatorId, accountId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(tokenId2.nft(nftSerials.get(0)), testEnv.operatorId, accountId1) + .addNftTransfer(tokenId2.nft(nftSerials.get(1)), testEnv.operatorId, accountId1) + .addNftTransfer(tokenId2.nft(nftSerials.get(2)), testEnv.operatorId, accountId2) + .addNftTransfer(tokenId2.nft(nftSerials.get(3)), testEnv.operatorId, accountId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance of the receivers is 2 - var accountId1Balance = new AccountBalanceQuery() - .setAccountId(accountId1) - .execute(testEnv.client); + var accountId1Balance = + new AccountBalanceQuery().setAccountId(accountId1).execute(testEnv.client); assertThat(accountId1Balance.tokens.get(tokenId1)).isEqualTo(2); assertThat(accountId1Balance.tokens.get(tokenId2)).isEqualTo(2); - var accountId2Balance = new AccountBalanceQuery() - .setAccountId(accountId2) - .execute(testEnv.client); + var accountId2Balance = + new AccountBalanceQuery().setAccountId(accountId2).execute(testEnv.client); assertThat(accountId2Balance.tokens.get(tokenId1)).isEqualTo(2); assertThat(accountId2Balance.tokens.get(tokenId2)).isEqualTo(2); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -465,7 +442,7 @@ void canTransferNftsToAccountsWithUnlimitedMaxAutoAssociations() throws Exceptio @Test @DisplayName("Can transfer Nfts on Behalf Of Owner to account with Unlimited Max Auto Associations") void canTransferNftsOnBehalfOfOwnerToAccountWithUnlimitedMaxAutoAssociations() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createNft(testEnv); var tokenId2 = EntityHelper.createNft(testEnv); var accountKey = PrivateKey.generateED25519(); @@ -474,53 +451,51 @@ void canTransferNftsOnBehalfOfOwnerToAccountWithUnlimitedMaxAutoAssociations() t var spenderAccountId = EntityHelper.createAccount(testEnv, spenderAccountKey, -1); var mintReceiptToken1 = new TokenMintTransaction() - .setTokenId(tokenId1) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var mintReceiptToken2 = new TokenMintTransaction() - .setTokenId(tokenId2) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId2) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptToken2.serials; new AccountAllowanceApproveTransaction() - .approveTokenNftAllowanceAllSerials(tokenId1, testEnv.operatorId, spenderAccountId) - .approveTokenNftAllowanceAllSerials(tokenId2, testEnv.operatorId, spenderAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveTokenNftAllowanceAllSerials(tokenId1, testEnv.operatorId, spenderAccountId) + .approveTokenNftAllowanceAllSerials(tokenId2, testEnv.operatorId, spenderAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addApprovedNftTransfer(tokenId1.nft(nftSerials.get(0)), testEnv.operatorId, accountId) - .addApprovedNftTransfer(tokenId1.nft(nftSerials.get(1)), testEnv.operatorId, accountId) - .addApprovedNftTransfer(tokenId2.nft(nftSerials.get(0)), testEnv.operatorId, accountId) - .addApprovedNftTransfer(tokenId2.nft(nftSerials.get(1)), testEnv.operatorId, accountId) - .setTransactionId(TransactionId.generate(spenderAccountId)) - .freezeWith(testEnv.client) - .sign(spenderAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var accountBalance = new AccountBalanceQuery() - .setAccountId(accountId) - .execute(testEnv.client); + .addApprovedNftTransfer(tokenId1.nft(nftSerials.get(0)), testEnv.operatorId, accountId) + .addApprovedNftTransfer(tokenId1.nft(nftSerials.get(1)), testEnv.operatorId, accountId) + .addApprovedNftTransfer(tokenId2.nft(nftSerials.get(0)), testEnv.operatorId, accountId) + .addApprovedNftTransfer(tokenId2.nft(nftSerials.get(1)), testEnv.operatorId, accountId) + .setTransactionId(TransactionId.generate(spenderAccountId)) + .freezeWith(testEnv.client) + .sign(spenderAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var accountBalance = + new AccountBalanceQuery().setAccountId(accountId).execute(testEnv.client); assertThat(accountBalance.tokens.get(tokenId1)).isEqualTo(2); assertThat(accountBalance.tokens.get(tokenId2)).isEqualTo(2); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -531,44 +506,52 @@ void canTransferNftsOnBehalfOfOwnerToAccountWithUnlimitedMaxAutoAssociations() t @Test @DisplayName("Cannot Set Invalid Max Auto Associations Values") void cannotSetInvalidMaxAutoAssociationsValues() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var accountKey = PrivateKey.generateED25519(); - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new AccountCreateTransaction() - .setKey(accountKey) - .setMaxAutomaticTokenAssociations(-2) - .execute(testEnv.client); - }).withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); - - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new AccountCreateTransaction() - .setKey(accountKey) - .setMaxAutomaticTokenAssociations(-1000) - .execute(testEnv.client); - }).withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new AccountCreateTransaction() + .setKey(accountKey) + .setMaxAutomaticTokenAssociations(-2) + .execute(testEnv.client); + }) + .withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); + + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new AccountCreateTransaction() + .setKey(accountKey) + .setMaxAutomaticTokenAssociations(-1000) + .execute(testEnv.client); + }) + .withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); var accountId = EntityHelper.createAccount(testEnv, accountKey, 100); - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new AccountUpdateTransaction() - .setAccountId(accountId) - .setMaxAutomaticTokenAssociations(-2) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); - - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new AccountUpdateTransaction() - .setAccountId(accountId) - .setMaxAutomaticTokenAssociations(-1000) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new AccountUpdateTransaction() + .setAccountId(accountId) + .setMaxAutomaticTokenAssociations(-2) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); + + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new AccountUpdateTransaction() + .setAccountId(accountId) + .setMaxAutomaticTokenAssociations(-1000) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("INVALID_MAX_AUTO_ASSOCIATIONS"); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java index 3e0118cb32..115af37269 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -31,45 +16,40 @@ import com.hiero.sdk.TokenMintTransaction; import com.hiero.sdk.TokenType; import com.hiero.sdk.TransferTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenBurnIntegrationTest { @Test @DisplayName("Can burn tokens") void canBurnTokens() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); var receipt = new TokenBurnTransaction() - .setAmount(10) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAmount(10) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.totalSupply).isEqualTo(1000000 - 10); - } } @@ -78,173 +58,174 @@ void canBurnTokens() throws Exception { void cannotBurnTokensWhenTokenIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenBurnTransaction() - .setAmount(10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenBurnTransaction() + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Can burn tokens when amount is not set") void canBurnTokensWhenAmountIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); var receipt = new TokenBurnTransaction() - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); - } } @Test @DisplayName("Cannot burn tokens when supply key does not sign transaction") void cannotBurnTokensWhenSupplyKeyDoesNotSignTransaction() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(PrivateKey.generate()) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(PrivateKey.generate()) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenBurnTransaction() - .setTokenId(tokenId) - .setAmount(10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenBurnTransaction() + .setTokenId(tokenId) + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @Test @DisplayName("Can burn NFTs") void canBurnNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenBurnTransaction() - .setSerials(mintReceipt.serials.subList(0, 4)) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setSerials(mintReceipt.serials.subList(0, 4)) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot burn NFTs when NFT is not owned by treasury") void cannotBurnNftsWhenNftIsNotOwned() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); var serials = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 1)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .serials; + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 1)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .serials; var key = PrivateKey.generateED25519(); var accountId = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .signWithOperator(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .signWithOperator(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addNftTransfer(tokenId.nft(serials.get(0)), testEnv.operatorId, accountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenBurnTransaction() - .setSerials(serials) - .setTokenId(tokenId) + .addNftTransfer(tokenId.nft(serials.get(0)), testEnv.operatorId, accountId) .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TREASURY_MUST_OWN_BURNED_NFT.toString()); + .getReceipt(testEnv.client); + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenBurnTransaction() + .setSerials(serials) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TREASURY_MUST_OWN_BURNED_NFT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java index ec802549f7..6cec9ec68b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -44,9 +26,7 @@ class TokenCreateIntegrationTest { private static List createFixedFeeList(int count, AccountId feeCollector) { var feeList = new ArrayList(); for (int i = 0; i < count; i++) { - feeList.add(new CustomFixedFee() - .setAmount(10) - .setFeeCollectorAccountId(feeCollector)); + feeList.add(new CustomFixedFee().setAmount(10).setFeeCollectorAccountId(feeCollector)); } return feeList; } @@ -55,11 +35,11 @@ private static List createFractionalFeeList(int count, AccountId feeC var feeList = new ArrayList(); for (int i = 0; i < count; i++) { feeList.add(new CustomFractionalFee() - .setNumerator(1) - .setDenominator(20) - .setMin(1) - .setMax(10) - .setFeeCollectorAccountId(feeCollector)); + .setNumerator(1) + .setDenominator(20) + .setMin(1) + .setMax(10) + .setFeeCollectorAccountId(feeCollector)); } return feeList; } @@ -67,27 +47,26 @@ private static List createFractionalFeeList(int count, AccountId feeC @Test @DisplayName("Can create token with operator as all keys") void canCreateTokenWithOperatorAsAllKeys() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFeeScheduleKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFeeScheduleKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); Objects.requireNonNull(response.getReceipt(testEnv.client)); - } } @@ -98,12 +77,11 @@ void canCreateTokenWithMinimalPropertiesSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -112,15 +90,15 @@ void canCreateTokenWithMinimalPropertiesSet() throws Exception { void cannotCreateTokenWhenTokenNameIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - }).withMessageContaining(Status.MISSING_TOKEN_NAME.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.MISSING_TOKEN_NAME.toString()); } } @@ -129,15 +107,15 @@ void cannotCreateTokenWhenTokenNameIsNotSet() throws Exception { void cannotCreateTokenWhenTokenSymbolIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTreasuryAccountId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - }).withMessageContaining(Status.MISSING_TOKEN_SYMBOL.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTreasuryAccountId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.MISSING_TOKEN_SYMBOL.toString()); } } @@ -146,15 +124,15 @@ void cannotCreateTokenWhenTokenSymbolIsNotSet() throws Exception { void cannotCreateTokenWhenTokenTreasuryAccountIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .execute(testEnv.client) - .getReceipt(testEnv.client); - - }).withMessageContaining(Status.INVALID_TREASURY_ACCOUNT_FOR_TOKEN.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TREASURY_ACCOUNT_FOR_TOKEN.toString()); } } @@ -163,16 +141,16 @@ void cannotCreateTokenWhenTokenTreasuryAccountIDIsNotSet() throws Exception { void cannotCreateTokenWhenTokenTreasuryAccountIDDoesNotSignTransaction() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(AccountId.fromString("0.0.3")) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(AccountId.fromString("0.0.3")) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -183,45 +161,42 @@ void cannotCreateTokenWhenAdminKeyDoesNotSignTransaction() throws Exception { var key = PrivateKey.generateED25519(); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @Test @DisplayName("Can create token with custom fees") void canCreateTokenWithCustomFees() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var customFees = new ArrayList(); - customFees.add(new CustomFixedFee() - .setAmount(10) - .setFeeCollectorAccountId(testEnv.operatorId) - ); + customFees.add(new CustomFixedFee().setAmount(10).setFeeCollectorAccountId(testEnv.operatorId)); customFees.add(new CustomFractionalFee() - .setNumerator(1) - .setDenominator(20) - .setMin(1) - .setMax(10) - .setFeeCollectorAccountId(testEnv.operatorId) - ); + .setNumerator(1) + .setDenominator(20) + .setMin(1) + .setMax(10) + .setFeeCollectorAccountId(testEnv.operatorId)); new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setCustomFees(customFees) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setCustomFees(customFees) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -230,51 +205,50 @@ void canCreateTokenWithCustomFees() throws Exception { void cannotCreateMoreThanTenCustomFees() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setAdminKey(testEnv.operatorKey) - .setTreasuryAccountId(testEnv.operatorId) - .setCustomFees(createFixedFeeList(11, testEnv.operatorId)) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.CUSTOM_FEES_LIST_TOO_LONG.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setAdminKey(testEnv.operatorKey) + .setTreasuryAccountId(testEnv.operatorId) + .setCustomFees(createFixedFeeList(11, testEnv.operatorId)) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.CUSTOM_FEES_LIST_TOO_LONG.toString()); } } @Test @DisplayName("Can create custom fee list with 10 fixed fees") void canCreateTenFixedFees() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setCustomFees(createFixedFeeList(10, testEnv.operatorId)) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setCustomFees(createFixedFeeList(10, testEnv.operatorId)) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can create custom fee list with 10 fractional fees") void canCreateTenFractionalFees() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setAdminKey(testEnv.operatorKey) - .setTreasuryAccountId(testEnv.operatorId) - .setCustomFees(createFractionalFeeList(10, testEnv.operatorId)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setAdminKey(testEnv.operatorKey) + .setTreasuryAccountId(testEnv.operatorId) + .setCustomFees(createFractionalFeeList(10, testEnv.operatorId)) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -283,22 +257,23 @@ void canCreateTenFractionalFees() throws Exception { void cannotCreateMinGreaterThanMax() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setCustomFees(Collections.singletonList(new CustomFractionalFee() - .setNumerator(1) - .setDenominator(3) - .setMin(3) - .setMax(2) - .setFeeCollectorAccountId(testEnv.operatorId))) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setCustomFees(Collections.singletonList(new CustomFractionalFee() + .setNumerator(1) + .setDenominator(3) + .setMin(3) + .setMax(2) + .setFeeCollectorAccountId(testEnv.operatorId))) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT.toString()); } } @@ -307,18 +282,18 @@ void cannotCreateMinGreaterThanMax() throws Exception { void cannotCreateInvalidFeeCollector() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setAdminKey(testEnv.operatorKey) - .setTreasuryAccountId(testEnv.operatorId) - .setCustomFees(Collections.singletonList(new CustomFixedFee() - .setAmount(1))) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_CUSTOM_FEE_COLLECTOR.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setAdminKey(testEnv.operatorKey) + .setTreasuryAccountId(testEnv.operatorId) + .setCustomFees(Collections.singletonList(new CustomFixedFee().setAmount(1))) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CUSTOM_FEE_COLLECTOR.toString()); } } @@ -327,19 +302,20 @@ void cannotCreateInvalidFeeCollector() throws Exception { void cannotCreateNegativeFee() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setAdminKey(testEnv.operatorKey) - .setTreasuryAccountId(testEnv.operatorId) - .setCustomFees(Collections.singletonList(new CustomFixedFee() - .setAmount(-1) - .setFeeCollectorAccountId(testEnv.operatorId))) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.CUSTOM_FEE_MUST_BE_POSITIVE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setAdminKey(testEnv.operatorKey) + .setTreasuryAccountId(testEnv.operatorId) + .setCustomFees(Collections.singletonList(new CustomFixedFee() + .setAmount(-1) + .setFeeCollectorAccountId(testEnv.operatorId))) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.CUSTOM_FEE_MUST_BE_POSITIVE.toString()); } } @@ -348,68 +324,67 @@ void cannotCreateNegativeFee() throws Exception { void cannotCreateZeroDenominator() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setCustomFees(Collections.singletonList(new CustomFractionalFee() - .setNumerator(1) - .setDenominator(0) - .setMin(1) - .setMax(10) - .setFeeCollectorAccountId(testEnv.operatorId))) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.FRACTION_DIVIDES_BY_ZERO.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setCustomFees(Collections.singletonList(new CustomFractionalFee() + .setNumerator(1) + .setDenominator(0) + .setMin(1) + .setMax(10) + .setFeeCollectorAccountId(testEnv.operatorId))) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.FRACTION_DIVIDES_BY_ZERO.toString()); } } @Test @DisplayName("Can create NFT") void canCreateNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - } } @Test @DisplayName("Can create NFT with royalty fee") void canCreateRoyaltyFee() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setSupplyKey(testEnv.operatorKey) - .setAdminKey(testEnv.operatorKey) - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setCustomFees(Collections.singletonList(new CustomRoyaltyFee() - .setNumerator(1) - .setDenominator(10) - .setFallbackFee(new CustomFixedFee().setHbarAmount(new Hbar(1))) - .setFeeCollectorAccountId(testEnv.operatorId))) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setSupplyKey(testEnv.operatorKey) + .setAdminKey(testEnv.operatorKey) + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setCustomFees(Collections.singletonList(new CustomRoyaltyFee() + .setNumerator(1) + .setDenominator(10) + .setFallbackFee(new CustomFixedFee().setHbarAmount(new Hbar(1))) + .setFeeCollectorAccountId(testEnv.operatorId))) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java index 5244bcb652..6b1e2438b1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java @@ -1,37 +1,18 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.PrivateKey; import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenDeleteTransaction; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class TokenDeleteIntegrationTest { @Test @DisplayName("Can delete token") @@ -39,43 +20,41 @@ void canDeleteToken() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); new TokenDeleteTransaction() - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can delete token with only admin key set") void canDeleteTokenWithOnlyAdminKeySet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .execute(testEnv.client); Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - } } @@ -87,30 +66,31 @@ void cannotDeleteTokenWhenAdminKeyDoesNotSignTransaction() throws Exception { var key = PrivateKey.generateED25519(); var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(key) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(key) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenDeleteTransaction() + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenDeleteTransaction() + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + new TokenDeleteTransaction() .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - new TokenDeleteTransaction() - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - } } @@ -119,12 +99,11 @@ void cannotDeleteTokenWhenAdminKeyDoesNotSignTransaction() throws Exception { void cannotDeleteTokenWhenTokenIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenDeleteTransaction() - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenDeleteTransaction().execute(testEnv.client).getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java index d02acb3ab9..6cfb2c0792 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -28,31 +12,27 @@ import com.hiero.sdk.TokenAssociateTransaction; import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenDissociateTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenDissociateIntegrationTest { @Test @DisplayName("Can dissociate account with token") void canAssociateAccountWithToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -66,93 +46,90 @@ void canAssociateAccountWithToken() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDissociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute token dissociate transaction even when token IDs are not set") void canExecuteTokenDissociateTransactionEvenWhenTokenIDsAreNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); new TokenDissociateTransaction() - .setAccountId(accountId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot dissociate account with tokens when account ID is not set") void cannotDissociateAccountWithTokensWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenDissociateTransaction() - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenDissociateTransaction() + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot dissociate account with tokens when account does not sign transaction") void cannotDissociateAccountWhenAccountDoesNotSignTransaction() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -166,36 +143,35 @@ void cannotDissociateAccountWhenAccountDoesNotSignTransaction() throws Exception .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenDissociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenDissociateTransaction() + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @Test @DisplayName("Cannot dissociate account from token when account was not associated with") void cannotDissociateAccountFromTokenWhenAccountWasNotAssociatedWith() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -209,19 +185,19 @@ void cannotDissociateAccountFromTokenWhenAccountWasNotAssociatedWith() throws Ex .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenDissociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenDissociateTransaction() + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java index 910f9fccad..e5b9604eb7 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.CustomFee; import com.hiero.sdk.CustomFixedFee; import com.hiero.sdk.CustomFractionalFee; @@ -28,42 +13,35 @@ import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; import com.hiero.sdk.TokenInfoQuery; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.ArrayList; import java.util.Objects; - -import static org.assertj.core.api.Assertions.as; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenFeeScheduleUpdateIntegrationTest { @Test @DisplayName("Can update token fees") void canUpdateToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFeeScheduleKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFeeScheduleKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("ffff"); @@ -88,27 +66,21 @@ void canUpdateToken() throws Exception { assertThat(info.customFees.size()).isEqualTo(0); var customFees = new ArrayList(); - customFees.add(new CustomFixedFee() - .setAmount(10) - .setFeeCollectorAccountId(testEnv.operatorId) - ); + customFees.add(new CustomFixedFee().setAmount(10).setFeeCollectorAccountId(testEnv.operatorId)); customFees.add(new CustomFractionalFee() - .setNumerator(1) - .setDenominator(20) - .setMin(1) - .setMax(10) - .setFeeCollectorAccountId(testEnv.operatorId) - ); + .setNumerator(1) + .setDenominator(20) + .setMin(1) + .setMax(10) + .setFeeCollectorAccountId(testEnv.operatorId)); new TokenFeeScheduleUpdateTransaction() - .setTokenId(tokenId) - .setCustomFees(customFees) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setCustomFees(customFees) + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("ffff"); @@ -134,67 +106,63 @@ void canUpdateToken() throws Exception { var fees = info.customFees; assertThat(fees.size()).isEqualTo(2); int fixedCount = 0; - int fractionalCount = 0; - for (var fee : fees) { - if (fee instanceof CustomFixedFee) { - fixedCount++; - var fixed = (CustomFixedFee) fee; - assertThat(fixed.getAmount()).isEqualTo(10); - assertThat(fixed.getFeeCollectorAccountId()).isEqualTo(testEnv.operatorId); - assertThat(fixed.getDenominatingTokenId()).isNull(); - } else if (fee instanceof CustomFractionalFee) { - fractionalCount++; - var fractional = (CustomFractionalFee) fee; - assertThat(fractional.getNumerator()).isEqualTo(1); - assertThat(fractional.getDenominator()).isEqualTo(20); - assertThat(fractional.getMin()).isEqualTo(1); - assertThat(fractional.getMax()).isEqualTo(10); - assertThat(fractional.getFeeCollectorAccountId()).isEqualTo(testEnv.operatorId); + int fractionalCount = 0; + for (var fee : fees) { + if (fee instanceof CustomFixedFee) { + fixedCount++; + var fixed = (CustomFixedFee) fee; + assertThat(fixed.getAmount()).isEqualTo(10); + assertThat(fixed.getFeeCollectorAccountId()).isEqualTo(testEnv.operatorId); + assertThat(fixed.getDenominatingTokenId()).isNull(); + } else if (fee instanceof CustomFractionalFee) { + fractionalCount++; + var fractional = (CustomFractionalFee) fee; + assertThat(fractional.getNumerator()).isEqualTo(1); + assertThat(fractional.getDenominator()).isEqualTo(20); + assertThat(fractional.getMin()).isEqualTo(1); + assertThat(fractional.getMax()).isEqualTo(10); + assertThat(fractional.getFeeCollectorAccountId()).isEqualTo(testEnv.operatorId); + } } - } - assertThat(fixedCount).isEqualTo(1); - assertThat(fractionalCount).isEqualTo(1); - + assertThat(fixedCount).isEqualTo(1); + assertThat(fractionalCount).isEqualTo(1); } } @Test @DisplayName("Cannot update fee schedule with any key other than fee schedule key") void cannotUpdateWithAnyOtherKey() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFeeScheduleKey(PrivateKey.generate()) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFeeScheduleKey(PrivateKey.generate()) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); var customFees = new ArrayList(); - customFees.add(new CustomFixedFee() - .setAmount(10) - .setFeeCollectorAccountId(testEnv.operatorId) - ); + customFees.add(new CustomFixedFee().setAmount(10).setFeeCollectorAccountId(testEnv.operatorId)); customFees.add(new CustomFractionalFee() - .setNumerator(1) - .setDenominator(20) - .setMin(1) - .setMax(10) - .setFeeCollectorAccountId(testEnv.operatorId) - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenFeeScheduleUpdateTransaction() - .setTokenId(tokenId) - .setCustomFees(customFees) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + .setNumerator(1) + .setDenominator(20) + .setMin(1) + .setMax(10) + .setFeeCollectorAccountId(testEnv.operatorId)); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenFeeScheduleUpdateTransaction() + .setTokenId(tokenId) + .setCustomFees(customFees) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java index cffa70da7c..fadd39edcf 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -28,31 +12,27 @@ import com.hiero.sdk.TokenAssociateTransaction; import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenFreezeTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenFreezeIntegrationTest { @Test @DisplayName("Can freeze account with token") void canFreezeAccountWithToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -66,105 +46,104 @@ void canFreezeAccountWithToken() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenFreezeTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot freeze account on token when token ID is not set") void cannotFreezeAccountOnTokenWhenTokenIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenFreezeTransaction() - .setAccountId(accountId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenFreezeTransaction() + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Cannot freeze account on token when account ID is not set") void cannotFreezeAccountOnTokenWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenFreezeTransaction() - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenFreezeTransaction() + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot freeze account on token when account was not associated with") void cannotFreezeAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -178,19 +157,19 @@ void cannotFreezeAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exceptio .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenFreezeTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenFreezeTransaction() + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java index 79cbcfc785..e5f9fec6b9 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -28,31 +12,27 @@ import com.hiero.sdk.TokenAssociateTransaction; import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenGrantKycTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenGrantKycIntegrationTest { @Test @DisplayName("Can grant kyc to account with token") void canGrantKycAccountWithToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -66,105 +46,104 @@ void canGrantKycAccountWithToken() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot grant kyc to account on token when token ID is not set") void cannotGrantKycToAccountOnTokenWhenTokenIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenGrantKycTransaction() - .setAccountId(accountId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenGrantKycTransaction() + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Cannot grant kyc to account on token when account ID is not set") void cannotGrantKycToAccountOnTokenWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenGrantKycTransaction() - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenGrantKycTransaction() + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot grant kyc to account on token when account was not associated with") void cannotGrantKycToAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -178,19 +157,19 @@ void cannotGrantKycToAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exce .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenGrantKycTransaction() + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java index ff1f3f6a1f..4995bba432 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.Hbar; import com.hiero.sdk.MaxQueryPaymentExceededException; import com.hiero.sdk.PrecheckStatusException; @@ -29,14 +14,10 @@ import com.hiero.sdk.TokenMintTransaction; import com.hiero.sdk.TokenSupplyType; import com.hiero.sdk.TokenType; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class TokenInfoIntegrationTest { @Test @@ -53,28 +34,26 @@ void canQueryTokenInfoWhenAllKeysAreDifferent() throws Exception { var key7 = PrivateKey.generateED25519(); var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(key1) - .setFreezeKey(key2) - .setWipeKey(key3) - .setKycKey(key4) - .setSupplyKey(key5) - .setPauseKey(key6) - .setMetadataKey(key7) - .setFreezeDefault(false) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(key1) + .setFreezeKey(key2) + .setWipeKey(key3) + .setKycKey(key4) + .setSupplyKey(key5) + .setPauseKey(key6) + .setMetadataKey(key7) + .setFreezeDefault(false) + .freezeWith(testEnv.client) + .sign(key1) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("ffff"); @@ -94,7 +73,8 @@ void canQueryTokenInfoWhenAllKeysAreDifferent() throws Exception { assertThat(info.kycKey.toString()).isEqualTo(key4.getPublicKey().toString()); assertThat(info.supplyKey.toString()).isEqualTo(key5.getPublicKey().toString()); assertThat(info.pauseKey.toString()).isEqualTo(key6.getPublicKey().toString()); - assertThat(info.metadataKey.toString()).isEqualTo(key7.getPublicKey().toString()); + assertThat(info.metadataKey.toString()) + .isEqualTo(key7.getPublicKey().toString()); assertThat(info.defaultFreezeStatus).isNotNull(); assertThat(info.defaultFreezeStatus).isFalse(); assertThat(info.defaultKycStatus).isNotNull(); @@ -103,12 +83,11 @@ void canQueryTokenInfoWhenAllKeysAreDifferent() throws Exception { assertThat(info.supplyType).isEqualTo(TokenSupplyType.INFINITE); new TokenDeleteTransaction() - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key1) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -118,16 +97,14 @@ void canQueryTokenInfoWhenTokenIsCreatedWithMinimalProperties() throws Exception try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("ffff"); @@ -146,39 +123,36 @@ void canQueryTokenInfoWhenTokenIsCreatedWithMinimalProperties() throws Exception assertThat(info.defaultKycStatus).isNull(); assertThat(info.tokenType).isEqualTo(TokenType.FUNGIBLE_COMMON); assertThat(info.supplyType).isEqualTo(TokenSupplyType.INFINITE); - } } @Test @DisplayName("Can query NFT") void canQueryNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setSupplyType(TokenSupplyType.FINITE) - .setMaxSupply(5000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setSupplyType(TokenSupplyType.FINITE) + .setMaxSupply(5000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(mintReceipt.serials.size()).isEqualTo(10); - var info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("ffff"); @@ -198,106 +172,96 @@ void canQueryNfts() throws Exception { assertThat(info.tokenType).isEqualTo(TokenType.NON_FUNGIBLE_UNIQUE); assertThat(info.supplyType).isEqualTo(TokenSupplyType.FINITE); assertThat(info.maxSupply).isEqualTo(5000); - } } @Test @DisplayName("Get cost of token info query") void getCostQueryTokenInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var infoQuery = new TokenInfoQuery() - .setTokenId(tokenId); + var infoQuery = new TokenInfoQuery().setTokenId(tokenId); var cost = infoQuery.getCost(testEnv.client); infoQuery.setQueryPayment(cost).execute(testEnv.client); - } } @Test @DisplayName("Get cost of token info query, with big max") void getCostBigMaxQueryTokenInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var infoQuery = new TokenInfoQuery() - .setTokenId(tokenId) - .setMaxQueryPayment(new Hbar(1000)); + var infoQuery = new TokenInfoQuery().setTokenId(tokenId).setMaxQueryPayment(new Hbar(1000)); var cost = infoQuery.getCost(testEnv.client); infoQuery.setQueryPayment(cost).execute(testEnv.client); - } } @Test @DisplayName("Can query token info when all keys are different") void getCostSmallMaxTokenInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var infoQuery = new TokenInfoQuery() - .setTokenId(tokenId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var infoQuery = new TokenInfoQuery().setTokenId(tokenId).setMaxQueryPayment(Hbar.fromTinybars(1)); assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { infoQuery.execute(testEnv.client); }); - } } @Test @DisplayName("Throws insufficient transaction fee error") void getCostInsufficientTxFeeQueryTokenInfo() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var infoQuery = new TokenInfoQuery() - .setTokenId(tokenId) - .setMaxQueryPayment(new Hbar(1000)); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + var infoQuery = new TokenInfoQuery().setTokenId(tokenId).setMaxQueryPayment(new Hbar(1000)); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java index aad2da6ef4..75369e9b75 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountBalanceQuery; import com.hiero.sdk.AccountId; import com.hiero.sdk.AccountInfoQuery; @@ -32,220 +17,211 @@ import com.hiero.sdk.TokenMintTransaction; import com.hiero.sdk.TransferTransaction; import java.util.ArrayList; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenManualAssociationIntegrationTest { @Test @DisplayName("Can Manually associate Account with a Fungible Token") void canManuallyAssociateAccountWithFungibleToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenDecimals = 3; var tokenId = EntityHelper.createFungibleToken(testEnv, 3); var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; - var receiverAccountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); + var receiverAccountId = + EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var accountInfo = new AccountInfoQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var accountInfo = + new AccountInfoQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(accountInfo.tokenRelationships.get(tokenId).decimals).isEqualTo(tokenDecimals); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var accountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var accountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(accountBalance.tokens.get(tokenId)).isEqualTo(10); - } } @Test @DisplayName("Can Manually associate Account with Nft") void canManuallyAssociateAccountWithNft() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId = EntityHelper.createNft(testEnv); var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; - var receiverAccountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); + var receiverAccountId = + EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); var mintReceiptToken = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); var serialsToTransfer = new ArrayList<>(mintReceiptToken.serials); var nftTransferTransaction = new TransferTransaction(); for (var serial : serialsToTransfer) { nftTransferTransaction.addNftTransfer(tokenId.nft(serial), testEnv.operatorId, receiverAccountId); } - nftTransferTransaction - .execute(testEnv.client) - .getReceipt(testEnv.client); - + nftTransferTransaction.execute(testEnv.client).getReceipt(testEnv.client); } } @Test @DisplayName("Can Manually associate Contract with a Fungible Token") void canManuallyAssociateContractWithFungibleToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var tokenDecimals = 3; var tokenId = EntityHelper.createFungibleToken(testEnv, 3); var contractId = EntityHelper.createContract(testEnv, testEnv.operatorKey); new TokenAssociateTransaction() - .setAccountId(new AccountId(contractId.num)) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(new AccountId(contractId.num)) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var contractInfo = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var contractInfo = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(contractInfo.contractId).isEqualTo(contractId); assertThat(contractInfo.accountId).isNotNull(); - assertThat(Objects.requireNonNull(contractInfo.accountId).toString()).isEqualTo(Objects.requireNonNull(contractId).toString()); + assertThat(Objects.requireNonNull(contractInfo.accountId).toString()) + .isEqualTo(Objects.requireNonNull(contractId).toString()); assertThat(contractInfo.adminKey).isNotNull(); - assertThat(Objects.requireNonNull(contractInfo.adminKey).toString()).isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); + assertThat(Objects.requireNonNull(contractInfo.adminKey).toString()) + .isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); assertThat(contractInfo.storage).isEqualTo(128); assertThat(contractInfo.contractMemo).isEqualTo("[e2e::ContractMemo]"); assertThat(contractInfo.tokenRelationships.get(tokenId).decimals).isEqualTo(tokenDecimals); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can Manually associate contract with Nft") void canManuallyAssociateContractWithNft() throws Exception { - try(var testEnv = new IntegrationTestEnv(1)){ + try (var testEnv = new IntegrationTestEnv(1)) { var tokenId = EntityHelper.createNft(testEnv); var contractId = EntityHelper.createContract(testEnv, testEnv.operatorKey); new TokenAssociateTransaction() - .setAccountId(new AccountId(contractId.num)) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(new AccountId(contractId.num)) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var contractInfo = new ContractInfoQuery() - .setContractId(contractId) - .execute(testEnv.client); + var contractInfo = new ContractInfoQuery().setContractId(contractId).execute(testEnv.client); assertThat(contractInfo.contractId).isEqualTo(contractId); assertThat(contractInfo.accountId).isNotNull(); - assertThat(Objects.requireNonNull(contractInfo.accountId).toString()).isEqualTo(Objects.requireNonNull(contractId).toString()); + assertThat(Objects.requireNonNull(contractInfo.accountId).toString()) + .isEqualTo(Objects.requireNonNull(contractId).toString()); assertThat(contractInfo.adminKey).isNotNull(); - assertThat(Objects.requireNonNull(contractInfo.adminKey).toString()).isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); + assertThat(Objects.requireNonNull(contractInfo.adminKey).toString()) + .isEqualTo(Objects.requireNonNull(testEnv.operatorKey).toString()); assertThat(contractInfo.storage).isEqualTo(128); assertThat(contractInfo.contractMemo).isEqualTo("[e2e::ContractMemo]"); new ContractDeleteTransaction() - .setTransferAccountId(testEnv.operatorId) - .setContractId(contractId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTransferAccountId(testEnv.operatorId) + .setContractId(contractId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute token associate transaction even when token IDs are not set") void canExecuteTokenAssociateTransactionEvenWhenTokenIDsAreNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; var accountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); new TokenAssociateTransaction() - .setAccountId(accountId) - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot Manually associate Account with a Token when Account ID is not set") void cannotAssociateAccountWithTokensWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; var accountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenAssociateTransaction() - .freezeWith(testEnv.client) - .sign(accountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenAssociateTransaction() + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot Manually Associate Account with a Token when Account Does Not sign transaction") void cannotAssociateAccountWhenAccountDoesNotSignTransaction() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenDecimals = 3; var tokenId = EntityHelper.createFungibleToken(testEnv, tokenDecimals); var accountKey = PrivateKey.generateED25519(); var accountMaxAutomaticTokenAssociations = 0; var accountId = EntityHelper.createAccount(testEnv, accountKey, accountMaxAutomaticTokenAssociations); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenAssociateTransaction() + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java index 21a70f654c..79564f94b2 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -29,22 +14,17 @@ import com.hiero.sdk.TokenMintTransaction; import com.hiero.sdk.TokenSupplyType; import com.hiero.sdk.TokenType; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class TokenMintIntegrationTest { @Test @DisplayName("Can mint tokens") void canMintTokens() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -58,47 +38,44 @@ void canMintTokens() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); var receipt = new TokenMintTransaction() - .setAmount(10) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAmount(10) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.totalSupply).isEqualTo(1000000 + 10); - } } @Test @DisplayName("Cannot mint more tokens than max supply") void cannotMintMoreThanMaxSupply() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setSupplyType(TokenSupplyType.FINITE) - .setMaxSupply(5) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId - ); + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenMintTransaction() - .setTokenId(tokenId) - .setAmount(6) + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setSupplyType(TokenSupplyType.FINITE) + .setMaxSupply(5) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_MAX_SUPPLY_REACHED.toString()); - + .getReceipt(testEnv.client) + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenMintTransaction() + .setTokenId(tokenId) + .setAmount(6) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_MAX_SUPPLY_REACHED.toString()); } } @@ -107,23 +84,23 @@ void cannotMintMoreThanMaxSupply() throws Exception { void cannotMintTokensWhenTokenIDIsNotSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenMintTransaction() - .setAmount(10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenMintTransaction() + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Can mint tokens when amount is not set") void canMintTokensWhenAmountIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -137,35 +114,32 @@ void canMintTokensWhenAmountIsNotSet() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); var receipt = new TokenMintTransaction() - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); - } } @Test @DisplayName("Cannot mint tokens when supply key does not sign transaction") void cannotMintTokensWhenSupplyKeyDoesNotSignTransaction() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -179,27 +153,26 @@ void cannotMintTokensWhenSupplyKeyDoesNotSignTransaction() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenMintTransaction() - .setTokenId(tokenId) - .setAmount(10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenMintTransaction() + .setTokenId(tokenId) + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @Test @DisplayName("Can mint NFTs") void canMintNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -212,27 +185,24 @@ void canMintNfts() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); var receipt = new TokenMintTransaction() - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.serials.size()).isEqualTo(10); - } } @Test @DisplayName("Cannot mint NFTs if metadata too big") void cannotMintNftsIfMetadataTooBig() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -245,17 +215,17 @@ void cannotMintNftsIfMetadataTooBig() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenMintTransaction() - .setMetadata(NftMetadataGenerator.generateOneLarge()) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.METADATA_TOO_LONG.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenMintTransaction() + .setMetadata(NftMetadataGenerator.generateOneLarge()) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.METADATA_TOO_LONG.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java index f0c95625cc..4b4415cb31 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2021 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.NftId; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.Status; @@ -26,141 +11,132 @@ import com.hiero.sdk.TokenMintTransaction; import com.hiero.sdk.TokenNftInfoQuery; import com.hiero.sdk.TokenType; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.ArrayList; import java.util.List; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenNftInfoIntegrationTest { @Test @DisplayName("Can query NFT info by NftId") void canQueryNftInfoByNftId() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); byte[] metadata = {50}; var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .addMetadata(metadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .addMetadata(metadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftId = tokenId.nft(mintReceipt.serials.get(0)); - var nftInfos = new TokenNftInfoQuery() - .setNftId(nftId) - .execute(testEnv.client); + var nftInfos = new TokenNftInfoQuery().setNftId(nftId).execute(testEnv.client); assertThat(nftInfos.size()).isEqualTo(1); assertThat(nftInfos.get(0).nftId).isEqualTo(nftId); assertThat(nftInfos.get(0).accountId).isEqualTo(testEnv.operatorId); assertThat(nftInfos.get(0).metadata[0]).isEqualTo((byte) 50); - } } @Test @DisplayName("Cannot query NFT info by invalid NftId") void cannotQueryNftInfoByInvalidNftId() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); byte[] metadata = {50}; var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .addMetadata(metadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .addMetadata(metadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftId = tokenId.nft(mintReceipt.serials.get(0)); var invalidNftId = new NftId(nftId.tokenId, nftId.serial + 1); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenNftInfoQuery() - .setNftId(invalidNftId) - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_NFT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenNftInfoQuery().setNftId(invalidNftId).execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_NFT_ID.toString()); } } @Test @DisplayName("Cannot query NFT info by invalid NftId Serial Number") void cannotQueryNftInfoByInvalidSerialNumber() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); byte[] metadata = {50}; var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .addMetadata(metadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .addMetadata(metadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftId = tokenId.nft(mintReceipt.serials.get(0)); var invalidNftId = new NftId(nftId.tokenId, -1L); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenNftInfoQuery() - .byNftId(invalidNftId) - .execute(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_NFT_SERIAL_NUMBER.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenNftInfoQuery().byNftId(invalidNftId).execute(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_NFT_SERIAL_NUMBER.toString()); } } @@ -168,36 +144,36 @@ void cannotQueryNftInfoByInvalidSerialNumber() throws Exception { @Test @DisplayName("Can query NFT info by AccountId") void canQueryNftInfoByAccountId() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); List metadatas = NftMetadataGenerator.generate((byte) 10); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(metadatas) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(metadatas) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftInfos = new TokenNftInfoQuery() - .byAccountId(testEnv.operatorId) - .setEnd(10) - .execute(testEnv.client); + .byAccountId(testEnv.operatorId) + .setEnd(10) + .execute(testEnv.client); assertThat(nftInfos.size()).isEqualTo(10); @@ -208,7 +184,6 @@ void canQueryNftInfoByAccountId() throws Exception { assertThat(serials.remove(info.nftId.serial)).isTrue(); assertThat(info.accountId).isEqualTo(testEnv.operatorId); } - } } @@ -216,36 +191,33 @@ void canQueryNftInfoByAccountId() throws Exception { @Test @DisplayName("Can query NFT info by TokenId") void canQueryNftInfoByTokenId() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var createReceipt = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client); var tokenId = Objects.requireNonNull(createReceipt.tokenId); List metadatas = NftMetadataGenerator.generate((byte) 10); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(metadatas) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(metadatas) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var nftInfos = new TokenNftInfoQuery() - .byTokenId(tokenId) - .setEnd(10) - .execute(testEnv.client); + var nftInfos = new TokenNftInfoQuery().byTokenId(tokenId).setEnd(10).execute(testEnv.client); assertThat(nftInfos.size()).isEqualTo(10); @@ -256,10 +228,6 @@ void canQueryNftInfoByTokenId() throws Exception { assertThat(serials.remove(info.nftId.serial)).isTrue(); assertThat(info.accountId).isEqualTo(testEnv.operatorId); } - } } } - - - diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java index aa25efdf49..f58e3b598a 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrivateKey; @@ -32,67 +17,63 @@ import com.hiero.sdk.TokenWipeTransaction; import com.hiero.sdk.TransactionResponse; import com.hiero.sdk.TransferTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.ArrayList; import java.util.Collections; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenNftTransferIntegrationTest { @Test @DisplayName("Can transfer NFTs") void canTransferNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); TransactionResponse response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = response.getReceipt(testEnv.client).accountId; assertThat(accountId).isNotNull(); response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = response.getReceipt(testEnv.client).tokenId; assertThat(tokenId).isNotNull(); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .signWithOperator(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .signWithOperator(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); var serialsToTransfer = new ArrayList(mintReceipt.serials.subList(0, 4)); var transfer = new TransferTransaction(); @@ -102,59 +83,58 @@ void canTransferNfts() throws Exception { transfer.execute(testEnv.client).getReceipt(testEnv.client); new TokenWipeTransaction() - .setTokenId(tokenId) - .setAccountId(accountId) - .setSerials(serialsToTransfer) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId) + .setAccountId(accountId) + .setSerials(serialsToTransfer) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot transfer NFTs you don't own") void cannotTransferUnownedNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); TransactionResponse response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = response.getReceipt(testEnv.client).accountId; assertThat(accountId).isNotNull(); response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = response.getReceipt(testEnv.client).tokenId; assertThat(tokenId).isNotNull(); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .signWithOperator(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .signWithOperator(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); var serialsToTransfer = new ArrayList(mintReceipt.serials.subList(0, 4)); var transfer = new TransferTransaction(); @@ -164,10 +144,11 @@ void cannotTransferUnownedNfts() throws Exception { } transfer.freezeWith(testEnv.client).sign(key); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - transfer.execute(testEnv.client).getReceipt(testEnv.client); - }).withMessageContaining(Status.SENDER_DOES_NOT_OWN_NFT_SERIAL_NO.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + transfer.execute(testEnv.client).getReceipt(testEnv.client); + }) + .withMessageContaining(Status.SENDER_DOES_NOT_OWN_NFT_SERIAL_NO.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java index eb9b3956a9..fb73eb7e17 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -43,31 +25,55 @@ void canExecuteTokenPauseTransaction() throws Exception { var accountKey = PrivateKey.generateED25519(); var testTokenAmount = 10; - var accountId = new AccountCreateTransaction().setKey(accountKey).setInitialBalance(new Hbar(2)) - .execute(testEnv.client).getReceipt(testEnv.client) - .accountId; + var accountId = new AccountCreateTransaction() + .setKey(accountKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; - var tokenId = new TokenCreateTransaction().setTokenName("ffff").setTokenSymbol("F").setInitialSupply(1000000) - .setDecimals(3).setTreasuryAccountId(testEnv.operatorId).setAdminKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey).setFreezeDefault(false).execute(testEnv.client) - .getReceipt(testEnv.client).tokenId; + var tokenId = new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setInitialSupply(1000000) + .setDecimals(3) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; - new TokenAssociateTransaction().setAccountId(accountId).setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client).sign(accountKey).execute(testEnv.client).getReceipt(testEnv.client); + new TokenAssociateTransaction() + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); - new TransferTransaction().addTokenTransfer(tokenId, accountId, testTokenAmount) - .addTokenTransfer(tokenId, testEnv.operatorId, -testTokenAmount).execute(testEnv.client) - .getReceipt(testEnv.client); + new TransferTransaction() + .addTokenTransfer(tokenId, accountId, testTokenAmount) + .addTokenTransfer(tokenId, testEnv.operatorId, -testTokenAmount) + .execute(testEnv.client) + .getReceipt(testEnv.client); - new TokenPauseTransaction().setTokenId(tokenId).freezeWith(testEnv.client).execute(testEnv.client) - .getReceipt(testEnv.client); + new TokenPauseTransaction() + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThrows(ReceiptStatusException.class, () -> { - new TransferTransaction().addTokenTransfer(tokenId, accountId, testTokenAmount) - .addTokenTransfer(tokenId, testEnv.operatorId, -testTokenAmount).freezeWith(testEnv.client) - .sign(accountKey).execute(testEnv.client).getReceipt(testEnv.client); + new TransferTransaction() + .addTokenTransfer(tokenId, accountId, testTokenAmount) + .addTokenTransfer(tokenId, testEnv.operatorId, -testTokenAmount) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); }); - } } @@ -79,7 +85,6 @@ void cannotPauseWithNoTokenId() throws Exception { assertThrows(PrecheckStatusException.class, () -> { new TokenPauseTransaction().execute(testEnv.client).getReceipt(testEnv.client); }); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java index 737a054a0f..c35e9c4b84 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -40,224 +22,228 @@ public class TokenRejectFlowIntegrationTest { @Test @DisplayName("Can execute TokenReject flow for Fungible Token") void canExecuteTokenRejectFlowForFungibleToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 0); // manually associate ft new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(ftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(ftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // execute the token reject flow new TokenRejectFlow() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the tokens are transferred back to the treasury - var treasuryAccountBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var treasuryAccountBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(treasuryAccountBalance.tokens.get(ftTokenId)).isEqualTo(1_000_000); // verify the allowance - should be 0, because TokenRejectFlow dissociates - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TransferTransaction() + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"); new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute TokenReject flow for Fungible Token (Async)") void canExecuteTokenRejectFlowForFungibleTokenAsync() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 0); // manually associate ft new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(ftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(ftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // execute the token reject flow new TokenRejectFlow() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .executeAsync(testEnv.client).get() - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .executeAsync(testEnv.client) + .get() + .getReceipt(testEnv.client); // verify the tokens are transferred back to the treasury - var treasuryAccountBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var treasuryAccountBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(treasuryAccountBalance.tokens.get(ftTokenId)).isEqualTo(1_000_000); // verify the tokens are not associated with the receiver - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TransferTransaction() + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"); new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute TokenReject flow for NFT") void canExecuteTokenRejectFlowForNft() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var nftTokenId = EntityHelper.createNft(testEnv); + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var nftTokenId = EntityHelper.createNft(testEnv); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 0); var mintReceiptToken = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptToken.serials; // manually associate bft new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(nftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(nftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // execute the token reject flow new TokenRejectFlow() - .setOwnerId(receiverAccountId) - .setNftIds(List.of(nftTokenId.nft(nftSerials.get(0)), nftTokenId.nft(nftSerials.get(1)))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .setNftIds(List.of(nftTokenId.nft(nftSerials.get(0)), nftTokenId.nft(nftSerials.get(1)))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the token is transferred back to the treasury var nftTokenIdNftInfo = new TokenNftInfoQuery() - .setNftId(nftTokenId.nft(nftSerials.get(1))) - .execute(testEnv.client); + .setNftId(nftTokenId.nft(nftSerials.get(1))) + .execute(testEnv.client); assertThat(nftTokenIdNftInfo.get(0).accountId).isEqualTo(testEnv.operatorId); // verify the tokens are not associated with the receiver - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TransferTransaction() + .addNftTransfer( + nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot execute TokenReject flow for NFT when rejecting Only Part Of Owned NFTs") void canExecuteTokenRejectFlowForNftWhenRejectingOnlyPartOfOwnedNFTs() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var nftTokenId1 = EntityHelper.createNft(testEnv); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 0); var mintReceiptToken = new TokenMintTransaction() - .setTokenId(nftTokenId1) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId1) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptToken.serials; // manually associate bft new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(nftTokenId1)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(nftTokenId1)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId1.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId1.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // execute the token reject flow - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectFlow() - .setOwnerId(receiverAccountId) - .addNftId(nftTokenId1.nft(nftSerials.get(1))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) + .addNftTransfer(nftTokenId1.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId1.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_STILL_OWNS_NFTS"); + // execute the token reject flow + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectFlow() + .setOwnerId(receiverAccountId) + .addNftId(nftTokenId1.nft(nftSerials.get(1))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_STILL_OWNS_NFTS"); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java index b58602bd6c..ad14d4a443 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +23,6 @@ import com.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.List; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -51,7 +32,7 @@ public class TokenRejectIntegrationTest { @Test @DisplayName("Can execute TokenReject transaction for Fungible Token") void canExecuteTokenRejectTransactionForFungibleToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createFungibleToken(testEnv, 3); var tokenId2 = EntityHelper.createFungibleToken(testEnv, 3); var receiverAccountKey = PrivateKey.generateED25519(); @@ -59,130 +40,125 @@ void canExecuteTokenRejectTransactionForFungibleToken() throws Exception { // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(tokenId1, testEnv.operatorId, -10) - .addTokenTransfer(tokenId1, receiverAccountId, 10) - .addTokenTransfer(tokenId2, testEnv.operatorId, -10) - .addTokenTransfer(tokenId2, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenId1, testEnv.operatorId, -10) + .addTokenTransfer(tokenId1, receiverAccountId, 10) + .addTokenTransfer(tokenId2, testEnv.operatorId, -10) + .addTokenTransfer(tokenId2, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setTokenIds(List.of(tokenId1, tokenId2)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .setTokenIds(List.of(tokenId1, tokenId2)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance of the receiver is 0 - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(receiverAccountBalance.tokens.get(tokenId1)).isEqualTo(0); assertThat(receiverAccountBalance.tokens.get(tokenId2)).isEqualTo(0); // verify the tokens are transferred back to the treasury - var treasuryAccountBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var treasuryAccountBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(treasuryAccountBalance.tokens.get(tokenId1)).isEqualTo(1_000_000); assertThat(treasuryAccountBalance.tokens.get(tokenId2)).isEqualTo(1_000_000); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute TokenReject transaction for NFT") void canExecuteTokenRejectTransactionForNft() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var tokenId1 = EntityHelper.createNft(testEnv); var tokenId2 = EntityHelper.createNft(testEnv); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 100); var mintReceiptToken1 = new TokenMintTransaction() - .setTokenId(tokenId1) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var mintReceiptToken2 = new TokenMintTransaction() - .setTokenId(tokenId2) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId2) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptToken2.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(tokenId1.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(tokenId1.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(tokenId2.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(tokenId2.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(tokenId1.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(tokenId1.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(tokenId2.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(tokenId2.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject one of the nfts new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setNftIds(List.of(tokenId1.nft(nftSerials.get(1)), tokenId2.nft(nftSerials.get(1)))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .setNftIds(List.of(tokenId1.nft(nftSerials.get(1)), tokenId2.nft(nftSerials.get(1)))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance is decremented by 1 - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(receiverAccountBalance.tokens.get(tokenId1)).isEqualTo(1); assertThat(receiverAccountBalance.tokens.get(tokenId2)).isEqualTo(1); // verify the token is transferred back to the treasury var tokenId1NftInfo = new TokenNftInfoQuery() - .setNftId(tokenId1.nft(nftSerials.get(1))) - .execute(testEnv.client); + .setNftId(tokenId1.nft(nftSerials.get(1))) + .execute(testEnv.client); assertThat(tokenId1NftInfo.get(0).accountId).isEqualTo(testEnv.operatorId); var tokenId2NftInfo = new TokenNftInfoQuery() - .setNftId(tokenId2.nft(nftSerials.get(1))) - .execute(testEnv.client); + .setNftId(tokenId2.nft(nftSerials.get(1))) + .execute(testEnv.client); assertThat(tokenId2NftInfo.get(0).accountId).isEqualTo(testEnv.operatorId); new TokenDeleteTransaction() - .setTokenId(tokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(tokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute TokenReject transaction for FT and NFT in One Tx") void canExecuteTokenRejectTransactionForFtAndNftInOneTx() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId1 = EntityHelper.createFungibleToken(testEnv, 3); var ftTokenId2 = EntityHelper.createFungibleToken(testEnv, 3); var nftTokenId1 = EntityHelper.createNft(testEnv); @@ -191,51 +167,50 @@ void canExecuteTokenRejectTransactionForFtAndNftInOneTx() throws Exception { var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 100); var mintReceiptNftToken1 = new TokenMintTransaction() - .setTokenId(nftTokenId1) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId1) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var mintReceiptNftToken2 = new TokenMintTransaction() - .setTokenId(nftTokenId2) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId2) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptNftToken2.serials; // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId1, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId1, receiverAccountId, 10) - .addTokenTransfer(ftTokenId2, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId2, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId1, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId1, receiverAccountId, 10) + .addTokenTransfer(ftTokenId2, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId2, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId1.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId1.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId2.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId2.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId1.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId1.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId2.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId2.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setTokenIds(List.of(ftTokenId1, ftTokenId2)) - .setNftIds(List.of(nftTokenId1.nft(nftSerials.get(1)), nftTokenId2.nft(nftSerials.get(1)))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .setTokenIds(List.of(ftTokenId1, ftTokenId2)) + .setNftIds(List.of(nftTokenId1.nft(nftSerials.get(1)), nftTokenId2.nft(nftSerials.get(1)))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance of the receiver is 0 - var receiverAccountBalance = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalance = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(receiverAccountBalance.tokens.get(ftTokenId1)).isEqualTo(0); assertThat(receiverAccountBalance.tokens.get(ftTokenId2)).isEqualTo(0); @@ -243,195 +218,189 @@ void canExecuteTokenRejectTransactionForFtAndNftInOneTx() throws Exception { assertThat(receiverAccountBalance.tokens.get(nftTokenId2)).isEqualTo(1); // verify the tokens are transferred back to the treasury - var treasuryAccountBalance = new AccountBalanceQuery() - .setAccountId(testEnv.operatorId) - .execute(testEnv.client); + var treasuryAccountBalance = + new AccountBalanceQuery().setAccountId(testEnv.operatorId).execute(testEnv.client); assertThat(treasuryAccountBalance.tokens.get(ftTokenId1)).isEqualTo(1_000_000); assertThat(treasuryAccountBalance.tokens.get(ftTokenId2)).isEqualTo(1_000_000); var tokenId1NftInfo = new TokenNftInfoQuery() - .setNftId(nftTokenId1.nft(nftSerials.get(1))) - .execute(testEnv.client); + .setNftId(nftTokenId1.nft(nftSerials.get(1))) + .execute(testEnv.client); assertThat(tokenId1NftInfo.get(0).accountId).isEqualTo(testEnv.operatorId); var tokenId2NftInfo = new TokenNftInfoQuery() - .setNftId(nftTokenId2.nft(nftSerials.get(1))) - .execute(testEnv.client); + .setNftId(nftTokenId2.nft(nftSerials.get(1))) + .execute(testEnv.client); assertThat(tokenId2NftInfo.get(0).accountId).isEqualTo(testEnv.operatorId); new TokenDeleteTransaction() - .setTokenId(ftTokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(ftTokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(nftTokenId1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(nftTokenId2) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(nftTokenId2) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Can execute TokenReject transaction for FT and NFT when Treasury receiverSigRequired is Enabled") void canExecuteTokenRejectTransactionForFtAndNftWhenTreasuryReceiverSigRequiredIsEnabled() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 100); var treasuryAccountKey = PrivateKey.generateED25519(); var treasuryAccountId = new AccountCreateTransaction() - .setKey(treasuryAccountKey) - .setInitialBalance(new Hbar(0)) - .setReceiverSignatureRequired(true) - .setMaxAutomaticTokenAssociations(100) - .freezeWith(testEnv.client) - .sign(treasuryAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(treasuryAccountKey) + .setInitialBalance(new Hbar(0)) + .setReceiverSignatureRequired(true) + .setMaxAutomaticTokenAssociations(100) + .freezeWith(testEnv.client) + .sign(treasuryAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var ftTokenId = new TokenCreateTransaction() - .setTokenName("Test Fungible Token") - .setTokenSymbol("TFT") - .setTokenMemo("I was created for integration tests") - .setDecimals(18) - .setInitialSupply(1_000_000) - .setMaxSupply(1_000_000) - .setTreasuryAccountId(treasuryAccountId) - .setSupplyType(TokenSupplyType.FINITE) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .freezeWith(testEnv.client) - .sign(treasuryAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("Test Fungible Token") + .setTokenSymbol("TFT") + .setTokenMemo("I was created for integration tests") + .setDecimals(18) + .setInitialSupply(1_000_000) + .setMaxSupply(1_000_000) + .setTreasuryAccountId(treasuryAccountId) + .setSupplyType(TokenSupplyType.FINITE) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .freezeWith(testEnv.client) + .sign(treasuryAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, treasuryAccountId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .freezeWith(testEnv.client) - .sign(treasuryAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, treasuryAccountId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .freezeWith(testEnv.client) + .sign(treasuryAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance of the receiver is 0 - var receiverAccountBalanceFt = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalanceFt = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(receiverAccountBalanceFt.tokens.get(ftTokenId)).isEqualTo(0); // verify the tokens are transferred back to the treasury - var treasuryAccountBalance = new AccountBalanceQuery() - .setAccountId(treasuryAccountId) - .execute(testEnv.client); + var treasuryAccountBalance = + new AccountBalanceQuery().setAccountId(treasuryAccountId).execute(testEnv.client); assertThat(treasuryAccountBalance.tokens.get(ftTokenId)).isEqualTo(1_000_000); // same test for nft var nftTokenId = new TokenCreateTransaction() - .setTokenName("Test NFT") - .setTokenSymbol("TNFT") - .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) - .setTreasuryAccountId(treasuryAccountId) - .setSupplyType(TokenSupplyType.FINITE) - .setMaxSupply(10) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .freezeWith(testEnv.client) - .sign(treasuryAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("Test NFT") + .setTokenSymbol("TNFT") + .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) + .setTreasuryAccountId(treasuryAccountId) + .setSupplyType(TokenSupplyType.FINITE) + .setMaxSupply(10) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .freezeWith(testEnv.client) + .sign(treasuryAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; var mintReceiptNftToken = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptNftToken.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), treasuryAccountId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), treasuryAccountId, receiverAccountId) - .freezeWith(testEnv.client) - .sign(treasuryAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), treasuryAccountId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), treasuryAccountId, receiverAccountId) + .freezeWith(testEnv.client) + .sign(treasuryAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addNftId(nftTokenId.nft(nftSerials.get(1))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setOwnerId(receiverAccountId) + .addNftId(nftTokenId.nft(nftSerials.get(1))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the balance is decremented by 1 - var receiverAccountBalanceNft = new AccountBalanceQuery() - .setAccountId(receiverAccountId) - .execute(testEnv.client); + var receiverAccountBalanceNft = + new AccountBalanceQuery().setAccountId(receiverAccountId).execute(testEnv.client); assertThat(receiverAccountBalanceNft.tokens.get(nftTokenId)).isEqualTo(1); // verify the token is transferred back to the treasury var nftTokenIdInfo = new TokenNftInfoQuery() - .setNftId(nftTokenId.nft(nftSerials.get(1))) - .execute(testEnv.client); + .setNftId(nftTokenId.nft(nftSerials.get(1))) + .execute(testEnv.client); assertThat(nftTokenIdInfo.get(0).accountId).isEqualTo(treasuryAccountId); new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot execute TokenReject transaction for FT and NFT when Token is Frozen") void canExecuteTokenRejectTransactionForFtAndNftWhenTokenIsFrozen() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 18); var nftTokenId = EntityHelper.createNft(testEnv); var receiverAccountKey = PrivateKey.generateED25519(); @@ -439,81 +408,84 @@ void canExecuteTokenRejectTransactionForFtAndNftWhenTokenIsFrozen() throws Excep // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // freeze ft new TokenFreezeTransaction() - .setTokenId(ftTokenId) - .setAccountId(receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .setAccountId(receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token - should fail with ACCOUNT_FROZEN_FOR_TOKEN - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_FROZEN_FOR_TOKEN"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_FROZEN_FOR_TOKEN"); // same test for nft var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // freeze nft new TokenFreezeTransaction() - .setTokenId(nftTokenId) - .setAccountId(receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token - should fail with ACCOUNT_FROZEN_FOR_TOKEN - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addNftId(nftTokenId.nft(nftSerials.get(1))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) + .setTokenId(nftTokenId) + .setAccountId(receiverAccountId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_FROZEN_FOR_TOKEN"); - new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + // reject the token - should fail with ACCOUNT_FROZEN_FOR_TOKEN + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addNftId(nftTokenId.nft(nftSerials.get(1))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_FROZEN_FOR_TOKEN"); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + new TokenDeleteTransaction() + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot execute TokenReject transaction for FT and NFT when Token is Paused") void canExecuteTokenRejectTransactionForFtAndNftWhenTokenIsPaused() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 18); var nftTokenId = EntityHelper.createNft(testEnv); var receiverAccountKey = PrivateKey.generateED25519(); @@ -521,62 +493,65 @@ void canExecuteTokenRejectTransactionForFtAndNftWhenTokenIsPaused() throws Excep // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // pause ft new TokenPauseTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token - should fail with TOKEN_IS_PAUSED - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) + .setTokenId(ftTokenId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_IS_PAUSED"); + + // reject the token - should fail with TOKEN_IS_PAUSED + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_IS_PAUSED"); // same test for nft var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // pause nft new TokenPauseTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token - should fail with TOKEN_IS_PAUSED - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addNftId(nftTokenId.nft(nftSerials.get(1))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) + .setTokenId(nftTokenId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_IS_PAUSED"); + // reject the token - should fail with TOKEN_IS_PAUSED + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addNftId(nftTokenId.nft(nftSerials.get(1))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_IS_PAUSED"); } } @@ -584,7 +559,7 @@ void canExecuteTokenRejectTransactionForFtAndNftWhenTokenIsPaused() throws Excep @Disabled // temp disabled till issue re nfts will be resolved on services side @DisplayName("Can remove allowance when executing TokenReject transaction for FT and NFT") void canRemoveAllowanceWhenExecutingTokenRejectForFtAndNft() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, -1); @@ -593,41 +568,21 @@ void canRemoveAllowanceWhenExecutingTokenRejectForFtAndNft() throws Exception { // transfer ft to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); // approve allowance to the spender new AccountAllowanceApproveTransaction() - .approveTokenAllowance(ftTokenId, receiverAccountId, spenderAccountId, 10) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveTokenAllowance(ftTokenId, receiverAccountId, spenderAccountId, 10) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the spender has allowance new TransferTransaction() - .addApprovedTokenTransfer(ftTokenId, receiverAccountId, -5) - .addTokenTransfer(ftTokenId, spenderAccountId, 5) - .setTransactionId(TransactionId.generate(spenderAccountId)) - .freezeWith(testEnv.client) - .sign(spenderAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // verify the allowance - should be 0 , because the receiver is no longer the owner - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TransferTransaction() .addApprovedTokenTransfer(ftTokenId, receiverAccountId, -5) .addTokenTransfer(ftTokenId, spenderAccountId, 5) .setTransactionId(TransactionId.generate(spenderAccountId)) @@ -635,207 +590,239 @@ void canRemoveAllowanceWhenExecutingTokenRejectForFtAndNft() throws Exception { .sign(spenderAccountKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("SPENDER_DOES_NOT_HAVE_ALLOWANCE"); + + // reject the token + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + // verify the allowance - should be 0 , because the receiver is no longer the owner + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TransferTransaction() + .addApprovedTokenTransfer(ftTokenId, receiverAccountId, -5) + .addTokenTransfer(ftTokenId, spenderAccountId, 5) + .setTransactionId(TransactionId.generate(spenderAccountId)) + .freezeWith(testEnv.client) + .sign(spenderAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("SPENDER_DOES_NOT_HAVE_ALLOWANCE"); // same test for nft var nftTokenId = EntityHelper.createNft(testEnv); var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(2)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(3)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(2)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(3)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // approve allowance to the spender new AccountAllowanceApproveTransaction() - .approveTokenNftAllowance(nftTokenId.nft(nftSerials.get(0)), receiverAccountId, spenderAccountId) - .approveTokenNftAllowance(nftTokenId.nft(nftSerials.get(1)), receiverAccountId, spenderAccountId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .approveTokenNftAllowance(nftTokenId.nft(nftSerials.get(0)), receiverAccountId, spenderAccountId) + .approveTokenNftAllowance(nftTokenId.nft(nftSerials.get(1)), receiverAccountId, spenderAccountId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // verify the spender has allowance new TransferTransaction() - .addApprovedNftTransfer(nftTokenId.nft(nftSerials.get(0)), receiverAccountId, spenderAccountId) - .setTransactionId(TransactionId.generate(spenderAccountId)) - .freezeWith(testEnv.client) - .sign(spenderAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addApprovedNftTransfer(nftTokenId.nft(nftSerials.get(0)), receiverAccountId, spenderAccountId) + .setTransactionId(TransactionId.generate(spenderAccountId)) + .freezeWith(testEnv.client) + .sign(spenderAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setNftIds(List.of(nftTokenId.nft(nftSerials.get(1)), nftTokenId.nft(nftSerials.get(2)))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // verify the allowance - should be 0 , because the receiver is no longer the owner - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TransferTransaction() - .addApprovedNftTransfer(nftTokenId.nft(nftSerials.get(1)), receiverAccountId, spenderAccountId) - .addApprovedNftTransfer(nftTokenId.nft(nftSerials.get(2)), receiverAccountId, spenderAccountId) - .setTransactionId(TransactionId.generate(spenderAccountId)) + .setOwnerId(receiverAccountId) + .setNftIds(List.of(nftTokenId.nft(nftSerials.get(1)), nftTokenId.nft(nftSerials.get(2)))) .freezeWith(testEnv.client) - .sign(spenderAccountKey) + .sign(receiverAccountKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("SPENDER_DOES_NOT_HAVE_ALLOWANCE"); - new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + // verify the allowance - should be 0 , because the receiver is no longer the owner + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TransferTransaction() + .addApprovedNftTransfer( + nftTokenId.nft(nftSerials.get(1)), receiverAccountId, spenderAccountId) + .addApprovedNftTransfer( + nftTokenId.nft(nftSerials.get(2)), receiverAccountId, spenderAccountId) + .setTransactionId(TransactionId.generate(spenderAccountId)) + .freezeWith(testEnv.client) + .sign(spenderAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("SPENDER_DOES_NOT_HAVE_ALLOWANCE"); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + new TokenDeleteTransaction() + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot reject NFT when executing TokenReject with Add or Set TokenId") void cannotRejectNftWhenUsingAddOrSetTokenId() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var nftTokenId = EntityHelper.createNft(testEnv); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 100); var mintReceiptNftToken = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceiptNftToken.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(2)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(2)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the whole collection (addTokenId) - should fail - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(nftTokenId) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(nftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"); // reject the whole collection (setTokenIds) - should fail - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setTokenIds(List.of(nftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .setTokenIds(List.of(nftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot Reject a Token when executing TokenReject and Duplicating Token Reference") void cannotRejectTokenWhenExecutingTokenRejectAndDuplicatingTokenReference() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 100); // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token with duplicate token id - should fail with TOKEN_REFERENCE_REPEATED - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setTokenIds(List.of(ftTokenId, ftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_REFERENCE_REPEATED"); + + // reject the token with duplicate token id - should fail with TOKEN_REFERENCE_REPEATED + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .setTokenIds(List.of(ftTokenId, ftTokenId)) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_REFERENCE_REPEATED"); // same test for nft var nftTokenId = EntityHelper.createNft(testEnv); var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // transfer nfts to the receiver new TransferTransaction() - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the nft with duplicate nft id - should fail with TOKEN_REFERENCE_REPEATED - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .setNftIds(List.of(nftTokenId.nft(nftSerials.get(0)), nftTokenId.nft(nftSerials.get(0)))) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_REFERENCE_REPEATED"); - new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + // reject the nft with duplicate nft id - should fail with TOKEN_REFERENCE_REPEATED + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .setNftIds( + List.of(nftTokenId.nft(nftSerials.get(0)), nftTokenId.nft(nftSerials.get(0)))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_REFERENCE_REPEATED"); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + new TokenDeleteTransaction() + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot Reject a Token when Owner Has Empty Balance") void cannotRejectTokenWhenOwnerHasEmptyBalance() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, 100); @@ -843,115 +830,121 @@ void cannotRejectTokenWhenOwnerHasEmptyBalance() throws Exception { // skip the transfer // associate the receiver new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(ftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token - should fail with INSUFFICIENT_TOKEN_BALANCE - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(ftTokenId)) .freezeWith(testEnv.client) .sign(receiverAccountKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("INSUFFICIENT_TOKEN_BALANCE"); + + // reject the token - should fail with INSUFFICIENT_TOKEN_BALANCE + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("INSUFFICIENT_TOKEN_BALANCE"); // same test for nft var nftTokenId = EntityHelper.createNft(testEnv); var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // skip the transfer // associate the receiver new TokenAssociateTransaction() - .setAccountId(receiverAccountId) - .setTokenIds(Collections.singletonList(nftTokenId)) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the nft - should fail with INVALID_OWNER_ID - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addNftId(nftTokenId.nft(nftSerials.get(0))) + .setAccountId(receiverAccountId) + .setTokenIds(Collections.singletonList(nftTokenId)) .freezeWith(testEnv.client) .sign(receiverAccountKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("INVALID_OWNER_ID"); - new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + // reject the nft - should fail with INVALID_OWNER_ID + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addNftId(nftTokenId.nft(nftSerials.get(0))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("INVALID_OWNER_ID"); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + new TokenDeleteTransaction() + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot Reject a Token when Treasury Rejects itself") void cannotRejectTokenWhenTreasuryRejects() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); // skip the transfer // reject the token with the treasury - should fail with ACCOUNT_IS_TREASURY - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(testEnv.operatorId) - .addTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_IS_TREASURY"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(testEnv.operatorId) + .addTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_IS_TREASURY"); // same test for nft var nftTokenId = EntityHelper.createNft(testEnv); var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // skip the transfer // reject the nft with the treasury - should fail with ACCOUNT_IS_TREASURY - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(testEnv.operatorId) - .addNftId(nftTokenId.nft(nftSerials.get(0))) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("ACCOUNT_IS_TREASURY"); - + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(testEnv.operatorId) + .addNftId(nftTokenId.nft(nftSerials.get(0))) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("ACCOUNT_IS_TREASURY"); } } @Test @DisplayName("Cannot Reject a Token with Invalid Signature") void cannotRejectTokenWithInvalidSignature() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 3); var randomKey = PrivateKey.generateED25519(); var receiverAccountKey = PrivateKey.generateED25519(); @@ -959,113 +952,115 @@ void cannotRejectTokenWithInvalidSignature() throws Exception { // transfer fts to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - // reject the token with different key - should fail with INVALID_SIGNATURE - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .freezeWith(testEnv.client) - .sign(randomKey) + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining("INVALID_SIGNATURE"); - new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + // reject the token with different key - should fail with INVALID_SIGNATURE + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .freezeWith(testEnv.client) + .sign(randomKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("INVALID_SIGNATURE"); + new TokenDeleteTransaction() + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot Reject a Token when Token Or NFT ID is not set") void cannotRejectTokenWhenTokenOrNFTIdIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // reject the token with invalid token - should fail with EMPTY_TOKEN_REFERENCE_LIST - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(testEnv.operatorId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("EMPTY_TOKEN_REFERENCE_LIST"); - + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(testEnv.operatorId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("EMPTY_TOKEN_REFERENCE_LIST"); } } @Test @DisplayName("Cannot Reject a Token when executing TokenReject and Token Reference List Size Exceeded") void cannotRejectTokenWhenTokenReferenceListSizeExceeded() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var ftTokenId = EntityHelper.createFungibleToken(testEnv, 18); var receiverAccountKey = PrivateKey.generateED25519(); var receiverAccountId = EntityHelper.createAccount(testEnv, receiverAccountKey, -1); var nftTokenId = EntityHelper.createNft(testEnv); var mintReceipt = new TokenMintTransaction() - .setTokenId(nftTokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(nftTokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); var nftSerials = mintReceipt.serials; // transfer the tokens to the receiver new TransferTransaction() - .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) - .addTokenTransfer(ftTokenId, receiverAccountId, 10) - .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(2)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(3)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(4)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(5)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(6)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(7)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(8)), testEnv.operatorId, receiverAccountId) - .addNftTransfer(nftTokenId.nft(nftSerials.get(9)), testEnv.operatorId, receiverAccountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(ftTokenId, testEnv.operatorId, -10) + .addTokenTransfer(ftTokenId, receiverAccountId, 10) + .addNftTransfer(nftTokenId.nft(nftSerials.get(0)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(1)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(2)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(3)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(4)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(5)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(6)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(7)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(8)), testEnv.operatorId, receiverAccountId) + .addNftTransfer(nftTokenId.nft(nftSerials.get(9)), testEnv.operatorId, receiverAccountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // reject the token with 11 token references - should fail with TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED - assertThatExceptionOfType(Exception.class).isThrownBy(() -> { - new TokenRejectTransaction() - .setOwnerId(receiverAccountId) - .addTokenId(ftTokenId) - .setNftIds(List.of( - nftTokenId.nft(nftSerials.get(0)), - nftTokenId.nft(nftSerials.get(1)), - nftTokenId.nft(nftSerials.get(2)), - nftTokenId.nft(nftSerials.get(3)), - nftTokenId.nft(nftSerials.get(4)), - nftTokenId.nft(nftSerials.get(5)), - nftTokenId.nft(nftSerials.get(6)), - nftTokenId.nft(nftSerials.get(7)), - nftTokenId.nft(nftSerials.get(8)), - nftTokenId.nft(nftSerials.get(9)) - )) - .freezeWith(testEnv.client) - .sign(receiverAccountKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining("TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED"); + assertThatExceptionOfType(Exception.class) + .isThrownBy(() -> { + new TokenRejectTransaction() + .setOwnerId(receiverAccountId) + .addTokenId(ftTokenId) + .setNftIds(List.of( + nftTokenId.nft(nftSerials.get(0)), + nftTokenId.nft(nftSerials.get(1)), + nftTokenId.nft(nftSerials.get(2)), + nftTokenId.nft(nftSerials.get(3)), + nftTokenId.nft(nftSerials.get(4)), + nftTokenId.nft(nftSerials.get(5)), + nftTokenId.nft(nftSerials.get(6)), + nftTokenId.nft(nftSerials.get(7)), + nftTokenId.nft(nftSerials.get(8)), + nftTokenId.nft(nftSerials.get(9)))) + .freezeWith(testEnv.client) + .sign(receiverAccountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining("TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED"); new TokenDeleteTransaction() - .setTokenId(ftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(ftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenDeleteTransaction() - .setTokenId(nftTokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(nftTokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java index d4d635df04..a43892eb05 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -28,31 +12,27 @@ import com.hiero.sdk.TokenAssociateTransaction; import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenRevokeKycTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenRevokeKycIntegrationTest { @Test @DisplayName("Can revoke kyc to account with token") void canRevokeKycAccountWithToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -66,105 +46,104 @@ void canRevokeKycAccountWithToken() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenRevokeKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot revoke kyc to account on token when token ID is not set") void cannotRevokeKycToAccountOnTokenWhenTokenIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenRevokeKycTransaction() - .setAccountId(accountId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenRevokeKycTransaction() + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Cannot revoke kyc to account on token when account ID is not set") void cannotRevokeKycToAccountOnTokenWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenRevokeKycTransaction() - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenRevokeKycTransaction() + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot revoke kyc to account on token when account was not associated with") void cannotRevokeKycToAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -178,19 +157,19 @@ void cannotRevokeKycToAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exc .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenRevokeKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenRevokeKycTransaction() + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java index 5ff64367f8..073e8fbd5e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.CustomFixedFee; import com.hiero.sdk.Hbar; @@ -27,72 +12,66 @@ import com.hiero.sdk.Status; import com.hiero.sdk.TokenAssociateTransaction; import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; import com.hiero.sdk.TokenGrantKycTransaction; import com.hiero.sdk.TransactionResponse; import com.hiero.sdk.TransferTransaction; +import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Collections; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - class TokenTransferIntegrationTest { @Test @DisplayName("Can transfer tokens") void tokenTransferTest() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); TransactionResponse response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = response.getReceipt(testEnv.client).accountId; assertThat(accountId).isNotNull(); response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = response.getReceipt(testEnv.client).tokenId; assertThat(tokenId).isNotNull(); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .signWithOperator(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .signWithOperator(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, accountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, accountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -104,69 +83,70 @@ void insufficientBalanceForFee() throws Exception { PrivateKey key1 = PrivateKey.generateED25519(); PrivateKey key2 = PrivateKey.generateED25519(); var accountId1 = new AccountCreateTransaction() - .setKey(key1) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key1) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var accountId2 = new AccountCreateTransaction() - .setKey(key2) - .setInitialBalance(new Hbar(2)) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .accountId; + .setKey(key2) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; var tokenId = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setInitialSupply(1) - .setCustomFees(Collections.singletonList(new CustomFixedFee() - .setAmount(5000_000_000L) - .setFeeCollectorAccountId(testEnv.operatorId))) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFeeScheduleKey(testEnv.operatorKey) - .execute(testEnv.client) - .getReceipt(testEnv.client) - .tokenId; + .setTokenName("ffff") + .setTokenSymbol("F") + .setInitialSupply(1) + .setCustomFees(Collections.singletonList( + new CustomFixedFee().setAmount(5000_000_000L).setFeeCollectorAccountId(testEnv.operatorId))) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFeeScheduleKey(testEnv.operatorKey) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; new TokenAssociateTransaction() - .setAccountId(accountId1) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId1) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key1) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenAssociateTransaction() - .setAccountId(accountId2) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key2) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId2) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key2) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -1) - .addTokenTransfer(tokenId, accountId1, 1) - .freezeWith(testEnv.client) - .sign(key1) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TransferTransaction() - .addTokenTransfer(tokenId, accountId1, -1) - .addTokenTransfer(tokenId, accountId2, 1) + .addTokenTransfer(tokenId, testEnv.operatorId, -1) + .addTokenTransfer(tokenId, accountId1, 1) .freezeWith(testEnv.client) .sign(key1) - .sign(key2) .execute(testEnv.client) .getReceipt(testEnv.client); - }).satisfies(error -> assertThat(error.getMessage()).containsAnyOf( - Status.INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE.toString(), - Status.INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE.toString() - )); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TransferTransaction() + .addTokenTransfer(tokenId, accountId1, -1) + .addTokenTransfer(tokenId, accountId2, 1) + .freezeWith(testEnv.client) + .sign(key1) + .sign(key2) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .satisfies(error -> assertThat(error.getMessage()) + .containsAnyOf( + Status.INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE.toString(), + Status.INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE.toString())); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java index 6f15575b66..40a300ae3b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java @@ -1,24 +1,8 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -28,31 +12,27 @@ import com.hiero.sdk.TokenAssociateTransaction; import com.hiero.sdk.TokenCreateTransaction; import com.hiero.sdk.TokenUnfreezeTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenUnfreezeIntegrationTest { @Test @DisplayName("Can unfreeze account with token") void canUnfreezeAccountWithToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -66,105 +46,104 @@ void canUnfreezeAccountWithToken() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenUnfreezeTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @Test @DisplayName("Cannot unfreeze account on token when token ID is not set") void cannotUnfreezeAccountOnTokenWhenTokenIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUnfreezeTransaction() - .setAccountId(accountId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUnfreezeTransaction() + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Cannot unfreeze account on token when account ID is not set") void cannotUnfreezeAccountOnTokenWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUnfreezeTransaction() - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUnfreezeTransaction() + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot unfreeze account on token when account was not associated with") void cannotUnfreezeAccountOnTokenWhenAccountWasNotAssociatedWith() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -178,19 +157,19 @@ void cannotUnfreezeAccountOnTokenWhenAccountWasNotAssociatedWith() throws Except .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUnfreezeTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUnfreezeTransaction() + .setAccountId(accountId) + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java index 51859de747..ad8ab8bf9e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2023 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -45,32 +27,66 @@ void canExecuteTokenUnpauseTransaction() throws Exception { var accountKey = PrivateKey.generateED25519(); var testTokenAmount = 10; - var accountId = new AccountCreateTransaction().setKey(accountKey).setInitialBalance(new Hbar(2)) - .execute(testEnv.client).getReceipt(testEnv.client).accountId; - - var tokenId = new TokenCreateTransaction().setTokenName("ffff").setTokenSymbol("F").setInitialSupply(1000000) - .setDecimals(3).setTreasuryAccountId(testEnv.operatorId).setAdminKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey).setWipeKey(testEnv.operatorKey).setFreezeDefault(false) - .execute(testEnv.client).getReceipt(testEnv.client).tokenId; - - new TokenAssociateTransaction().setAccountId(accountId).setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client).sign(accountKey).execute(testEnv.client).getReceipt(testEnv.client); - - new TokenUnpauseTransaction().setTokenId(tokenId).freezeWith(testEnv.client).execute(testEnv.client) - .getReceipt(testEnv.client); - - new TransferTransaction().addTokenTransfer(tokenId, accountId, testTokenAmount) - .addTokenTransfer(tokenId, testEnv.operatorId, -testTokenAmount).execute(testEnv.client) - .getReceipt(testEnv.client); - - new TokenWipeTransaction().setTokenId(tokenId).setAccountId(accountId).setAmount(testTokenAmount) - .execute(testEnv.client).getReceipt(testEnv.client); - - new TokenDeleteTransaction().setTokenId(tokenId).execute(testEnv.client).getReceipt(testEnv.client); - - new AccountDeleteTransaction().setTransferAccountId(testEnv.operatorId).setAccountId(accountId) - .freezeWith(testEnv.client).sign(accountKey).execute(testEnv.client).getReceipt(testEnv.client); - + var accountId = new AccountCreateTransaction() + .setKey(accountKey) + .setInitialBalance(new Hbar(2)) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .accountId; + + var tokenId = new TokenCreateTransaction() + .setTokenName("ffff") + .setTokenSymbol("F") + .setInitialSupply(1000000) + .setDecimals(3) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client) + .getReceipt(testEnv.client) + .tokenId; + + new TokenAssociateTransaction() + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new TokenUnpauseTransaction() + .setTokenId(tokenId) + .freezeWith(testEnv.client) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new TransferTransaction() + .addTokenTransfer(tokenId, accountId, testTokenAmount) + .addTokenTransfer(tokenId, testEnv.operatorId, -testTokenAmount) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new TokenWipeTransaction() + .setTokenId(tokenId) + .setAccountId(accountId) + .setAmount(testTokenAmount) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new TokenDeleteTransaction() + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + new AccountDeleteTransaction() + .setTransferAccountId(testEnv.operatorId) + .setAccountId(accountId) + .freezeWith(testEnv.client) + .sign(accountKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -82,7 +98,6 @@ void cannotUnpauseWithNoTokenId() throws Exception { assertThrows(PrecheckStatusException.class, () -> { new TokenUnpauseTransaction().execute(testEnv.client).getReceipt(testEnv.client); }); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java index 5281cbe9b6..0cd12501d9 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -42,29 +24,27 @@ class TokenUpdateIntegrationTest { @Test @DisplayName("Can update token") void canUpdateToken() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setDecimals(3) - .setInitialSupply(1000000) - .setTreasuryAccountId(testEnv.operatorId) - .setAdminKey(testEnv.operatorKey) - .setFreezeKey(testEnv.operatorKey) - .setWipeKey(testEnv.operatorKey) - .setKycKey(testEnv.operatorKey) - .setSupplyKey(testEnv.operatorKey) - .setPauseKey(testEnv.operatorKey) - .setMetadataKey(testEnv.operatorKey) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setDecimals(3) + .setInitialSupply(1000000) + .setTreasuryAccountId(testEnv.operatorId) + .setAdminKey(testEnv.operatorKey) + .setFreezeKey(testEnv.operatorKey) + .setWipeKey(testEnv.operatorKey) + .setKycKey(testEnv.operatorKey) + .setSupplyKey(testEnv.operatorKey) + .setPauseKey(testEnv.operatorKey) + .setMetadataKey(testEnv.operatorKey) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - var info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("ffff"); @@ -87,15 +67,13 @@ void canUpdateToken() throws Exception { assertThat(info.defaultKycStatus).isNotNull().isFalse(); new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenName("aaaa") - .setTokenSymbol("A") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenName("aaaa") + .setTokenSymbol("A") + .execute(testEnv.client) + .getReceipt(testEnv.client); - info = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + info = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(info.tokenId).isEqualTo(tokenId); assertThat(info.name).isEqualTo("aaaa"); @@ -118,7 +96,6 @@ void canUpdateToken() throws Exception { assertThat(info.defaultFreezeStatus).isFalse(); assertThat(info.defaultKycStatus).isNotNull(); assertThat(info.defaultKycStatus).isFalse(); - } } @@ -128,23 +105,24 @@ void cannotUpdateImmutableToken() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var response = new TokenCreateTransaction() - .setTokenName("ffff") - .setTokenSymbol("F") - .setTreasuryAccountId(testEnv.operatorId) - .setFreezeDefault(false) - .execute(testEnv.client); + .setTokenName("ffff") + .setTokenSymbol("F") + .setTreasuryAccountId(testEnv.operatorId) + .setFreezeDefault(false) + .execute(testEnv.client); var tokenId = Objects.requireNonNull(response.getReceipt(testEnv.client).tokenId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenName("aaaa") - .setTokenSymbol("A") - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setTokenName("aaaa") + .setTokenSymbol("A") + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); } } @@ -155,13 +133,12 @@ void cannotUpdateImmutableToken() throws Exception { @Test @DisplayName("Can update a fungible token's metadata") void canUpdateFungibleTokenMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; // create a fungible token with metadata - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -173,28 +150,24 @@ void canUpdateFungibleTokenMetadata() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); // update token's metadata new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterMetadataUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterMetadataUpdate = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterMetadataUpdate.metadata).isEqualTo(updatedTokenMetadata); - } } @@ -205,13 +178,12 @@ void canUpdateFungibleTokenMetadata() throws Exception { @Test @DisplayName("Can update a non fungible token's metadata") void canUpdateNonFungibleTokenMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; // create a non fungible token with metadata - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -222,28 +194,24 @@ void canUpdateNonFungibleTokenMetadata() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); // update token's metadata new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterMetadataUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterMetadataUpdate = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterMetadataUpdate.metadata).isEqualTo(updatedTokenMetadata); - } } @@ -254,14 +222,13 @@ void canUpdateNonFungibleTokenMetadata() throws Exception { @Test @DisplayName("Can update an immutable fungible token's metadata") void canUpdateImmutableFungibleTokenMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; var metadataKey = PrivateKey.generateED25519(); // create a fungible token with metadata and metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -273,31 +240,28 @@ void canUpdateImmutableFungibleTokenMetadata() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); - assertThat(tokenInfoAfterCreation.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + assertThat(tokenInfoAfterCreation.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // update token's metadata new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterMetadataUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterMetadataUpdate = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterMetadataUpdate.metadata).isEqualTo(updatedTokenMetadata); - } } @@ -308,14 +272,13 @@ void canUpdateImmutableFungibleTokenMetadata() throws Exception { @Test @DisplayName("Can update an immutable non fungible token's metadata") void canUpdateImmutableNonFungibleTokenMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; var metadataKey = PrivateKey.generateED25519(); // create a non fungible token with metadata and metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -326,31 +289,28 @@ void canUpdateImmutableNonFungibleTokenMetadata() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); - assertThat(tokenInfoAfterCreation.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + assertThat(tokenInfoAfterCreation.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // update token's metadata new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterMetadataUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterMetadataUpdate = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterMetadataUpdate.metadata).isEqualTo(updatedTokenMetadata); - } } @@ -361,12 +321,11 @@ void canUpdateImmutableNonFungibleTokenMetadata() throws Exception { @Test @DisplayName("Cannot update a fungible token with metadata when it is not set") void cannotUpdateFungibleTokenMetadataWhenItsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; // create a fungible token with metadata - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -378,28 +337,24 @@ void cannotUpdateFungibleTokenMetadataWhenItsNotSet() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); // update token, but don't update metadata new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMemo("abc") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMemo("abc") + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterMemoUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterMemoUpdate = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterMemoUpdate.metadata).isEqualTo(initialTokenMetadata); - } } @@ -410,12 +365,11 @@ void cannotUpdateFungibleTokenMetadataWhenItsNotSet() throws Exception { @Test @DisplayName("Cannot update a non fungible token with metadata when it is not set") void cannotUpdateNonFungibleTokenMetadataWhenItsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; // create a non fungible token with metadata - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -426,28 +380,24 @@ void cannotUpdateNonFungibleTokenMetadataWhenItsNotSet() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); // update token, but don't update metadata new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMemo("abc") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMemo("abc") + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterMemoUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterMemoUpdate = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterMemoUpdate.metadata).isEqualTo(initialTokenMetadata); - } } @@ -458,13 +408,12 @@ void cannotUpdateNonFungibleTokenMetadataWhenItsNotSet() throws Exception { @Test @DisplayName("Can erase fungible token metadata") void canEraseFungibleTokenMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var emptyTokenMetadata = new byte[]{}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var emptyTokenMetadata = new byte[] {}; // create a fungible token with metadata - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -476,12 +425,10 @@ void canEraseFungibleTokenMetadata() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); @@ -492,12 +439,10 @@ void canEraseFungibleTokenMetadata() throws Exception { .execute(testEnv.client) .getReceipt(testEnv.client); - var tokenInfoAfterSettingEmptyMetadata = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterSettingEmptyMetadata = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterSettingEmptyMetadata.metadata).isEqualTo(emptyTokenMetadata); - } } @@ -508,13 +453,12 @@ void canEraseFungibleTokenMetadata() throws Exception { @Test @DisplayName("Can erase non fungible token metadata") void canEraseNonFungibleTokenMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var emptyTokenMetadata = new byte[]{}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var emptyTokenMetadata = new byte[] {}; // create a non fungible token with metadata - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -525,28 +469,24 @@ void canEraseNonFungibleTokenMetadata() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoAfterCreation = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterCreation = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterCreation.metadata).isEqualTo(initialTokenMetadata); // erase token metadata (update token with empty metadata) new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(emptyTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setTokenMetadata(emptyTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var tokenInfoAfterSettingEmptyMetadata = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoAfterSettingEmptyMetadata = + new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterSettingEmptyMetadata.metadata).isEqualTo(emptyTokenMetadata); - } } @@ -555,18 +495,18 @@ void canEraseNonFungibleTokenMetadata() throws Exception { * @url https://hips.hedera.com/hip/hip-646 */ @Test - @DisplayName("Cannot update a fungible token with metadata when transaction is not signed with an admin or a metadata key") + @DisplayName( + "Cannot update a fungible token with metadata when transaction is not signed with an admin or a metadata key") void cannotUpdateFungibleTokenMetadataWhenTransactionIsNotSignedWithMetadataKey() throws Exception { try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; var adminKey = PrivateKey.generateED25519(); var metadataKey = PrivateKey.generateED25519(); // create a fungible token with metadata and metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -580,17 +520,17 @@ void cannotUpdateFungibleTokenMetadataWhenTransactionIsNotSignedWithMetadataKey( .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -599,17 +539,17 @@ void cannotUpdateFungibleTokenMetadataWhenTransactionIsNotSignedWithMetadataKey( * @url https://hips.hedera.com/hip/hip-765 */ @Test - @DisplayName("Cannot update a non fungible token with metadata when transaction is not signed with an admin or a metadata key") + @DisplayName( + "Cannot update a non fungible token with metadata when transaction is not signed with an admin or a metadata key") void cannotUpdateNonFungibleTokenMetadataWhenTransactionIsNotSignedWithMetadataKey() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; var adminKey = PrivateKey.generateED25519(); var metadataKey = PrivateKey.generateED25519(); // create a non fungible token with metadata and metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -622,17 +562,17 @@ void cannotUpdateNonFungibleTokenMetadataWhenTransactionIsNotSignedWithMetadataK .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -643,13 +583,12 @@ void cannotUpdateNonFungibleTokenMetadataWhenTransactionIsNotSignedWithMetadataK @Test @DisplayName("Cannot update a fungible token with metadata when admin and metadata keys are not set") void cannotUpdateFungibleTokenMetadataWhenMetadataKeyNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; // create a fungible token with metadata and without a metadata key and admin key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -659,17 +598,17 @@ void cannotUpdateFungibleTokenMetadataWhenMetadataKeyNotSet() throws Exception { .setInitialSupply(1000000) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); } } @@ -680,13 +619,12 @@ void cannotUpdateFungibleTokenMetadataWhenMetadataKeyNotSet() throws Exception { @Test @DisplayName("Cannot update a non fungible token with metadata when admin and metadata keys are not set") void cannotUpdateNonFungibleTokenMetadataWhenMetadataKeyNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - var initialTokenMetadata = new byte[]{1, 1, 1, 1, 1}; - var updatedTokenMetadata = new byte[]{2, 2, 2, 2, 2}; + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { + var initialTokenMetadata = new byte[] {1, 1, 1, 1, 1}; + var updatedTokenMetadata = new byte[] {2, 2, 2, 2, 2}; // create a non fungible token with metadata and without a metadata key and admin key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenMetadata(initialTokenMetadata) @@ -695,17 +633,17 @@ void cannotUpdateNonFungibleTokenMetadataWhenMetadataKeyNotSet() throws Exceptio .setSupplyKey(testEnv.operatorKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setTokenMetadata(updatedTokenMetadata) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - + .tokenId); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setTokenMetadata(updatedTokenMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); } } @@ -714,9 +652,11 @@ void cannotUpdateNonFungibleTokenMetadataWhenMetadataKeyNotSet() throws Exceptio * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can make a token immutable when updating keys to an empty KeyList, signing with an Admin Key, and setting the key verification mode to NO_VALIDATION") - void canMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can make a token immutable when updating keys to an empty KeyList, signing with an Admin Key, and setting the key verification mode to NO_VALIDATION") + void canMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Admin, Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var adminKey = PrivateKey.generateED25519(); @@ -729,8 +669,7 @@ void canMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithK var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -747,45 +686,48 @@ void canMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithK .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); var emptyKeyList = new KeyList(); // Make a token immutable by removing all of its keys when updating them to an empty KeyList, // signing with an Admin Key, and setting the key verification mode to NO_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(emptyKeyList) - .setKycKey(emptyKeyList) - .setFreezeKey(emptyKeyList) - .setPauseKey(emptyKeyList) - .setSupplyKey(emptyKeyList) - .setFeeScheduleKey(emptyKeyList) - .setMetadataKey(emptyKeyList) - .setAdminKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + .setTokenId(tokenId) + .setWipeKey(emptyKeyList) + .setKycKey(emptyKeyList) + .setFreezeKey(emptyKeyList) + .setPauseKey(emptyKeyList) + .setSupplyKey(emptyKeyList) + .setFeeScheduleKey(emptyKeyList) + .setMetadataKey(emptyKeyList) + .setAdminKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterUpdate.adminKey).isNull(); assertThat(tokenInfoAfterUpdate.wipeKey).isNull(); @@ -795,7 +737,6 @@ void canMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithK assertThat(tokenInfoAfterUpdate.supplyKey).isNull(); assertThat(tokenInfoAfterUpdate.feeScheduleKey).isNull(); assertThat(tokenInfoAfterUpdate.metadataKey).isNull(); - } } @@ -804,9 +745,12 @@ void canMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithK * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can remove all of token’s lower-privilege keys when updating keys to an empty KeyList, signing with an Admin Key, and setting the key verification mode to FULL_VALIDATION") - void canRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithKeyVerificationSetToFullValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can remove all of token’s lower-privilege keys when updating keys to an empty KeyList, signing with an Admin Key, and setting the key verification mode to FULL_VALIDATION") + void + canRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithAdminKeyWithKeyVerificationSetToFullValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Admin, Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var adminKey = PrivateKey.generateED25519(); @@ -819,8 +763,7 @@ void canRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithAdmi var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -837,44 +780,47 @@ void canRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithAdmi .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); var emptyKeyList = new KeyList(); // Remove all of token’s lower-privilege keys when updating them to an empty KeyList, // signing with an Admin Key, and setting the key verification mode to FULL_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(emptyKeyList) - .setKycKey(emptyKeyList) - .setFreezeKey(emptyKeyList) - .setPauseKey(emptyKeyList) - .setSupplyKey(emptyKeyList) - .setFeeScheduleKey(emptyKeyList) - .setMetadataKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + .setTokenId(tokenId) + .setWipeKey(emptyKeyList) + .setKycKey(emptyKeyList) + .setFreezeKey(emptyKeyList) + .setPauseKey(emptyKeyList) + .setSupplyKey(emptyKeyList) + .setFeeScheduleKey(emptyKeyList) + .setMetadataKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfoAfterUpdate.wipeKey).isNull(); assertThat(tokenInfoAfterUpdate.kycKey).isNull(); @@ -883,7 +829,6 @@ void canRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithAdmi assertThat(tokenInfoAfterUpdate.supplyKey).isNull(); assertThat(tokenInfoAfterUpdate.feeScheduleKey).isNull(); assertThat(tokenInfoAfterUpdate.metadataKey).isNull(); - } } @@ -892,9 +837,12 @@ void canRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithAdmi * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with an Admin Key, and setting the key verification mode to FULL_VALIDATION, and then revert previous keys") - void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithAdminKeyWithKeyVerificationSetToFullValidationAndThenRevertPreviousKeys() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with an Admin Key, and setting the key verification mode to FULL_VALIDATION, and then revert previous keys") + void + canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithAdminKeyWithKeyVerificationSetToFullValidationAndThenRevertPreviousKeys() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Admin, Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var adminKey = PrivateKey.generateED25519(); @@ -907,8 +855,7 @@ void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithAdminKeyWithKeyVe var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -925,81 +872,96 @@ void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithAdminKeyWithKeyVe .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys to an unusable key (i.e., all-zeros key), // signing with an Admin Key, and setting the key verification mode to FULL_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(PublicKey.unusableKey()) - .setKycKey(PublicKey.unusableKey()) - .setFreezeKey(PublicKey.unusableKey()) - .setPauseKey(PublicKey.unusableKey()) - .setSupplyKey(PublicKey.unusableKey()) - .setFeeScheduleKey(PublicKey.unusableKey()) - .setMetadataKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoAfterUpdate.wipeKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.kycKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.freezeKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.pauseKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.supplyKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.metadataKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); + .setTokenId(tokenId) + .setWipeKey(PublicKey.unusableKey()) + .setKycKey(PublicKey.unusableKey()) + .setFreezeKey(PublicKey.unusableKey()) + .setPauseKey(PublicKey.unusableKey()) + .setSupplyKey(PublicKey.unusableKey()) + .setFeeScheduleKey(PublicKey.unusableKey()) + .setMetadataKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoAfterUpdate.wipeKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.kycKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.freezeKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.pauseKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.supplyKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.metadataKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); // Set all lower-privilege keys back by signing with an Admin Key, // and setting key verification mode to NO_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(wipeKey.getPublicKey()) - .setKycKey(kycKey.getPublicKey()) - .setFreezeKey(freezeKey.getPublicKey()) - .setPauseKey(pauseKey.getPublicKey()) - .setSupplyKey(supplyKey.getPublicKey()) - .setFeeScheduleKey(feeScheduleKey.getPublicKey()) - .setMetadataKey(metadataKey.getPublicKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterRevert = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoAfterRevert.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoAfterRevert.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .setTokenId(tokenId) + .setWipeKey(wipeKey.getPublicKey()) + .setKycKey(kycKey.getPublicKey()) + .setFreezeKey(freezeKey.getPublicKey()) + .setPauseKey(pauseKey.getPublicKey()) + .setSupplyKey(supplyKey.getPublicKey()) + .setFeeScheduleKey(feeScheduleKey.getPublicKey()) + .setMetadataKey(metadataKey.getPublicKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + var tokenInfoAfterRevert = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoAfterRevert.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoAfterRevert.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); } } @@ -1008,9 +970,12 @@ void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithAdminKeyWithKeyVe * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can update all of token’s lower-privilege keys when signing with an Admin Key and new respective lower-privilege key, and setting key verification mode to FULL_VALIDATION") - void canUpdateAllLowerPrivilegeKeysWhenSigningWithAdminKeyAndNewLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can update all of token’s lower-privilege keys when signing with an Admin Key and new respective lower-privilege key, and setting key verification mode to FULL_VALIDATION") + void + canUpdateAllLowerPrivilegeKeysWhenSigningWithAdminKeyAndNewLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Admin, Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var adminKey = PrivateKey.generateED25519(); @@ -1032,8 +997,7 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningWithAdminKeyAndNewLowerPrivilegeKe var newMetadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1050,58 +1014,68 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningWithAdminKeyAndNewLowerPrivilegeKe .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); - - // Update all of token’s lower-privilege keys when signing with an Admin Key and new respective lower-privilege key, + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); + + // Update all of token’s lower-privilege keys when signing with an Admin Key and new respective + // lower-privilege key, // and setting key verification mode to FULL_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(newWipeKey.getPublicKey()) - .setKycKey(newKycKey.getPublicKey()) - .setFreezeKey(newFreezeKey.getPublicKey()) - .setPauseKey(newPauseKey.getPublicKey()) - .setSupplyKey(newSupplyKey.getPublicKey()) - .setFeeScheduleKey(newFeeScheduleKey.getPublicKey()) - .setMetadataKey(newMetadataKey.getPublicKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(adminKey) - .sign(newWipeKey) - .sign(newKycKey) - .sign(newFreezeKey) - .sign(newPauseKey) - .sign(newSupplyKey) - .sign(newFeeScheduleKey) - .sign(newMetadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoAfterUpdate.wipeKey.toString()).isEqualTo(newWipeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.kycKey.toString()).isEqualTo(newKycKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.freezeKey.toString()).isEqualTo(newFreezeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.pauseKey.toString()).isEqualTo(newPauseKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.supplyKey.toString()).isEqualTo(newSupplyKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()).isEqualTo(newFeeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.metadataKey.toString()).isEqualTo(newMetadataKey.getPublicKey().toString()); + .setTokenId(tokenId) + .setWipeKey(newWipeKey.getPublicKey()) + .setKycKey(newKycKey.getPublicKey()) + .setFreezeKey(newFreezeKey.getPublicKey()) + .setPauseKey(newPauseKey.getPublicKey()) + .setSupplyKey(newSupplyKey.getPublicKey()) + .setFeeScheduleKey(newFeeScheduleKey.getPublicKey()) + .setMetadataKey(newMetadataKey.getPublicKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(adminKey) + .sign(newWipeKey) + .sign(newKycKey) + .sign(newFreezeKey) + .sign(newPauseKey) + .sign(newSupplyKey) + .sign(newFeeScheduleKey) + .sign(newMetadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoAfterUpdate.wipeKey.toString()) + .isEqualTo(newWipeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.kycKey.toString()) + .isEqualTo(newKycKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.freezeKey.toString()) + .isEqualTo(newFreezeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.pauseKey.toString()) + .isEqualTo(newPauseKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.supplyKey.toString()) + .isEqualTo(newSupplyKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()) + .isEqualTo(newFeeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.metadataKey.toString()) + .isEqualTo(newMetadataKey.getPublicKey().toString()); } } @@ -1110,9 +1084,12 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningWithAdminKeyAndNewLowerPrivilegeKe * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot make a token immutable when updating keys to an empty KeyList, signing with a key that is different from an Admin Key, and setting the key verification mode to NO_VALIDATION") - void cannotMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithDifferentKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot make a token immutable when updating keys to an empty KeyList, signing with a key that is different from an Admin Key, and setting the key verification mode to NO_VALIDATION") + void + cannotMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithDifferentKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Admin, Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var adminKey = PrivateKey.generateED25519(); @@ -1125,8 +1102,7 @@ void cannotMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithDifferentK var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1143,21 +1119,26 @@ void cannotMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithDifferentK .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); var emptyKeyList = new KeyList(); @@ -1165,78 +1146,93 @@ void cannotMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithDifferentK // (trying to remove keys one by one to check all errors), // signing with a key that is different from an Admin Key (implicitly with an operator key), // and setting the key verification mode to NO_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setAdminKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setAdminKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -1245,9 +1241,12 @@ void cannotMakeTokenImmutableWhenUpdatingKeysToEmptyKeyListSigningWithDifferentK * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot make a token immutable when updating keys to an unusable key (i.e. all-zeros key), signing with a key that is different from an Admin Key, and setting the key verification mode to NO_VALIDATION") - void cannotMakeTokenImmutableWhenUpdatingKeysToUnusableKeySigningWithDifferentKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot make a token immutable when updating keys to an unusable key (i.e. all-zeros key), signing with a key that is different from an Admin Key, and setting the key verification mode to NO_VALIDATION") + void + cannotMakeTokenImmutableWhenUpdatingKeysToUnusableKeySigningWithDifferentKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Admin, Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var adminKey = PrivateKey.generateED25519(); @@ -1260,8 +1259,7 @@ void cannotMakeTokenImmutableWhenUpdatingKeysToUnusableKeySigningWithDifferentKe var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1278,117 +1276,137 @@ void cannotMakeTokenImmutableWhenUpdatingKeysToUnusableKeySigningWithDifferentKe .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Make the token immutable when updating all of its keys to an unusable key (i.e. all-zeros key) // (trying to remove keys one by one to check all errors), // signing with a key that is different from an Admin Key (implicitly with an operator key), // and setting the key verification mode to NO_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setAdminKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + } + } - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); + /** + * @notice E2E-HIP-540 + * @url https://hips.hedera.com/hip/hip-540 + */ + @Test + @DisplayName( + "Cannot update the Admin Key to an unusable key (i.e. all-zeros key), signing with an Admin Key, and setting the key verification mode to NO_VALIDATION") + void cannotUpdateAdminKeyToUnusableKeySigningWithAdminKeyWithKeyVerificationSetToNoValidation() throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setAdminKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - } - } - - /** - * @notice E2E-HIP-540 - * @url https://hips.hedera.com/hip/hip-540 - */ - @Test - @DisplayName("Cannot update the Admin Key to an unusable key (i.e. all-zeros key), signing with an Admin Key, and setting the key verification mode to NO_VALIDATION") - void cannotUpdateAdminKeyToUnusableKeySigningWithAdminKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ - - // Admin and supply keys - var adminKey = PrivateKey.generateED25519(); - var supplyKey = PrivateKey.generateED25519(); + // Admin and supply keys + var adminKey = PrivateKey.generateED25519(); + var supplyKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1399,28 +1417,27 @@ void cannotUpdateAdminKeyToUnusableKeySigningWithAdminKeyWithKeyVerificationSetT .sign(adminKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); - assertThat(tokenInfoBeforeUpdate.adminKey.toString()).isEqualTo(adminKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.adminKey.toString()) + .isEqualTo(adminKey.getPublicKey().toString()); // Update the Admin Key to an unusable key (i.e., all-zeros key), // signing with an Admin Key, and setting the key verification mode to NO_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setAdminKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(adminKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setAdminKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(adminKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -1429,9 +1446,12 @@ void cannotUpdateAdminKeyToUnusableKeySigningWithAdminKeyWithKeyVerificationSetT * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with a respective lower-privilege key, and setting the key verification mode to NO_VALIDATION") - void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithRespectiveLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with a respective lower-privilege key, and setting the key verification mode to NO_VALIDATION") + void + canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithRespectiveLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -1443,8 +1463,7 @@ void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithRespectiveLowerPr var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1458,57 +1477,65 @@ void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithRespectiveLowerPr .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys to an unusable key (i.e., all-zeros key), // when signing with a respective lower-privilege key, // and setting the key verification mode to NO_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(PublicKey.unusableKey()) - .setKycKey(PublicKey.unusableKey()) - .setFreezeKey(PublicKey.unusableKey()) - .setPauseKey(PublicKey.unusableKey()) - .setSupplyKey(PublicKey.unusableKey()) - .setFeeScheduleKey(PublicKey.unusableKey()) - .setMetadataKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .sign(kycKey) - .sign(freezeKey) - .sign(pauseKey) - .sign(supplyKey) - .sign(feeScheduleKey) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoAfterUpdate.wipeKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.kycKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.freezeKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.pauseKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.supplyKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); - assertThat(tokenInfoAfterUpdate.metadataKey.toString()).isEqualTo(PublicKey.unusableKey().toString()); + .setTokenId(tokenId) + .setWipeKey(PublicKey.unusableKey()) + .setKycKey(PublicKey.unusableKey()) + .setFreezeKey(PublicKey.unusableKey()) + .setPauseKey(PublicKey.unusableKey()) + .setSupplyKey(PublicKey.unusableKey()) + .setFeeScheduleKey(PublicKey.unusableKey()) + .setMetadataKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .sign(kycKey) + .sign(freezeKey) + .sign(pauseKey) + .sign(supplyKey) + .sign(feeScheduleKey) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + assertThat(tokenInfoAfterUpdate.wipeKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.kycKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.freezeKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.pauseKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.supplyKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); + assertThat(tokenInfoAfterUpdate.metadataKey.toString()) + .isEqualTo(PublicKey.unusableKey().toString()); } } @@ -1517,9 +1544,12 @@ void canUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithRespectiveLowerPr * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can update all of token’s lower-privilege keys when signing with an old lower-privilege key and with a new lower-privilege key, and setting key verification mode to FULL_VALIDATION") - void canUpdateAllLowerPrivilegeKeysWhenSigningWithOldLowerPrivilegeKeyAndNewLowerPrivilegeKeyWithKeyVerificationSetToFulValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can update all of token’s lower-privilege keys when signing with an old lower-privilege key and with a new lower-privilege key, and setting key verification mode to FULL_VALIDATION") + void + canUpdateAllLowerPrivilegeKeysWhenSigningWithOldLowerPrivilegeKeyAndNewLowerPrivilegeKeyWithKeyVerificationSetToFulValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -1540,8 +1570,7 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningWithOldLowerPrivilegeKeyAndNewLowe var newMetadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1555,63 +1584,71 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningWithOldLowerPrivilegeKeyAndNewLowe .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys when signing with an old respective lower-privilege key, // and setting key verification mode to NO_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(newWipeKey.getPublicKey()) - .setKycKey(newKycKey.getPublicKey()) - .setFreezeKey(newFreezeKey.getPublicKey()) - .setPauseKey(newPauseKey.getPublicKey()) - .setSupplyKey(newSupplyKey.getPublicKey()) - .setFeeScheduleKey(newFeeScheduleKey.getPublicKey()) - .setMetadataKey(newMetadataKey.getPublicKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .sign(newWipeKey) - .sign(kycKey) - .sign(newKycKey) - .sign(freezeKey) - .sign(newFreezeKey) - .sign(pauseKey) - .sign(newPauseKey) - .sign(supplyKey) - .sign(newSupplyKey) - .sign(feeScheduleKey) - .sign(newFeeScheduleKey) - .sign(metadataKey) - .sign(newMetadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoAfterUpdate.wipeKey.toString()).isEqualTo(newWipeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.kycKey.toString()).isEqualTo(newKycKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.freezeKey.toString()).isEqualTo(newFreezeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.pauseKey.toString()).isEqualTo(newPauseKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.supplyKey.toString()).isEqualTo(newSupplyKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()).isEqualTo(newFeeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.metadataKey.toString()).isEqualTo(newMetadataKey.getPublicKey().toString()); + .setTokenId(tokenId) + .setWipeKey(newWipeKey.getPublicKey()) + .setKycKey(newKycKey.getPublicKey()) + .setFreezeKey(newFreezeKey.getPublicKey()) + .setPauseKey(newPauseKey.getPublicKey()) + .setSupplyKey(newSupplyKey.getPublicKey()) + .setFeeScheduleKey(newFeeScheduleKey.getPublicKey()) + .setMetadataKey(newMetadataKey.getPublicKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .sign(newWipeKey) + .sign(kycKey) + .sign(newKycKey) + .sign(freezeKey) + .sign(newFreezeKey) + .sign(pauseKey) + .sign(newPauseKey) + .sign(supplyKey) + .sign(newSupplyKey) + .sign(feeScheduleKey) + .sign(newFeeScheduleKey) + .sign(metadataKey) + .sign(newMetadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoAfterUpdate.wipeKey.toString()) + .isEqualTo(newWipeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.kycKey.toString()) + .isEqualTo(newKycKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.freezeKey.toString()) + .isEqualTo(newFreezeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.pauseKey.toString()) + .isEqualTo(newPauseKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.supplyKey.toString()) + .isEqualTo(newSupplyKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()) + .isEqualTo(newFeeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.metadataKey.toString()) + .isEqualTo(newMetadataKey.getPublicKey().toString()); } } @@ -1620,9 +1657,11 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningWithOldLowerPrivilegeKeyAndNewLowe * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Can update all of token’s lower-privilege keys when signing ONLY with an old lower-privilege key, and setting key verification mode to NO_VALIDATION") - void canUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Can update all of token’s lower-privilege keys when signing ONLY with an old lower-privilege key, and setting key verification mode to NO_VALIDATION") + void canUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -1643,8 +1682,7 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldLowerPrivilegeKeyWithKe var newMetadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1658,56 +1696,64 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldLowerPrivilegeKeyWithKe .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys when signing with an old respective lower-privilege key, // and setting key verification mode to NO_VALIDATION new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(newWipeKey.getPublicKey()) - .setKycKey(newKycKey.getPublicKey()) - .setFreezeKey(newFreezeKey.getPublicKey()) - .setPauseKey(newPauseKey.getPublicKey()) - .setSupplyKey(newSupplyKey.getPublicKey()) - .setFeeScheduleKey(newFeeScheduleKey.getPublicKey()) - .setMetadataKey(newMetadataKey.getPublicKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .sign(kycKey) - .sign(freezeKey) - .sign(pauseKey) - .sign(supplyKey) - .sign(feeScheduleKey) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var tokenInfoAfterUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoAfterUpdate.wipeKey.toString()).isEqualTo(newWipeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.kycKey.toString()).isEqualTo(newKycKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.freezeKey.toString()).isEqualTo(newFreezeKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.pauseKey.toString()).isEqualTo(newPauseKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.supplyKey.toString()).isEqualTo(newSupplyKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()).isEqualTo(newFeeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoAfterUpdate.metadataKey.toString()).isEqualTo(newMetadataKey.getPublicKey().toString()); + .setTokenId(tokenId) + .setWipeKey(newWipeKey.getPublicKey()) + .setKycKey(newKycKey.getPublicKey()) + .setFreezeKey(newFreezeKey.getPublicKey()) + .setPauseKey(newPauseKey.getPublicKey()) + .setSupplyKey(newSupplyKey.getPublicKey()) + .setFeeScheduleKey(newFeeScheduleKey.getPublicKey()) + .setMetadataKey(newMetadataKey.getPublicKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .sign(kycKey) + .sign(freezeKey) + .sign(pauseKey) + .sign(supplyKey) + .sign(feeScheduleKey) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + + var tokenInfoAfterUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + assertThat(tokenInfoAfterUpdate.wipeKey.toString()) + .isEqualTo(newWipeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.kycKey.toString()) + .isEqualTo(newKycKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.freezeKey.toString()) + .isEqualTo(newFreezeKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.pauseKey.toString()) + .isEqualTo(newPauseKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.supplyKey.toString()) + .isEqualTo(newSupplyKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.feeScheduleKey.toString()) + .isEqualTo(newFeeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoAfterUpdate.metadataKey.toString()) + .isEqualTo(newMetadataKey.getPublicKey().toString()); } } @@ -1716,9 +1762,12 @@ void canUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldLowerPrivilegeKeyWithKe * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot remove all of token’s lower-privilege keys when updating them to an empty KeyList, signing with a respective lower-privilege key, and setting the key verification mode to NO_VALIDATION") - void cannotRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithRespectiveLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot remove all of token’s lower-privilege keys when updating them to an empty KeyList, signing with a respective lower-privilege key, and setting the key verification mode to NO_VALIDATION") + void + cannotRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithRespectiveLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -1730,8 +1779,7 @@ void cannotRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithR var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1745,20 +1793,24 @@ void cannotRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithR .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); var emptyKeyList = new KeyList(); @@ -1766,83 +1818,96 @@ void cannotRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithR // when updating them to an empty KeyList (trying to remove keys one by one to check all errors), // signing with a respective lower-privilege key, // and setting the key verification mode to NO_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(kycKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(freezeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(pauseKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(supplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(feeScheduleKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(emptyKeyList) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(kycKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(freezeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(pauseKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(supplyKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(feeScheduleKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(emptyKeyList) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.TOKEN_IS_IMMUTABLE.toString()); } } @@ -1851,9 +1916,11 @@ void cannotRemoveAllLowerPrivilegeKeysWhenUpdatingKeysToEmptyKeyListSigningWithR * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with a key that is different from a respective lower-privilege key, and setting the key verification mode to NO_VALIDATION") - void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithDifferentKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with a key that is different from a respective lower-privilege key, and setting the key verification mode to NO_VALIDATION") + void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithDifferentKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -1865,8 +1932,7 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithDifferentKeyWi var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1880,88 +1946,106 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithDifferentKeyWi .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key) // (trying to remove keys one by one to check all errors), - // signing with a key that is different from a respective lower-privilege key (implicitly with an operator key), + // signing with a key that is different from a respective lower-privilege key (implicitly with an operator + // key), // and setting the key verification mode to NO_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -1970,9 +2054,12 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithDifferentKeyWi * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing ONLY with an old respective lower-privilege key, and setting the key verification mode to FULL_VALIDATION") - void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningOnlyWithOldRespectiveLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing ONLY with an old respective lower-privilege key, and setting the key verification mode to FULL_VALIDATION") + void + cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningOnlyWithOldRespectiveLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -1984,8 +2071,7 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningOnlyWithOldRespect var metadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -1999,102 +2085,119 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningOnlyWithOldRespect .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys to an unusable key (i.e., all-zeros key) // (trying to remove keys one by one to check all errors), // signing ONLY with an old respective lower-privilege key, // and setting the key verification mode to FULL_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(kycKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(freezeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(pauseKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(supplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(feeScheduleKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(kycKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(freezeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(pauseKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(supplyKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(feeScheduleKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -2103,9 +2206,12 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningOnlyWithOldRespect * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with an old respective lower-privilege key and new respective lower-privilege key, and setting the key verification mode to FULL_VALIDATION") - void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithOldRespectiveLowerPrivilegeKeyAndNewRespectiveLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot update all of token’s lower-privilege keys to an unusable key (i.e. all-zeros key), when signing with an old respective lower-privilege key and new respective lower-privilege key, and setting the key verification mode to FULL_VALIDATION") + void + cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithOldRespectiveLowerPrivilegeKeyAndNewRespectiveLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -2126,8 +2232,7 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithOldRespectiveL var newMetadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -2141,109 +2246,126 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithOldRespectiveL .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys to an unusable key (i.e., all-zeros key) // (trying to remove keys one by one to check all errors), // signing with an old respective lower-privilege key and new respective lower-privilege key, // and setting the key verification mode to FULL_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .sign(newWipeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(kycKey) - .sign(newKycKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(freezeKey) - .sign(newFreezeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(pauseKey) - .sign(newPauseKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(supplyKey) - .sign(newSupplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(feeScheduleKey) - .sign(newFeeScheduleKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(PublicKey.unusableKey()) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(metadataKey) - .sign(newMetadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .sign(newWipeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(kycKey) + .sign(newKycKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(freezeKey) + .sign(newFreezeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(pauseKey) + .sign(newPauseKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(supplyKey) + .sign(newSupplyKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(feeScheduleKey) + .sign(newFeeScheduleKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(PublicKey.unusableKey()) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(metadataKey) + .sign(newMetadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -2252,9 +2374,12 @@ void cannotUpdateAllLowerPrivilegeKeysToUnusableKeyWhenSigningWithOldRespectiveL * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot update all of token’s lower-privilege keys, when signing ONLY with an old respective lower-privilege key, and setting the key verification mode to FULL_VALIDATION") - void cannotUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldRespectiveLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot update all of token’s lower-privilege keys, when signing ONLY with an old respective lower-privilege key, and setting the key verification mode to FULL_VALIDATION") + void + cannotUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldRespectiveLowerPrivilegeKeyWithKeyVerificationSetToFullValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -2275,8 +2400,7 @@ void cannotUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldRespectiveLowerPrivi var newMetadataKey = PrivateKey.generateED25519(); // Create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -2290,102 +2414,119 @@ void cannotUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldRespectiveLowerPrivi .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // Update all of token’s lower-privilege keys // (trying to update keys one by one to check all errors), // signing ONLY with an old respective lower-privilege key, // and setting the key verification mode to FULL_VALIDATION - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(newWipeKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(newKycKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(kycKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(newFreezeKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(freezeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(newPauseKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(pauseKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(newSupplyKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(supplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(newFeeScheduleKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(feeScheduleKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(newMetadataKey) - .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(newWipeKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(newKycKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(kycKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(newFreezeKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(freezeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(newPauseKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(pauseKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(newSupplyKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(supplyKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(newFeeScheduleKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(feeScheduleKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(newMetadataKey) + .setKeyVerificationMode(TokenKeyValidation.FULL_VALIDATION) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -2394,9 +2535,12 @@ void cannotUpdateAllLowerPrivilegeKeysWhenSigningOnlyWithOldRespectiveLowerPrivi * @url https://hips.hedera.com/hip/hip-540 */ @Test - @DisplayName("Cannot update all of token’s lower-privilege keys when updating them to a keys with an invalid structure and signing with an old respective lower-privilege and setting key verification mode to NO_VALIDATION") - void cannotUpdateAllLowerPrivilegeKeysWhenUpdatingKeysToStructurallyInvalidKeysSigningOnlyWithOldRespectiveLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + @DisplayName( + "Cannot update all of token’s lower-privilege keys when updating them to a keys with an invalid structure and signing with an old respective lower-privilege and setting key verification mode to NO_VALIDATION") + void + cannotUpdateAllLowerPrivilegeKeysWhenUpdatingKeysToStructurallyInvalidKeysSigningOnlyWithOldRespectiveLowerPrivilegeKeyWithKeyVerificationSetToNoValidation() + throws Exception { + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { // Wipe, KYC, Freeze, Pause, Supply, Fee Schedule, Metadata keys var wipeKey = PrivateKey.generateED25519(); @@ -2408,8 +2552,7 @@ void cannotUpdateAllLowerPrivilegeKeysWhenUpdatingKeysToStructurallyInvalidKeysS var metadataKey = PrivateKey.generateED25519(); // create a non-fungible token - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("Test NFT") .setTokenSymbol("TNFT") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -2423,20 +2566,24 @@ void cannotUpdateAllLowerPrivilegeKeysWhenUpdatingKeysToStructurallyInvalidKeysS .setMetadataKey(metadataKey.getPublicKey()) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); - - var tokenInfoBeforeUpdate = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); - - assertThat(tokenInfoBeforeUpdate.wipeKey.toString()).isEqualTo(wipeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.kycKey.toString()).isEqualTo(kycKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.freezeKey.toString()).isEqualTo(freezeKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.pauseKey.toString()).isEqualTo(pauseKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.supplyKey.toString()).isEqualTo(supplyKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()).isEqualTo(feeScheduleKey.getPublicKey().toString()); - assertThat(tokenInfoBeforeUpdate.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + .tokenId); + + var tokenInfoBeforeUpdate = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); + + assertThat(tokenInfoBeforeUpdate.wipeKey.toString()) + .isEqualTo(wipeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.kycKey.toString()) + .isEqualTo(kycKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.freezeKey.toString()) + .isEqualTo(freezeKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.pauseKey.toString()) + .isEqualTo(pauseKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.supplyKey.toString()) + .isEqualTo(supplyKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.feeScheduleKey.toString()) + .isEqualTo(feeScheduleKey.getPublicKey().toString()); + assertThat(tokenInfoBeforeUpdate.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // invalid ecdsa key var ecdsaKey = PublicKey.fromBytesECDSA(new byte[33]); @@ -2445,83 +2592,96 @@ void cannotUpdateAllLowerPrivilegeKeysWhenUpdatingKeysToStructurallyInvalidKeysS // to a structurally invalid key (trying to update keys one by one to check all errors), // signing with an old respective lower-privilege // and setting key verification mode to NO_VALIDATION - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setWipeKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(wipeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_WIPE_KEY.toString()); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setKycKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(kycKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_KYC_KEY.toString()); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFreezeKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(freezeKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_FREEZE_KEY.toString()); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setPauseKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(pauseKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_PAUSE_KEY.toString()); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setSupplyKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(supplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SUPPLY_KEY.toString()); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setFeeScheduleKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(feeScheduleKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_CUSTOM_FEE_SCHEDULE_KEY.toString()); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenUpdateTransaction() - .setTokenId(tokenId) - .setMetadataKey(ecdsaKey) - .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_METADATA_KEY.toString()); - + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setWipeKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(wipeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_WIPE_KEY.toString()); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setKycKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(kycKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_KYC_KEY.toString()); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFreezeKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(freezeKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_FREEZE_KEY.toString()); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setPauseKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(pauseKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_PAUSE_KEY.toString()); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setSupplyKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(supplyKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SUPPLY_KEY.toString()); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setFeeScheduleKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(feeScheduleKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_CUSTOM_FEE_SCHEDULE_KEY.toString()); + + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenUpdateTransaction() + .setTokenId(tokenId) + .setMetadataKey(ecdsaKey) + .setKeyVerificationMode(TokenKeyValidation.NO_VALIDATION) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_METADATA_KEY.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java index 6b9700ff55..7b74fae076 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; @@ -48,17 +30,16 @@ public class TokenUpdateNftsIntegrationTest { @Test @DisplayName("Can update the metadata of the entire NFT collection") void canUpdateNFTMetadataOfEntireCollection() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var metadataKey = PrivateKey.generateED25519(); var nftCount = 4; - var initialMetadataList = NftMetadataGenerator.generate(new byte[]{4, 2, 0}, nftCount); - var updatedMetadata = new byte[]{6, 9}; + var initialMetadataList = NftMetadataGenerator.generate(new byte[] {4, 2, 0}, nftCount); + var updatedMetadata = new byte[] {6, 9}; var updatedMetadataList = NftMetadataGenerator.generate(updatedMetadata, nftCount); // create a token with metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -68,15 +49,14 @@ void canUpdateNFTMetadataOfEntireCollection() throws Exception { .setMetadataKey(metadataKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); // mint tokens var tokenMintTransactionReceipt = new TokenMintTransaction() - .setMetadata(initialMetadataList) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setMetadata(initialMetadataList) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check that metadata was set correctly var nftSerials = tokenMintTransactionReceipt.serials; @@ -86,35 +66,33 @@ void canUpdateNFTMetadataOfEntireCollection() throws Exception { // update metadata all minted NFTs new TokenUpdateNftsTransaction() - .setTokenId(tokenId) - .setSerials(nftSerials) - .setMetadata(updatedMetadata) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setSerials(nftSerials) + .setMetadata(updatedMetadata) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check updated NFTs' metadata List metadataListAfterUpdate = getMetadataList(testEnv.client, tokenId, nftSerials); assertThat(metadataListAfterUpdate.toArray()).isEqualTo(updatedMetadataList.toArray()); - } } @Test @DisplayName("Can update the metadata of a part of the NFT collection") void canUpdateNFTMetadataOfPartOfCollection() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var metadataKey = PrivateKey.generateED25519(); var nftCount = 4; - var initialMetadataList = NftMetadataGenerator.generate(new byte[]{4, 2, 0}, nftCount); - var updatedMetadata = new byte[]{6, 9}; + var initialMetadataList = NftMetadataGenerator.generate(new byte[] {4, 2, 0}, nftCount); + var updatedMetadata = new byte[] {6, 9}; var updatedMetadataList = NftMetadataGenerator.generate(updatedMetadata, nftCount / 2); // create a token with metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -124,15 +102,14 @@ void canUpdateNFTMetadataOfPartOfCollection() throws Exception { .setMetadataKey(metadataKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); // mint tokens var tokenMintTransactionReceipt = new TokenMintTransaction() - .setMetadata(initialMetadataList) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setMetadata(initialMetadataList) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check that metadata was set correctly var nftSerials = tokenMintTransactionReceipt.serials; @@ -144,13 +121,13 @@ void canUpdateNFTMetadataOfPartOfCollection() throws Exception { var nftSerialsToUpdate = nftSerials.subList(0, nftCount / 2); new TokenUpdateNftsTransaction() - .setTokenId(tokenId) - .setSerials(nftSerialsToUpdate) - .setMetadata(updatedMetadata) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setSerials(nftSerialsToUpdate) + .setMetadata(updatedMetadata) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check updated NFTs' metadata List metadataListAfterUpdate = getMetadataList(testEnv.client, tokenId, nftSerialsToUpdate); @@ -161,23 +138,23 @@ void canUpdateNFTMetadataOfPartOfCollection() throws Exception { var nftSerialsSame = nftSerials.subList(nftCount / 2, nftCount); List metadataList = getMetadataList(testEnv.client, tokenId, nftSerialsSame); - assertThat(metadataList.toArray()).isEqualTo(initialMetadataList.subList(nftCount / 2, nftCount).toArray()); - + assertThat(metadataList.toArray()) + .isEqualTo( + initialMetadataList.subList(nftCount / 2, nftCount).toArray()); } } @Test @DisplayName("Cannot update NFTs metadata when it is not set") void cannotUpdateNFTMetadataWhenItsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var metadataKey = PrivateKey.generateED25519(); var nftCount = 4; - var initialMetadataList = NftMetadataGenerator.generate(new byte[]{4, 2, 0}, nftCount); + var initialMetadataList = NftMetadataGenerator.generate(new byte[] {4, 2, 0}, nftCount); // create a token with metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -187,15 +164,14 @@ void cannotUpdateNFTMetadataWhenItsNotSet() throws Exception { .setMetadataKey(metadataKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); // mint tokens var tokenMintTransactionReceipt = new TokenMintTransaction() - .setMetadata(initialMetadataList) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setMetadata(initialMetadataList) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check that metadata was set correctly var nftSerials = tokenMintTransactionReceipt.serials; @@ -205,34 +181,32 @@ void cannotUpdateNFTMetadataWhenItsNotSet() throws Exception { // run `TokenUpdateNftsTransaction` without `setMetadata` new TokenUpdateNftsTransaction() - .setTokenId(tokenId) - .setSerials(nftSerials) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setSerials(nftSerials) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check that NFTs' metadata was not updated List metadataListAfterUpdate = getMetadataList(testEnv.client, tokenId, nftSerials); assertThat(metadataListAfterUpdate.toArray()).isEqualTo(initialMetadataList.toArray()); - } } @Test @DisplayName("Can erase NFTs metadata") void canEraseNFTsMetadata() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var metadataKey = PrivateKey.generateED25519(); var nftCount = 4; - var initialMetadataList = NftMetadataGenerator.generate(new byte[]{4, 2, 0}, nftCount); - var emptyMetadata = new byte[]{}; + var initialMetadataList = NftMetadataGenerator.generate(new byte[] {4, 2, 0}, nftCount); + var emptyMetadata = new byte[] {}; var emptyMetadataList = NftMetadataGenerator.generate(emptyMetadata, nftCount); // create a token with metadata key - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -242,15 +216,14 @@ void canEraseNFTsMetadata() throws Exception { .setMetadataKey(metadataKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); // mint tokens var tokenMintTransactionReceipt = new TokenMintTransaction() - .setMetadata(initialMetadataList) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setMetadata(initialMetadataList) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check that metadata was set correctly var nftSerials = tokenMintTransactionReceipt.serials; @@ -260,35 +233,33 @@ void canEraseNFTsMetadata() throws Exception { // erase metadata all minted NFTs (update to an empty byte array) new TokenUpdateNftsTransaction() - .setTokenId(tokenId) - .setSerials(nftSerials) - .setMetadata(emptyMetadata) - .freezeWith(testEnv.client) - .sign(metadataKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setSerials(nftSerials) + .setMetadata(emptyMetadata) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); // check that NFTs' metadata was erased List metadataListAfterUpdate = getMetadataList(testEnv.client, tokenId, nftSerials); assertThat(metadataListAfterUpdate.toArray()).isEqualTo(emptyMetadataList.toArray()); - } } @Test @DisplayName("Cannot update NFT metadata when transaction is not signed with metadata key") void cannotUpdateNFTMetadataWhenTransactionIsNotSignedWithMetadataKey() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var supplyKey = PrivateKey.generateED25519(); var metadataKey = PrivateKey.generateED25519(); var nftCount = 4; - var initialMetadataList = NftMetadataGenerator.generate(new byte[]{4, 2, 0}, nftCount); - var updatedMetadata = new byte[]{6, 9}; + var initialMetadataList = NftMetadataGenerator.generate(new byte[] {4, 2, 0}, nftCount); + var updatedMetadata = new byte[] {6, 9}; // create a token with a metadata key and check it - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -298,53 +269,51 @@ void cannotUpdateNFTMetadataWhenTransactionIsNotSignedWithMetadataKey() throws E .setMetadataKey(metadataKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfo = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfo = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); - assertThat(tokenInfo.metadataKey.toString()).isEqualTo(metadataKey.getPublicKey().toString()); + assertThat(tokenInfo.metadataKey.toString()) + .isEqualTo(metadataKey.getPublicKey().toString()); // mint tokens var tokenMintTransactionReceipt = new TokenMintTransaction() - .setMetadata(initialMetadataList) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(supplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var nftSerials = tokenMintTransactionReceipt.serials; - - // update nfts without signing - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateNftsTransaction() + .setMetadata(initialMetadataList) .setTokenId(tokenId) - .setSerials(nftSerials) - .setMetadata(updatedMetadata) + .freezeWith(testEnv.client) + .sign(supplyKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); + var nftSerials = tokenMintTransactionReceipt.serials; + + // update nfts without signing + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateNftsTransaction() + .setTokenId(tokenId) + .setSerials(nftSerials) + .setMetadata(updatedMetadata) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @Test @DisplayName("Cannot update NFT metadata when metadata key is not set") void cannotUpdateNFTMetadataWhenMetadataKeyNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var supplyKey = PrivateKey.generateED25519(); var metadataKey = PrivateKey.generateED25519(); var nftCount = 4; - var initialMetadataList = NftMetadataGenerator.generate(new byte[]{4, 2, 0}, nftCount); - var updatedMetadata = new byte[]{6, 9}; + var initialMetadataList = NftMetadataGenerator.generate(new byte[] {4, 2, 0}, nftCount); + var updatedMetadata = new byte[] {6, 9}; // create a token without a metadata key and check it - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -353,38 +322,36 @@ void cannotUpdateNFTMetadataWhenMetadataKeyNotSet() throws Exception { .setSupplyKey(supplyKey) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); - var tokenInfo = new TokenInfoQuery() - .setTokenId(tokenId) - .execute(testEnv.client); + var tokenInfo = new TokenInfoQuery().setTokenId(tokenId).execute(testEnv.client); assertThat(tokenInfo.metadataKey).isNull(); // mint tokens var tokenMintTransactionReceipt = new TokenMintTransaction() - .setMetadata(initialMetadataList) - .setTokenId(tokenId) - .freezeWith(testEnv.client) - .sign(supplyKey) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var nftSerials = tokenMintTransactionReceipt.serials; - - // check NFTs' metadata can't be updated when a metadata key is not set - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenUpdateNftsTransaction() + .setMetadata(initialMetadataList) .setTokenId(tokenId) - .setSerials(nftSerials) - .setMetadata(updatedMetadata) .freezeWith(testEnv.client) - .sign(metadataKey) + .sign(supplyKey) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_SIGNATURE.toString()); + var nftSerials = tokenMintTransactionReceipt.serials; + + // check NFTs' metadata can't be updated when a metadata key is not set + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenUpdateNftsTransaction() + .setTokenId(tokenId) + .setSerials(nftSerials) + .setMetadata(updatedMetadata) + .freezeWith(testEnv.client) + .sign(metadataKey) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_SIGNATURE.toString()); } } @@ -398,17 +365,15 @@ void cannotUpdateNFTMetadataWhenMetadataKeyNotSet() throws Exception { */ private List getMetadataList(Client client, TokenId tokenId, List nftSerials) { return nftSerials.stream() - .map(serial -> new NftId(tokenId, serial)) - .flatMap(nftId -> { - try { - return new TokenNftInfoQuery() - .setNftId(nftId) - .execute(client).stream(); - } catch (Exception e) { - throw new RuntimeException(e); - } - }) - .map(tokenNftInfo -> tokenNftInfo.metadata) - .toList(); + .map(serial -> new NftId(tokenId, serial)) + .flatMap(nftId -> { + try { + return new TokenNftInfoQuery().setNftId(nftId).execute(client).stream(); + } catch (Exception e) { + throw new RuntimeException(e); + } + }) + .map(tokenNftInfo -> tokenNftInfo.metadata) + .toList(); } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java index 3b4a2f2f3c..39bc8e5cff 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java @@ -1,24 +1,9 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.Hbar; import com.hiero.sdk.PrecheckStatusException; @@ -32,32 +17,27 @@ import com.hiero.sdk.TokenType; import com.hiero.sdk.TokenWipeTransaction; import com.hiero.sdk.TransferTransaction; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - import java.util.Collections; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; class TokenWipeIntegrationTest { @Test @DisplayName("Can wipe accounts balance") void canWipeAccountsBalance() throws Exception { - try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -71,56 +51,52 @@ void canWipeAccountsBalance() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, accountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, accountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenWipeTransaction() - .setTokenId(tokenId) - .setAccountId(accountId) - .setAmount(10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId) + .setAccountId(accountId) + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } - @Test @DisplayName("Can wipe accounts NFTs") void canWipeAccountsNfts() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -133,28 +109,27 @@ void canWipeAccountsNfts() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); var serialsToTransfer = mintReceipt.serials.subList(0, 4); var transfer = new TransferTransaction(); @@ -164,32 +139,29 @@ void canWipeAccountsNfts() throws Exception { transfer.execute(testEnv.client).getReceipt(testEnv.client); new TokenWipeTransaction() - .setTokenId(tokenId) - .setAccountId(accountId) - .setSerials(serialsToTransfer) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTokenId(tokenId) + .setAccountId(accountId) + .setSerials(serialsToTransfer) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } - @Test @DisplayName("Cannot wipe accounts NFTs if the account doesn't own them") void cannotWipeAccountsNftsIfNotOwned() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setTokenType(TokenType.NON_FUNGIBLE_UNIQUE) @@ -202,60 +174,59 @@ void cannotWipeAccountsNftsIfNotOwned() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); var mintReceipt = new TokenMintTransaction() - .setTokenId(tokenId) - .setMetadata(NftMetadataGenerator.generate((byte) 10)) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setMetadata(NftMetadataGenerator.generate((byte) 10)) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - var serialsToTransfer = mintReceipt.serials.subList(0, 4); - // don't transfer them - - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TokenWipeTransaction() - .setTokenId(tokenId) .setAccountId(accountId) - .setSerials(serialsToTransfer) + .setTokenId(tokenId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.ACCOUNT_DOES_NOT_OWN_WIPED_NFT.toString()); + var serialsToTransfer = mintReceipt.serials.subList(0, 4); + // don't transfer them + + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TokenWipeTransaction() + .setTokenId(tokenId) + .setAccountId(accountId) + .setSerials(serialsToTransfer) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.ACCOUNT_DOES_NOT_OWN_WIPED_NFT.toString()); } } @Test @DisplayName("Cannot wipe accounts balance when account ID is not set") void cannotWipeAccountsBalanceWhenAccountIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -269,56 +240,55 @@ void cannotWipeAccountsBalanceWhenAccountIDIsNotSet() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, accountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenWipeTransaction() - .setTokenId(tokenId) - .setAmount(10) + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, accountId, 10) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenWipeTransaction() + .setTokenId(tokenId) + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_ACCOUNT_ID.toString()); } } @Test @DisplayName("Cannot wipe accounts balance when token ID is not set") void cannotWipeAccountsBalanceWhenTokenIDIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -332,56 +302,55 @@ void cannotWipeAccountsBalanceWhenTokenIDIsNotSet() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, accountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TokenWipeTransaction() - .setAccountId(accountId) - .setAmount(10) + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, accountId, 10) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOKEN_ID.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TokenWipeTransaction() + .setAccountId(accountId) + .setAmount(10) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOKEN_ID.toString()); } } @Test @DisplayName("Can wipe accounts balance when amount is not set") void canWipeAccountsBalanceWhenAmountIsNotSet() throws Exception { - try(var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()){ + try (var testEnv = new IntegrationTestEnv(1).useThrowawayAccount()) { var key = PrivateKey.generateED25519(); var response = new AccountCreateTransaction() - .setKey(key) - .setInitialBalance(new Hbar(1)) - .execute(testEnv.client); + .setKey(key) + .setInitialBalance(new Hbar(1)) + .execute(testEnv.client); var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId); - var tokenId = Objects.requireNonNull( - new TokenCreateTransaction() + var tokenId = Objects.requireNonNull(new TokenCreateTransaction() .setTokenName("ffff") .setTokenSymbol("F") .setDecimals(3) @@ -395,38 +364,35 @@ void canWipeAccountsBalanceWhenAmountIsNotSet() throws Exception { .setFreezeDefault(false) .execute(testEnv.client) .getReceipt(testEnv.client) - .tokenId - ); + .tokenId); new TokenAssociateTransaction() - .setAccountId(accountId) - .setTokenIds(Collections.singletonList(tokenId)) - .freezeWith(testEnv.client) - .sign(key) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenIds(Collections.singletonList(tokenId)) + .freezeWith(testEnv.client) + .sign(key) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TokenGrantKycTransaction() - .setAccountId(accountId) - .setTokenId(tokenId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setAccountId(accountId) + .setTokenId(tokenId) + .execute(testEnv.client) + .getReceipt(testEnv.client); new TransferTransaction() - .addTokenTransfer(tokenId, testEnv.operatorId, -10) - .addTokenTransfer(tokenId, accountId, 10) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .addTokenTransfer(tokenId, testEnv.operatorId, -10) + .addTokenTransfer(tokenId, accountId, 10) + .execute(testEnv.client) + .getReceipt(testEnv.client); var receipt = new TokenWipeTransaction() - .setTokenId(tokenId) - .setAccountId(accountId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTokenId(tokenId) + .setAccountId(accountId) + .execute(testEnv.client) + .getReceipt(testEnv.client); assertThat(receipt.status).isEqualTo(Status.SUCCESS); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java index fcdd5f4353..57a6628560 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java @@ -1,33 +1,14 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.TopicCreateTransaction; import com.hiero.sdk.TopicDeleteTransaction; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; - public class TopicCreateIntegrationTest { @Test @DisplayName("Can create topic") @@ -35,17 +16,16 @@ void canCreateTopic() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -54,10 +34,8 @@ void canCreateTopic() throws Exception { void canCreateTopicWithNoFieldsSet() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var response = new TopicCreateTransaction() - .execute(testEnv.client); + var response = new TopicCreateTransaction().execute(testEnv.client); assertThat(response.getReceipt(testEnv.client).topicId).isNotNull(); - } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java index e3899ee1c4..2e6214131c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java @@ -1,35 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.ReceiptStatusException; import com.hiero.sdk.Status; import com.hiero.sdk.TopicCreateTransaction; import com.hiero.sdk.TopicDeleteTransaction; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class TopicDeleteIntegrationTest { @Test @DisplayName("Can delete topic") @@ -37,17 +18,16 @@ void canDeleteTopic() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -56,18 +36,18 @@ void canDeleteTopic() throws Exception { void cannotDeleteImmutableTopic() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { - var response = new TopicCreateTransaction() - .execute(testEnv.client); + var response = new TopicCreateTransaction().execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - assertThatExceptionOfType(ReceiptStatusException.class).isThrownBy(() -> { - new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.UNAUTHORIZED.toString()); - + assertThatExceptionOfType(ReceiptStatusException.class) + .isThrownBy(() -> { + new TopicDeleteTransaction() + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.UNAUTHORIZED.toString()); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java index 7c6ee638d2..8911acea1e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java @@ -1,38 +1,19 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + import com.hiero.sdk.Hbar; import com.hiero.sdk.MaxQueryPaymentExceededException; import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.TopicCreateTransaction; import com.hiero.sdk.TopicDeleteTransaction; import com.hiero.sdk.TopicInfoQuery; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - public class TopicInfoIntegrationTest { @Test @@ -41,23 +22,20 @@ void canQueryTopicInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -67,28 +45,26 @@ void getCostQueryTopicInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var infoQuery = new TopicInfoQuery() - .setTopicId(topicId); + var infoQuery = new TopicInfoQuery().setTopicId(topicId); var cost = infoQuery.getCost(testEnv.client); - assertThat(cost).isNotNull(); + assertThat(cost).isNotNull(); var info = infoQuery.execute(testEnv.client); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); - new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + new TopicDeleteTransaction() + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -98,15 +74,13 @@ void getCostBigMaxQueryTopicInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var infoQuery = new TopicInfoQuery() - .setTopicId(topicId) - .setMaxQueryPayment(new Hbar(1000)); + var infoQuery = new TopicInfoQuery().setTopicId(topicId).setMaxQueryPayment(new Hbar(1000)); var cost = infoQuery.getCost(testEnv.client); @@ -114,13 +88,12 @@ void getCostBigMaxQueryTopicInfo() throws Exception { var info = infoQuery.execute(testEnv.client); - assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); + assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); - new TopicDeleteTransaction() + new TopicDeleteTransaction() .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -130,25 +103,22 @@ void getCostSmallMaxQueryTopicInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var infoQuery = new TopicInfoQuery() - .setTopicId(topicId) - .setMaxQueryPayment(Hbar.fromTinybars(1)); + var infoQuery = new TopicInfoQuery().setTopicId(topicId).setMaxQueryPayment(Hbar.fromTinybars(1)); assertThatExceptionOfType(MaxQueryPaymentExceededException.class).isThrownBy(() -> { infoQuery.execute(testEnv.client); }); new TopicDeleteTransaction() - .setTopicId(topicId) + .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -158,29 +128,28 @@ void getCostInsufficientTxFeeQueryTopicInfo() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var infoQuery = new TopicInfoQuery() - .setTopicId(topicId); + var infoQuery = new TopicInfoQuery().setTopicId(topicId); var cost = infoQuery.getCost(testEnv.client); assertThat(cost).isNotNull(); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); - }).satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + infoQuery.setQueryPayment(Hbar.fromTinybars(1)).execute(testEnv.client); + }) + .satisfies(error -> assertThat(error.status.toString()).isEqualTo("INSUFFICIENT_TX_FEE")); new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } - } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java index 0ec0ab9bb8..0cd421b23b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java @@ -1,34 +1,15 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.*; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; +import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; - -import java.nio.charset.StandardCharsets; import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; public class TopicMessageIntegrationTest { @Test @@ -37,15 +18,13 @@ void canReceiveATopicMessage() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -54,23 +33,24 @@ void canReceiveATopicMessage() throws Exception { Thread.sleep(3000); - var receivedMessage = new boolean[]{false}; + var receivedMessage = new boolean[] {false}; var start = Instant.now(); var handle = new TopicMessageQuery() - .setTopicId(topicId) - .setStartTime(Instant.EPOCH) - .subscribe(testEnv.client, (message) -> { - receivedMessage[0] = new String(message.contents, StandardCharsets.UTF_8).equals("Hello, from HCS!"); - }); + .setTopicId(topicId) + .setStartTime(Instant.EPOCH) + .subscribe(testEnv.client, (message) -> { + receivedMessage[0] = + new String(message.contents, StandardCharsets.UTF_8).equals("Hello, from HCS!"); + }); Thread.sleep(3000); new TopicMessageSubmitTransaction() - .setTopicId(topicId) - .setMessage("Hello, from HCS!") - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTopicId(topicId) + .setMessage("Hello, from HCS!") + .execute(testEnv.client) + .getReceipt(testEnv.client); while (!receivedMessage[0]) { if (Duration.between(start, Instant.now()).compareTo(Duration.ofSeconds(60)) > 0) { @@ -81,10 +61,9 @@ void canReceiveATopicMessage() throws Exception { } new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } @@ -98,38 +77,37 @@ void canReceiveALargeTopicMessage() throws Exception { testEnv.assumeNotLocalNode(); var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); Thread.sleep(5000); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); assertThat(info.sequenceNumber).isEqualTo(0); assertThat(info.adminKey).isEqualTo(testEnv.operatorKey); - var receivedMessage = new boolean[]{false}; + var receivedMessage = new boolean[] {false}; var start = Instant.now(); var handle = new TopicMessageQuery() - .setTopicId(topicId) - .setStartTime(Instant.EPOCH) - .subscribe(testEnv.client, (message) -> { - receivedMessage[0] = new String(message.contents, StandardCharsets.UTF_8).equals(Contents.BIG_CONTENTS); - }); + .setTopicId(topicId) + .setStartTime(Instant.EPOCH) + .subscribe(testEnv.client, (message) -> { + receivedMessage[0] = + new String(message.contents, StandardCharsets.UTF_8).equals(Contents.BIG_CONTENTS); + }); new TopicMessageSubmitTransaction() - .setTopicId(topicId) - .setMessage(Contents.BIG_CONTENTS) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .setTopicId(topicId) + .setMessage(Contents.BIG_CONTENTS) + .execute(testEnv.client) + .getReceipt(testEnv.client); while (!receivedMessage[0]) { if (Duration.between(start, Instant.now()).compareTo(Duration.ofSeconds(60)) > 0) { @@ -140,10 +118,9 @@ void canReceiveALargeTopicMessage() throws Exception { } new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java index 8fbffb1f48..d791c0e490 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java @@ -1,24 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatNoException; + import com.hiero.sdk.PrecheckStatusException; import com.hiero.sdk.Status; import com.hiero.sdk.TopicCreateTransaction; @@ -26,17 +12,12 @@ import com.hiero.sdk.TopicInfoQuery; import com.hiero.sdk.TopicMessageSubmitTransaction; import com.hiero.sdk.Transaction; +import java.util.Objects; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.assertj.core.api.Assertions.assertThatNoException; - public class TopicMessageSubmitIntegrationTest { @Test @DisplayName("Can submit a topic message") @@ -50,9 +31,7 @@ void canSubmitATopicMessage() throws Exception { var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -65,9 +44,7 @@ void canSubmitATopicMessage() throws Exception { .execute(testEnv.client) .getReceipt(testEnv.client); - info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -78,7 +55,6 @@ void canSubmitATopicMessage() throws Exception { .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -100,9 +76,7 @@ void canSubmitALargeTopicMessage() { Thread.sleep(5000); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -119,9 +93,7 @@ void canSubmitALargeTopicMessage() { resp.getReceipt(testEnv.client); } - info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -132,7 +104,6 @@ void canSubmitALargeTopicMessage() { .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } }); } @@ -153,19 +124,20 @@ void cannotSubmitMessageWhenTopicIDIsNotSet() { var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TopicMessageSubmitTransaction() - .setMessage(Contents.BIG_CONTENTS) - .setMaxChunks(15) - .execute(testEnv.client) - .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOPIC_ID.toString()); + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TopicMessageSubmitTransaction() + .setMessage(Contents.BIG_CONTENTS) + .setMaxChunks(15) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOPIC_ID.toString()); new TopicDeleteTransaction() .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } }); } @@ -180,24 +152,25 @@ void cannotSubmitMessageWhenMessageIsNotSet() { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); - assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> { - new TopicMessageSubmitTransaction() + assertThatExceptionOfType(PrecheckStatusException.class) + .isThrownBy(() -> { + new TopicMessageSubmitTransaction() + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); + }) + .withMessageContaining(Status.INVALID_TOPIC_MESSAGE.toString()); + + new TopicDeleteTransaction() .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - }).withMessageContaining(Status.INVALID_TOPIC_MESSAGE.toString()); - - new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - } }); } @@ -206,7 +179,8 @@ void cannotSubmitMessageWhenMessageIsNotSet() { @DisplayName("Hex Decode Regression Test") @SuppressWarnings("UnusedVariable") void decodeHexRegressionTest() throws Exception { - String binaryHex = "2ac2010a580a130a0b08d38f8f880610a09be91512041899e11c120218041880c2d72f22020878da01330a0418a5a1201210303030303030313632373633373731351a190a130a0b08d38f8f880610a09be91512041899e11c1001180112660a640a20603edaec5d1c974c92cb5bee7b011310c3b84b13dc048424cd6ef146d6a0d4a41a40b6a08f310ee29923e5868aac074468b2bde05da95a806e2f4a4f452177f129ca0abae7831e595b5beaa1c947e2cb71201642bab33fece5184b04547afc40850a"; + String binaryHex = + "2ac2010a580a130a0b08d38f8f880610a09be91512041899e11c120218041880c2d72f22020878da01330a0418a5a1201210303030303030313632373633373731351a190a130a0b08d38f8f880610a09be91512041899e11c1001180112660a640a20603edaec5d1c974c92cb5bee7b011310c3b84b13dc048424cd6ef146d6a0d4a41a40b6a08f310ee29923e5868aac074468b2bde05da95a806e2f4a4f452177f129ca0abae7831e595b5beaa1c947e2cb71201642bab33fece5184b04547afc40850a"; byte[] transactionBytes = Hex.decode(binaryHex); var transaction = Objects.requireNonNull(Transaction.fromBytes(transactionBytes)); diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java index 89fe3242ef..26aefdcaa9 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java @@ -1,35 +1,16 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2021 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.TopicCreateTransaction; import com.hiero.sdk.TopicDeleteTransaction; import com.hiero.sdk.TopicInfoQuery; import com.hiero.sdk.TopicUpdateTransaction; +import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Objects; - -import static org.assertj.core.api.Assertions.assertThat; - public class TopicUpdateIntegrationTest { @Test @DisplayName("Can update topic") @@ -37,32 +18,29 @@ void canUpdateTopic() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var response = new TopicCreateTransaction() - .setAdminKey(testEnv.operatorKey) - .setAutoRenewAccountId(testEnv.operatorId) - .setTopicMemo("[e2e::TopicCreateTransaction]") - .execute(testEnv.client); + .setAdminKey(testEnv.operatorKey) + .setAutoRenewAccountId(testEnv.operatorId) + .setTopicMemo("[e2e::TopicCreateTransaction]") + .execute(testEnv.client); var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId); new TopicUpdateTransaction() - .clearAutoRenewAccountId() - .setTopicMemo("hello") - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); + .clearAutoRenewAccountId() + .setTopicMemo("hello") + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); - var topicInfo = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var topicInfo = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(topicInfo.topicMemo).isEqualTo("hello"); assertThat(topicInfo.autoRenewAccountId).isNull(); new TopicDeleteTransaction() - .setTopicId(topicId) - .execute(testEnv.client) - .getReceipt(testEnv.client); - + .setTopicId(topicId) + .execute(testEnv.client) + .getReceipt(testEnv.client); } } } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java index e948fb3c5d..7212409316 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java @@ -1,24 +1,10 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatNoException; + import com.google.protobuf.ByteString; import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.AccountDeleteTransaction; @@ -50,17 +36,12 @@ import com.hiero.sdk.proto.TransactionID; import com.hiero.sdk.proto.TransactionList; import com.hiero.sdk.proto.TransferList; +import java.util.Arrays; import java.util.Objects; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.util.Arrays; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import static org.assertj.core.api.Assertions.assertThatNoException; - public class TransactionIntegrationTest { @Test @@ -71,9 +52,9 @@ void transactionHashInTransactionRecordIsEqualToTheDerivedTransactionHash() thro var key = PrivateKey.generateED25519(); var transaction = new AccountCreateTransaction() - .setKey(key) - .freezeWith(testEnv.client) - .signWithOperator(testEnv.client); + .setKey(key) + .freezeWith(testEnv.client) + .signWithOperator(testEnv.client); var expectedHash = transaction.getTransactionHashPerNode(); @@ -92,7 +73,6 @@ var record = response.getRecord(testEnv.client); assertThat(transactionId.getRecord(testEnv.client)).isNotNull(); assertThat(transactionId.getRecordAsync(testEnv.client).get()).isNotNull(); } - } /** @@ -107,22 +87,20 @@ void canSerializeDeserializeCompareFields() throws Exception { var adminKey = PrivateKey.generateECDSA(); var publicKey = adminKey.getPublicKey(); - var accountCreateTransaction = new AccountCreateTransaction() - .setKey(publicKey) - .setInitialBalance(new Hbar(1L)); + var accountCreateTransaction = + new AccountCreateTransaction().setKey(publicKey).setInitialBalance(new Hbar(1L)); var expectedNodeAccountIds = accountCreateTransaction.getNodeAccountIds(); var expectedBalance = new Hbar(1L); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes(transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); assertThat(expectedNodeAccountIds).isEqualTo(accountCreateTransactionDeserialized.getNodeAccountIds()); assertThat(expectedBalance).isEqualTo(accountCreateTransactionDeserialized.getInitialBalance()); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy( - accountCreateTransactionDeserialized::getTransactionId); - + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(accountCreateTransactionDeserialized::getTransactionId); } } @@ -131,7 +109,8 @@ void canSerializeDeserializeCompareFields() throws Exception { * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("incomplete transaction with node account ids can be serialized into bytes, deserialized and be equal to the original one") + @DisplayName( + "incomplete transaction with node account ids can be serialized into bytes, deserialized and be equal to the original one") void canSerializeWithNodeAccountIdsDeserializeCompareFields() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -149,15 +128,16 @@ void canSerializeWithNodeAccountIdsDeserializeCompareFields() throws Exception { var expectedBalance = new Hbar(1L); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes(transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); assertThat(expectedNodeAccountIds.size()) - .isEqualTo(accountCreateTransactionDeserialized.getNodeAccountIds().size()); + .isEqualTo(accountCreateTransactionDeserialized + .getNodeAccountIds() + .size()); assertThat(expectedBalance).isEqualTo(accountCreateTransactionDeserialized.getInitialBalance()); - assertThatExceptionOfType(IllegalStateException.class).isThrownBy( - accountCreateTransactionDeserialized::getTransactionId); - + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(accountCreateTransactionDeserialized::getTransactionId); } } @@ -173,18 +153,15 @@ void canSerializeDeserializeAndExecuteIncompleteTransaction() throws Exception { var adminKey = PrivateKey.generateECDSA(); var publicKey = adminKey.getPublicKey(); - var accountCreateTransaction = new AccountCreateTransaction() - .setKey(publicKey) - .setInitialBalance(new Hbar(1L)); + var accountCreateTransaction = + new AccountCreateTransaction().setKey(publicKey).setInitialBalance(new Hbar(1L)); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes( - transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); - var txReceipt = accountCreateTransactionDeserialized - .execute(testEnv.client) - .getReceipt(testEnv.client); + var txReceipt = + accountCreateTransactionDeserialized.execute(testEnv.client).getReceipt(testEnv.client); new AccountDeleteTransaction() .setAccountId(txReceipt.accountId) @@ -192,7 +169,6 @@ void canSerializeDeserializeAndExecuteIncompleteTransaction() throws Exception { .freezeWith(testEnv.client) .sign(adminKey) .execute(testEnv.client); - } } @@ -216,13 +192,11 @@ void canSerializeDeserializeAndExecuteIncompleteTransactionWithNodeAccountIds() .setInitialBalance(new Hbar(1L)); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes( - transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); - var txReceipt = accountCreateTransactionDeserialized - .execute(testEnv.client) - .getReceipt(testEnv.client); + var txReceipt = + accountCreateTransactionDeserialized.execute(testEnv.client).getReceipt(testEnv.client); new AccountDeleteTransaction() .setAccountId(txReceipt.accountId) @@ -230,7 +204,6 @@ void canSerializeDeserializeAndExecuteIncompleteTransactionWithNodeAccountIds() .freezeWith(testEnv.client) .sign(adminKey) .execute(testEnv.client); - } } @@ -246,15 +219,14 @@ void canSerializeDeserializeEditExecuteCompareFields() throws Exception { var adminKey = PrivateKey.generateECDSA(); var publicKey = adminKey.getPublicKey(); - var accountCreateTransaction = new AccountCreateTransaction() - .setKey(publicKey); + var accountCreateTransaction = new AccountCreateTransaction().setKey(publicKey); var expectedBalance = new Hbar(1L); var nodeAccountIds = testEnv.client.getNetwork().values().stream().toList(); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes(transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); var txReceipt = accountCreateTransactionDeserialized .setInitialBalance(new Hbar(1L)) @@ -271,7 +243,6 @@ void canSerializeDeserializeEditExecuteCompareFields() throws Exception { .freezeWith(testEnv.client) .sign(adminKey) .execute(testEnv.client); - } } @@ -280,7 +251,8 @@ void canSerializeDeserializeEditExecuteCompareFields() throws Exception { * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("incomplete transaction with node account ids can be serialized into bytes, deserialized, edited and executed") + @DisplayName( + "incomplete transaction with node account ids can be serialized into bytes, deserialized, edited and executed") void canSerializeDeserializeEditExecuteCompareFieldsIncompleteTransactionWithNodeAccountIds() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -296,8 +268,8 @@ void canSerializeDeserializeEditExecuteCompareFieldsIncompleteTransactionWithNod var expectedBalance = new Hbar(1L); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes(transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); var txReceipt = accountCreateTransactionDeserialized .setInitialBalance(new Hbar(1L)) @@ -313,7 +285,6 @@ void canSerializeDeserializeEditExecuteCompareFieldsIncompleteTransactionWithNod .freezeWith(testEnv.client) .sign(adminKey) .execute(testEnv.client); - } } @@ -348,14 +319,14 @@ void canFreezeSignSerializeDeserializeReserializeAndExecute() throws Exception { .sign(adminKey); var transactionBytesSerialized = accountCreateTransaction.toBytes(); - AccountCreateTransaction accountCreateTransactionDeserialized = (AccountCreateTransaction) Transaction - .fromBytes(transactionBytesSerialized); + AccountCreateTransaction accountCreateTransactionDeserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesSerialized); var transactionBytesReserialized = accountCreateTransactionDeserialized.toBytes(); assertThat(transactionBytesSerialized).isEqualTo(transactionBytesReserialized); - AccountCreateTransaction accountCreateTransactionReserialized = (AccountCreateTransaction) Transaction - .fromBytes(transactionBytesReserialized); + AccountCreateTransaction accountCreateTransactionReserialized = + (AccountCreateTransaction) Transaction.fromBytes(transactionBytesReserialized); var txResponse = accountCreateTransactionReserialized.execute(testEnv.client); @@ -367,7 +338,6 @@ void canFreezeSignSerializeDeserializeReserializeAndExecute() throws Exception { .freezeWith(testEnv.client) .sign(adminKey) .execute(testEnv.client); - } } @@ -405,10 +375,7 @@ var record = response.getRecord(testEnv.client); var deleteTransaction2 = Transaction.fromBytes(updateBytes); - deleteTransaction2 - .addSignature(key.getPublicKey(), sig1) - .execute(testEnv.client); - + deleteTransaction2.addSignature(key.getPublicKey(), sig1).execute(testEnv.client); } } @@ -417,7 +384,8 @@ var record = response.getRecord(testEnv.client); * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("file append chunked transaction can be frozen, signed, serialized into bytes, deserialized and be equal to the original one") + @DisplayName( + "file append chunked transaction can be frozen, signed, serialized into bytes, deserialized and be equal to the original one") void canFreezeSignSerializeDeserializeAndCompareFileAppendChunkedTransaction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -432,9 +400,7 @@ void canFreezeSignSerializeDeserializeAndCompareFileAppendChunkedTransaction() t Thread.sleep(5000); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -450,12 +416,11 @@ void canFreezeSignSerializeDeserializeAndCompareFileAppendChunkedTransaction() t .sign(privateKey); var transactionBytesSerialized = fileAppendTransaction.toBytes(); - FileAppendTransaction fileAppendTransactionDeserialized = (FileAppendTransaction) Transaction - .fromBytes(transactionBytesSerialized); + FileAppendTransaction fileAppendTransactionDeserialized = + (FileAppendTransaction) Transaction.fromBytes(transactionBytesSerialized); var transactionBytesReserialized = fileAppendTransactionDeserialized.toBytes(); assertThat(transactionBytesSerialized).isEqualTo(transactionBytesReserialized); - } } @@ -464,7 +429,8 @@ void canFreezeSignSerializeDeserializeAndCompareFileAppendChunkedTransaction() t * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("incomplete file append chunked transaction can be serialized into bytes, deserialized, edited and executed") + @DisplayName( + "incomplete file append chunked transaction can be serialized into bytes, deserialized, edited and executed") void canSerializeDeserializeExecuteFileAppendChunkedTransaction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -477,9 +443,7 @@ void canSerializeDeserializeExecuteFileAppendChunkedTransaction() throws Excepti Thread.sleep(5000); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -488,27 +452,20 @@ void canSerializeDeserializeExecuteFileAppendChunkedTransaction() throws Excepti assertThat(info.keys.getThreshold()).isNull(); assertThat(info.keys).isEqualTo(KeyList.of(testEnv.operatorKey)); - var fileAppendTransaction = new FileAppendTransaction() - .setFileId(fileId) - .setContents(Contents.BIG_CONTENTS); + var fileAppendTransaction = + new FileAppendTransaction().setFileId(fileId).setContents(Contents.BIG_CONTENTS); var transactionBytesSerialized = fileAppendTransaction.toBytes(); - FileAppendTransaction fileAppendTransactionDeserialized = (FileAppendTransaction) Transaction - .fromBytes(transactionBytesSerialized); + FileAppendTransaction fileAppendTransactionDeserialized = + (FileAppendTransaction) Transaction.fromBytes(transactionBytesSerialized); - fileAppendTransactionDeserialized - .execute(testEnv.client) - .getReceipt(testEnv.client); + fileAppendTransactionDeserialized.execute(testEnv.client).getReceipt(testEnv.client); - var contents = new FileContentsQuery() - .setFileId(fileId) - .execute(testEnv.client); + var contents = new FileContentsQuery().setFileId(fileId).execute(testEnv.client); assertThat(contents.toStringUtf8()).isEqualTo("[e2e::FileCreateTransaction]" + Contents.BIG_CONTENTS); - info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(13522); @@ -521,7 +478,6 @@ void canSerializeDeserializeExecuteFileAppendChunkedTransaction() throws Excepti .setFileId(fileId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -530,7 +486,8 @@ void canSerializeDeserializeExecuteFileAppendChunkedTransaction() throws Excepti * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("incomplete file append chunked transaction with node account ids can be serialized into bytes, deserialized, edited and executed") + @DisplayName( + "incomplete file append chunked transaction with node account ids can be serialized into bytes, deserialized, edited and executed") void canSerializeDeserializeExecuteIncompleteFileAppendChunkedTransactionWithNodeAccountIds() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -545,9 +502,7 @@ void canSerializeDeserializeExecuteIncompleteFileAppendChunkedTransactionWithNod Thread.sleep(5000); - var info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + var info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(28); @@ -562,23 +517,19 @@ void canSerializeDeserializeExecuteIncompleteFileAppendChunkedTransactionWithNod .setContents(Contents.BIG_CONTENTS); var transactionBytesSerialized = fileAppendTransaction.toBytes(); - FileAppendTransaction fileAppendTransactionDeserialized = (FileAppendTransaction) Transaction - .fromBytes(transactionBytesSerialized); + FileAppendTransaction fileAppendTransactionDeserialized = + (FileAppendTransaction) Transaction.fromBytes(transactionBytesSerialized); fileAppendTransactionDeserialized .setTransactionId(TransactionId.generate(testEnv.client.getOperatorAccountId())) .execute(testEnv.client) .getReceipt(testEnv.client); - var contents = new FileContentsQuery() - .setFileId(fileId) - .execute(testEnv.client); + var contents = new FileContentsQuery().setFileId(fileId).execute(testEnv.client); assertThat(contents.toStringUtf8()).isEqualTo("[e2e::FileCreateTransaction]" + Contents.BIG_CONTENTS); - info = new FileInfoQuery() - .setFileId(fileId) - .execute(testEnv.client); + info = new FileInfoQuery().setFileId(fileId).execute(testEnv.client); assertThat(info.fileId).isEqualTo(fileId); assertThat(info.size).isEqualTo(13522); @@ -591,7 +542,6 @@ void canSerializeDeserializeExecuteIncompleteFileAppendChunkedTransactionWithNod .setFileId(fileId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -600,7 +550,8 @@ void canSerializeDeserializeExecuteIncompleteFileAppendChunkedTransactionWithNod * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("topic message submit chunked transaction can be frozen, signed, serialized into bytes, deserialized and be equal to the original one") + @DisplayName( + "topic message submit chunked transaction can be frozen, signed, serialized into bytes, deserialized and be equal to the original one") void canFreezeSignSerializeDeserializeAndCompareTopicMessageSubmitChunkedTransaction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -615,9 +566,7 @@ void canFreezeSignSerializeDeserializeAndCompareTopicMessageSubmitChunkedTransac Thread.sleep(5000); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -632,8 +581,8 @@ void canFreezeSignSerializeDeserializeAndCompareTopicMessageSubmitChunkedTransac .sign(privateKey); var transactionBytesSerialized = topicMessageSubmitTransaction.toBytes(); - TopicMessageSubmitTransaction fileAppendTransactionDeserialized = (TopicMessageSubmitTransaction) Transaction - .fromBytes(transactionBytesSerialized); + TopicMessageSubmitTransaction fileAppendTransactionDeserialized = + (TopicMessageSubmitTransaction) Transaction.fromBytes(transactionBytesSerialized); var transactionBytesReserialized = fileAppendTransactionDeserialized.toBytes(); assertThat(transactionBytesSerialized).isEqualTo(transactionBytesReserialized); @@ -642,7 +591,6 @@ void canFreezeSignSerializeDeserializeAndCompareTopicMessageSubmitChunkedTransac .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -651,7 +599,8 @@ void canFreezeSignSerializeDeserializeAndCompareTopicMessageSubmitChunkedTransac * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("incomplete topic message submit chunked transaction can be serialized into bytes, deserialized, edited and executed") + @DisplayName( + "incomplete topic message submit chunked transaction can be serialized into bytes, deserialized, edited and executed") void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransaction() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -664,9 +613,7 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio Thread.sleep(5000); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -679,8 +626,8 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio .setMessage(Contents.BIG_CONTENTS); var transactionBytesSerialized = topicMessageSubmitTransaction.toBytes(); - TopicMessageSubmitTransaction topicMessageSubmitTransactionDeserialized = (TopicMessageSubmitTransaction) Transaction - .fromBytes(transactionBytesSerialized); + TopicMessageSubmitTransaction topicMessageSubmitTransactionDeserialized = + (TopicMessageSubmitTransaction) Transaction.fromBytes(transactionBytesSerialized); var responses = topicMessageSubmitTransactionDeserialized.executeAll(testEnv.client); @@ -688,9 +635,7 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio resp.getReceipt(testEnv.client); } - info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -701,7 +646,6 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -710,7 +654,8 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio * @url https://hips.hedera.com/hip/hip-745 */ @Test - @DisplayName("incomplete topic message submit chunked transaction with node account ids can be serialized into bytes, deserialized, edited and executed") + @DisplayName( + "incomplete topic message submit chunked transaction with node account ids can be serialized into bytes, deserialized, edited and executed") void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactionWithNodeAccountIds() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { @@ -726,9 +671,7 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio Thread.sleep(5000); - var info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + var info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -742,8 +685,8 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio .setMessage(Contents.BIG_CONTENTS); var transactionBytesSerialized = topicMessageSubmitTransaction.toBytes(); - TopicMessageSubmitTransaction topicMessageSubmitTransactionDeserialized = (TopicMessageSubmitTransaction) Transaction - .fromBytes(transactionBytesSerialized); + TopicMessageSubmitTransaction topicMessageSubmitTransactionDeserialized = + (TopicMessageSubmitTransaction) Transaction.fromBytes(transactionBytesSerialized); var responses = topicMessageSubmitTransactionDeserialized.executeAll(testEnv.client); @@ -751,9 +694,7 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio resp.getReceipt(testEnv.client); } - info = new TopicInfoQuery() - .setTopicId(topicId) - .execute(testEnv.client); + info = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client); assertThat(info.topicId).isEqualTo(topicId); assertThat(info.topicMemo).isEqualTo("[e2e::TopicCreateTransaction]"); @@ -764,7 +705,6 @@ void canSerializeDeserializeExecuteIncompleteTopicMessageSubmitChunkedTransactio .setTopicId(topicId) .execute(testEnv.client) .getReceipt(testEnv.client); - } } @@ -798,32 +738,29 @@ void transactionFromToBytes2() { .build()) .setTransactionFee(200_000_000) .setTransactionValidDuration( - Duration.newBuilder() - .setSeconds(120) - .build()) + Duration.newBuilder().setSeconds(120).build()) .setGenerateRecord(false) .setMemo("") - .setCryptoTransfer( - CryptoTransferTransactionBody.newBuilder() - .setTransfers(TransferList.newBuilder() - .addAccountAmounts(AccountAmount.newBuilder() - .setAccountID(AccountID.newBuilder() - .setAccountNum(47439) - .setRealmNum(0) - .setShardNum(0) - .build()) - .setAmount(10) + .setCryptoTransfer(CryptoTransferTransactionBody.newBuilder() + .setTransfers(TransferList.newBuilder() + .addAccountAmounts(AccountAmount.newBuilder() + .setAccountID(AccountID.newBuilder() + .setAccountNum(47439) + .setRealmNum(0) + .setShardNum(0) .build()) - .addAccountAmounts(AccountAmount.newBuilder() - .setAccountID(AccountID.newBuilder() - .setAccountNum(542348) - .setRealmNum(0) - .setShardNum(0) - .build()) - .setAmount(-10) + .setAmount(10) + .build()) + .addAccountAmounts(AccountAmount.newBuilder() + .setAccountID(AccountID.newBuilder() + .setAccountNum(542348) + .setRealmNum(0) + .setShardNum(0) .build()) + .setAmount(-10) .build()) - .build()); + .build()) + .build()); var bodyBytes = transactionBodyBuilder.build().toByteString(); var key1 = PrivateKey.fromString( @@ -879,14 +816,17 @@ void transactionFromToBytes2() { .addTransactionList(com.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(byts) .build()) - .build().toByteString(); + .build() + .toByteString(); var tx = (TransferTransaction) Transaction.fromBytes(byts.toByteArray()); try (var testEnv = new IntegrationTestEnv(1)) { - assertThat(tx.getHbarTransfers().get(new AccountId(542348)).toTinybars()).isEqualTo(-10); - assertThat(tx.getHbarTransfers().get(new AccountId(47439)).toTinybars()).isEqualTo(10); + assertThat(tx.getHbarTransfers().get(new AccountId(542348)).toTinybars()) + .isEqualTo(-10); + assertThat(tx.getHbarTransfers().get(new AccountId(47439)).toTinybars()) + .isEqualTo(10); assertThat(tx.getNodeAccountIds()).isNotNull(); assertThat(tx.getNodeAccountIds().size()).isEqualTo(1); @@ -907,7 +847,6 @@ void transactionFromToBytes2() { var resp = tx.execute(testEnv.client); resp.getReceipt(testEnv.client); - } }); } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java index aaf3917c14..cb87855486 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java +++ b/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java @@ -1,31 +1,13 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThat; + import com.hiero.sdk.AccountCreateTransaction; import com.hiero.sdk.PrivateKey; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import static org.assertj.core.api.Assertions.assertThat; - public class TransactionResponseTest { @Test @DisplayName("transaction hash in transaction record is equal to the transaction response transaction hash") @@ -34,9 +16,7 @@ void transactionHashInTransactionRecordIsEqualToTheTransactionResponseTransactio var key = PrivateKey.generateED25519(); - var transaction = new AccountCreateTransaction() - .setKey(key) - .execute(testEnv.client); + var transaction = new AccountCreateTransaction().setKey(key).execute(testEnv.client); var record = transaction.getRecord(testEnv.client); @@ -44,8 +24,6 @@ var record = transaction.getRecord(testEnv.client); var accountId = record.receipt.accountId; assertThat(accountId).isNotNull(); - } } } - diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java index dc57bc8bcd..5ba02dd2b3 100644 --- a/sdk/src/testIntegration/java/module-info.java +++ b/sdk/src/testIntegration/java/module-info.java @@ -19,8 +19,8 @@ */ open module com.hiero.sdk.test.integration { - requires com.hiero.sdk; requires com.esaulpaugh.headlong; + requires com.hiero.sdk; requires org.assertj.core; requires org.bouncycastle.provider; requires org.junit.jupiter.api; diff --git a/settings.gradle.kts b/settings.gradle.kts index 263b9f4847..65c9e0c160 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,6 +9,6 @@ javaModules { module("tck") { group = "com.hiero.sdk.tck" } } -//includeBuild("examples") +// includeBuild("examples") // -//includeBuild("example-android") +// includeBuild("example-android") diff --git a/tck/build.gradle.kts b/tck/build.gradle.kts index 551b22d894..ba3cef1325 100644 --- a/tck/build.gradle.kts +++ b/tck/build.gradle.kts @@ -19,7 +19,7 @@ plugins { id("org.hiero.gradle.report.test-logger") } -description = "Hedera SDK TCK Server" +description = "Hiero SDK TCK Server" version = "0.0.1" @@ -41,7 +41,6 @@ dependencies { implementation("org.springframework:spring-context") implementation("org.springframework:spring-web") implementation("org.springframework:spring-webmvc") - runtimeOnly("io.grpc:grpc-netty-shaded") runtimeOnly("org.springframework.boot:spring-boot-starter-web") compileOnly("org.projectlombok:lombok") @@ -55,7 +54,6 @@ tasks.withType { setGroup(null) } // Configure dependency analysis without using Java Modules tasks.qualityGate { dependsOn(tasks.named("projectHealth")) } - tasks.qualityCheck { dependsOn(tasks.named("projectHealth")) } dependencyAnalysis { @@ -63,6 +61,9 @@ dependencyAnalysis { onAny { severity("fail") exclude("com.google.protobuf:protobuf-javalite") + onUnusedDependencies { + exclude(":sdk") + } } } } diff --git a/tck/src/main/java/com/hiero/tck/TckServer.java b/tck/src/main/java/com/hiero/tck/TckServer.java index f9fd8927bb..f5fe7cee7a 100644 --- a/tck/src/main/java/com/hiero/tck/TckServer.java +++ b/tck/src/main/java/com/hiero/tck/TckServer.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck; import org.springframework.boot.SpringApplication; diff --git a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java index d19dc5e0f9..68551044d3 100644 --- a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java +++ b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.annotation; import java.lang.annotation.ElementType; diff --git a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java index 7bacc27a3a..df7a173337 100644 --- a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java +++ b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.annotation; import java.lang.annotation.ElementType; diff --git a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java index d934bf1438..11fc97d744 100644 --- a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java +++ b/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.annotation; import java.lang.annotation.ElementType; diff --git a/tck/src/main/java/com/hiero/tck/config/BeanConfig.java b/tck/src/main/java/com/hiero/tck/config/BeanConfig.java index 72464d8b8c..9ed8dfa235 100644 --- a/tck/src/main/java/com/hiero/tck/config/BeanConfig.java +++ b/tck/src/main/java/com/hiero/tck/config/BeanConfig.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.config; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; diff --git a/tck/src/main/java/com/hiero/tck/config/WebConfig.java b/tck/src/main/java/com/hiero/tck/config/WebConfig.java index cd299709ed..d995ed3f0c 100644 --- a/tck/src/main/java/com/hiero/tck/config/WebConfig.java +++ b/tck/src/main/java/com/hiero/tck/config/WebConfig.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.config; import com.hiero.tck.controller.JRPCInterceptor; diff --git a/tck/src/main/java/com/hiero/tck/controller/JRPCController.java b/tck/src/main/java/com/hiero/tck/controller/JRPCController.java index 6841ab83f4..0eb1249880 100644 --- a/tck/src/main/java/com/hiero/tck/controller/JRPCController.java +++ b/tck/src/main/java/com/hiero/tck/controller/JRPCController.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.controller; import static com.hiero.tck.util.JSONRPC2ServiceScanner.registerServices; diff --git a/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java b/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java index b66bd59bd3..a1c97f2006 100644 --- a/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java +++ b/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.controller; import com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException; diff --git a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java index 8290c81d5a..77293b8aed 100644 --- a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java +++ b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.exception; /** diff --git a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java index 7ba960c6aa..790ffa0eca 100644 --- a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java +++ b/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.exception; /** diff --git a/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java b/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java index d79aabec5a..7d33e9e0f9 100644 --- a/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java +++ b/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods; import static com.hiero.tck.methods.JSONRPC2Error.HEDERA_ERROR; diff --git a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java index 40698a186e..62dd6f8e18 100644 --- a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java +++ b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods; import com.hiero.sdk.Status; diff --git a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java index 202194dcb3..f49fd07514 100644 --- a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java +++ b/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods; import java.util.Map; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java index ec3cb884d1..adeee2b2e1 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java index e1725ee4f0..f8ae8ede5b 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk; import static com.hiero.tck.util.KeyUtils.KeyType.*; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java index 3b98339871..9d56928daf 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk; import com.hiero.sdk.AccountId; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java b/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java index f0aefeef04..8e0b673df8 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java index 1a028a881b..7990247738 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java index c5ea95cfe4..5ca547c239 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java index 5acd5c7872..61b58a46de 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java index 7ff3eca6a4..50609cc352 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.sdk.Client; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java index 5e408184c2..8cb6dfc43e 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java index 4de7be7de8..5fb98a1563 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java index ad146bba6f..e2b044d845 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java index 35a5bcfb43..fcc5205312 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java index 0075062e4e..778072573d 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java index 56239acd3c..e69f8462f8 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import com.hiero.tck.methods.JSONRPC2Param; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java index 3f2371cfb8..1e84f87ccf 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.response; import com.hiero.sdk.Status; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java index ee48bd2b90..a5bcf9cff5 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.response; import java.util.ArrayList; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java index 8a7e241d75..66c7e81b65 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.response; import lombok.Data; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java b/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java index 11b6201186..23a6116655 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java +++ b/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java @@ -1,23 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ - +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.response; import com.hiero.sdk.Status; diff --git a/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java b/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java index e1aabd08fe..136d8f4bc4 100644 --- a/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java +++ b/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.util; import com.hiero.tck.annotation.JSONRPC2Service; diff --git a/tck/src/main/java/com/hiero/tck/util/KeyUtils.java b/tck/src/main/java/com/hiero/tck/util/KeyUtils.java index 9746901276..457ee40940 100644 --- a/tck/src/main/java/com/hiero/tck/util/KeyUtils.java +++ b/tck/src/main/java/com/hiero/tck/util/KeyUtils.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.util; import com.google.protobuf.ByteString; diff --git a/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java b/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java index 94982b5fe2..9c660bd547 100644 --- a/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java +++ b/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.controller; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java b/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java index 6f64ce3929..eefdde92b2 100644 --- a/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java +++ b/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.controller; import static org.junit.jupiter.api.Assertions.*; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java index 7c0edb51a3..b52963f722 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk; import static com.hiero.tck.util.KeyUtils.KeyType.*; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java index 314fb4206f..dd59ece596 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java index 6d32b33bf9..bc8cee83e9 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java index 04dfbf337f..cdb4d86222 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java index 3b5e8f57a3..eb04759ca8 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java index c159d64bba..88176e2116 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java b/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java index 29f39611b8..ddc8d29e3f 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java +++ b/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hiero.tck.methods.sdk.response; import static org.junit.jupiter.api.Assertions.assertEquals; From 6459242e27ed5bf927de5867d59fa4f6b310a942 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 13:22:23 +0200 Subject: [PATCH 04/15] fix: spotlessKotlinGradleCheck Signed-off-by: Ivan Ivanov --- tck/build.gradle.kts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tck/build.gradle.kts b/tck/build.gradle.kts index ba3cef1325..eb3417f2d5 100644 --- a/tck/build.gradle.kts +++ b/tck/build.gradle.kts @@ -54,6 +54,7 @@ tasks.withType { setGroup(null) } // Configure dependency analysis without using Java Modules tasks.qualityGate { dependsOn(tasks.named("projectHealth")) } + tasks.qualityCheck { dependsOn(tasks.named("projectHealth")) } dependencyAnalysis { @@ -61,9 +62,7 @@ dependencyAnalysis { onAny { severity("fail") exclude("com.google.protobuf:protobuf-javalite") - onUnusedDependencies { - exclude(":sdk") - } + onUnusedDependencies { exclude(":sdk") } } } } From 36a44219c43f8d2e15341088c66689c50e6e82cb Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 13:32:20 +0200 Subject: [PATCH 05/15] fix: replace jacocoTestReport Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 2 +- .github/workflows/disabled/testnet.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a533307b8..fda165c62d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: OPERATOR_ID: '0.0.1022' HEDERA_NETWORK: 'localhost' run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK jacocoTestReport --scan + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK testIntegration --scan - name: Upload coverage to Codecov if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }} diff --git a/.github/workflows/disabled/testnet.yml b/.github/workflows/disabled/testnet.yml index cabaece6c9..243a2ae440 100644 --- a/.github/workflows/disabled/testnet.yml +++ b/.github/workflows/disabled/testnet.yml @@ -93,7 +93,7 @@ jobs: OPERATOR_ID: ${{ secrets.TESTNET_OPERATOR_ID }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=testnet jacocoTestReport && bash <(curl -s https://codecov.io/bash) + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=testnet testIntegration && bash <(curl -s https://codecov.io/bash) - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} From a31c3d5c78ee73d4131e6b5d5fee198da3720108 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 14:07:54 +0200 Subject: [PATCH 06/15] chore: revert /example changes Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 108 +++++++++--------- .../sdk/examples/AccountAliasExample.java | 5 +- .../sdk/examples/AccountAllowanceExample.java | 5 +- .../examples/AccountCreateWithHtsExample.java | 5 +- ...eateAccountTransferTransactionExample.java | 5 +- .../sdk/examples/ChangeRemoveTokenKeys.java | 5 +- .../ConsensusPubSubChunkedExample.java | 5 +- .../sdk/examples/ConsensusPubSubExample.java | 5 +- .../ConsensusPubSubWithSubmitKeyExample.java | 5 +- .../sdk/examples/ContractNoncesExample.java | 5 +- .../sdk/examples/CreateAccountExample.java | 5 +- .../CreateAccountThresholdKeyExample.java | 5 +- .../CreateAccountWithAliasExample.java | 5 +- .../sdk/examples/CreateFileExample.java | 7 +- .../examples/CreateSimpleContractExample.java | 5 +- .../CreateStatefulContractExample.java | 5 +- .../sdk/examples/CreateTopicExample.java | 5 +- .../sdk/examples/CustomFeesExample.java | 5 +- .../sdk/examples/ExampleTemplate.java | 4 +- .../sdk/examples/ExemptCustomFeesExample.java | 5 +- .../examples/FileAppendChunkedExample.java | 5 +- .../examples/GetAccountBalanceExample.java | 4 +- .../sdk/examples/GetAccountInfoExample.java | 5 +- .../sdk/examples/GetAddressBookExample.java | 4 +- .../sdk/examples/GetExchangeRatesExample.java | 5 +- .../sdk/examples/GetFileContentsExample.java | 5 +- ...tializeClientWithMirrorNetworkExample.java | 4 +- .../LoggerFunctionalitiesExample.java | 5 +- .../LongTermScheduledTransactionExample.java | 4 +- .../MirrorNodeContractQueriesExample.java | 4 +- .../sdk/examples/MultiAppTransferExample.java | 5 +- .../sdk/examples/MultiSigOfflineExample.java | 5 +- .../NftAddRemoveAllowancesExample.java | 5 +- .../hashgraph/sdk/examples/PrngExample.java | 5 +- .../sdk/examples/ScheduleExample.java | 5 +- .../ScheduleIdenticalTransactionExample.java | 5 +- .../ScheduleMultiSigTransactionExample.java | 5 +- ...edTransactionMultiSigThresholdExample.java | 5 +- .../examples/ScheduledTransferExample.java | 5 +- .../sdk/examples/SignTransactionExample.java | 5 +- .../sdk/examples/StakingExample.java | 5 +- .../examples/StakingWithUpdateExample.java | 5 +- .../sdk/examples/TokenAirdropExample.java | 4 +- .../sdk/examples/TokenMetadataExample.java | 5 +- .../sdk/examples/TokenRejectExample.java | 5 +- .../examples/TopicWithAdminKeyExample.java | 5 +- .../TransactionSerializationExample.java | 5 +- .../sdk/examples/TransferCryptoExample.java | 5 +- .../sdk/examples/TransferTokensExample.java | 5 +- .../TransferUsingEvmAddressExample.java | 5 +- .../UpdateAccountPublicKeyExample.java | 5 +- .../examples/UpdateNftsMetadataExample.java | 5 +- .../sdk/examples/ValidateChecksumExample.java | 5 +- .../examples/ZeroTokenOperationsExample.java | 5 +- examples/src/main/java/module-info.java | 4 +- settings.gradle.kts | 6 +- 56 files changed, 212 insertions(+), 166 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fda165c62d..fd632b2e3c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,60 +110,60 @@ jobs: - name: Stop the local node run: npx @hashgraph/hedera-local stop -# run-examples: -# name: Run Examples -# runs-on: client-sdk-linux-medium -# needs: -# - build -# steps: -# - name: Harden Runner -# uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 -# with: -# egress-policy: audit -# -# - name: Checkout Code -# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 -# -# - name: Setup NodeJS -# uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 -# with: -# node-version: 18 -# -# - name: Setup Java -# uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 -# with: -# distribution: temurin -# java-version: 17 -# -# - name: Setup Android SDK -# uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 -# -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1 -# -# - name: Install Local Node -# run: npm install @hashgraph/hedera-local -# -# - name: Build SDK -# run: ./gradlew assemble --scan -# -# - name: Build Android Example -# run: ./gradlew -p example-android assemble --scan -# -# - name: Start the local node -# run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.57.0 -# -# - name: Prepare .env for Examples -# run: | -# echo "OPERATOR_KEY=0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" > examples/.env -# echo "OPERATOR_ID=0.0.1022" >> examples/.env -# echo "HEDERA_NETWORK=localhost" >> examples/.env -# -# - name: Run Examples -# run: ./gradlew :examples:runAllExamples --scan -# -# - name: Stop the local node -# run: npx @hashgraph/hedera-local stop + run-examples: + name: Run Examples + runs-on: client-sdk-linux-medium + needs: + - build + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + with: + egress-policy: audit + + - name: Checkout Code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup NodeJS + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 18 + + - name: Setup Java + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + with: + distribution: temurin + java-version: 17 + + - name: Setup Android SDK + uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1 + + - name: Install Local Node + run: npm install @hashgraph/hedera-local + + - name: Build SDK + run: ./gradlew assemble --scan + + - name: Build Android Example + run: ./gradlew -p example-android assemble --scan + + - name: Start the local node + run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.57.0 + + - name: Prepare .env for Examples + run: | + echo "OPERATOR_KEY=0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" > examples/.env + echo "OPERATOR_ID=0.0.1022" >> examples/.env + echo "HEDERA_NETWORK=localhost" >> examples/.env + + - name: Run Examples + run: ./gradlew :examples:runAllExamples --scan + + - name: Stop the local node + run: npx @hashgraph/hedera-local stop test-tck: name: TCK Tests diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java index 689365b88d..34ef054387 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java index 2425ecbac8..8eb7006899 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java index a515afde80..fecb71cc05 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java index 3504f9827e..8b3a54b917 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java index cbf7dcda1a..08a7b9b672 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java index 6290b92658..0a295a1a6b 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.io.BufferedReader; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java index 0ae1918bc8..61d44e3b93 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java index 09e2792018..dc92c18c8c 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java index 769e0e1dab..a3e82db261 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java index 2b8923a552..1522690edb 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java index c15ac1f6d4..f6aaa8da2d 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java index c0fb113e31..ac09abc0d3 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java index a88564417a..06d0076b02 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; @@ -92,7 +93,7 @@ public static void main(String[] args) throws Exception { // The default max fee of 1 Hbar is not enough to create a file (starts around ~1.1 Hbar). .setMaxTransactionFee(Hbar.from(2)) .execute(client); - + TransactionReceipt fileCreateTxReceipt = fileCreateTxResponse.getReceipt(client); FileId newFileId = fileCreateTxReceipt.fileId; Objects.requireNonNull(newFileId); diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java index af2a9ef265..83482b17d5 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java index 13569a35c1..7a872ae3c1 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java index c4505b353b..eff03f1ef9 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java index ece6b91782..be25d653b4 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java index 0fb13f7f26..824093fbfe 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExampleTemplate.java @@ -23,8 +23,8 @@ import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.PrivateKey; import com.hedera.hashgraph.sdk.PublicKey; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java index d533bf846c..00e22ba94b 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java index 6f3b999e21..ce8cbf7881 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java index d0f9341e2d..4255f377dd 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java @@ -23,8 +23,8 @@ import com.hedera.hashgraph.sdk.AccountId; import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java index 66d84d2dd3..95adc4b182 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java index 06398a5aba..36ce6eee21 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java @@ -23,8 +23,8 @@ import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.FileId; import com.hedera.hashgraph.sdk.NodeAddressBook; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.io.ByteArrayInputStream; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java index ec32465990..1d81bd129a 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java @@ -20,8 +20,9 @@ package com.hedera.hashgraph.sdk.examples; import com.google.protobuf.ByteString; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java index 5b02ce87d2..9f27503698 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java @@ -20,8 +20,9 @@ package com.hedera.hashgraph.sdk.examples; import com.google.protobuf.ByteString; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java index ea81d04ccb..20ba0e68ba 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java @@ -25,8 +25,8 @@ import com.hedera.hashgraph.sdk.Client; import com.hedera.hashgraph.sdk.Hbar; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.List; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java index 959716040f..27dd7d127a 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java index 8fea8865e8..7c56bfc6f0 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/LongTermScheduledTransactionExample.java @@ -31,8 +31,8 @@ import com.hedera.hashgraph.sdk.ScheduleInfoQuery; import com.hedera.hashgraph.sdk.ScheduleSignTransaction; import com.hedera.hashgraph.sdk.TransferTransaction; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.time.Instant; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java index 21bb885f62..b90eab231f 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MirrorNodeContractQueriesExample.java @@ -28,8 +28,8 @@ import com.hedera.hashgraph.sdk.MirrorNodeContractCallQuery; import com.hedera.hashgraph.sdk.MirrorNodeContractEstimateGasQuery; import com.hedera.hashgraph.sdk.PrivateKey; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java index a0cdc0ed48..d3fbe68092 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java index 83f0a7db1d..74899972e6 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java index acf221dd3c..e45dc96e2f 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.StandardCharsets; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java index 7cb69884c1..5e88c5d9ec 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java index 2d71d13bb5..acf8fcd156 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.time.Instant; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java index 76eb1fe953..7badc153a6 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java index 5219d93271..1f0de7271e 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java index 5907614e07..596bd65fa7 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java index c65d4ebf51..d22ef23dd7 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java index ff7dd9dd52..c89b8b27b7 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java index 867793c1b2..dab731ff2d 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java index 106d581c14..f41f6477ed 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java index bc439b8751..b9de23e6a0 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenAirdropExample.java @@ -33,8 +33,8 @@ import com.hedera.hashgraph.sdk.TokenRejectTransaction; import com.hedera.hashgraph.sdk.TokenSupplyType; import com.hedera.hashgraph.sdk.TokenType; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.ArrayList; import java.util.List; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java index 220cb8a04f..4c44712f67 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenMetadataExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java index 52d57eab23..5d4be4bb1e 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.ArrayList; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java index 636d89ce83..0ce17ea2d4 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java index 05f2b9f33a..07833f9893 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java index bcf8d9edef..a99e149f66 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java index 16ff23aabd..f0b9821b61 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java index 1fd0ebd53b..2ab3961ed4 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java index 4b07900ef4..e1b0eeea24 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Objects; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java index 460dc4095c..bacf9d84fe 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateNftsMetadataExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Arrays; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java index 97a260a980..6d50738518 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.nio.charset.Charset; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java index 693c01e01e..747099f8d8 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java @@ -19,8 +19,9 @@ */ package com.hedera.hashgraph.sdk.examples; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import com.hedera.hashgraph.sdk.*; +import com.hedera.hashgraph.sdk.logger.LogLevel; +import com.hedera.hashgraph.sdk.logger.Logger; import io.github.cdimascio.dotenv.Dotenv; import java.util.Collections; diff --git a/examples/src/main/java/module-info.java b/examples/src/main/java/module-info.java index 630793aa25..7242d5b8cf 100644 --- a/examples/src/main/java/module-info.java +++ b/examples/src/main/java/module-info.java @@ -18,8 +18,8 @@ * */ -module com.hiero.examples { - requires com.hiero.sdk; // .full; +module com.hedera.hashgraph.examples { + requires com.hedera.hashgraph.sdk; // .full; requires com.google.gson; requires io.github.cdimascio.dotenv.java; requires org.bouncycastle.provider; diff --git a/settings.gradle.kts b/settings.gradle.kts index 65c9e0c160..f8e73fee97 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,6 +9,6 @@ javaModules { module("tck") { group = "com.hiero.sdk.tck" } } -// includeBuild("examples") -// -// includeBuild("example-android") +includeBuild("examples") + +includeBuild("example-android") From e185d2fdb55734ede8fa201dc7cba58ad9e33a1e Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 14:25:24 +0200 Subject: [PATCH 07/15] chore: revert jacoco Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 4 ++-- .github/workflows/disabled/main.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd632b2e3c..d5a809d128 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: run: ./gradlew assemble --scan - name: Code Quality Checks - run: ./gradlew qualityCheck --continue --scan + run: ./gradlew qualityCheck :examples:qualityCheck --continue --scan - name: Start Local Node run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.57.0 @@ -101,7 +101,7 @@ jobs: OPERATOR_ID: '0.0.1022' HEDERA_NETWORK: 'localhost' run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK testIntegration --scan + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK jacocoTestReport --scan - name: Upload coverage to Codecov if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }} diff --git a/.github/workflows/disabled/main.yml b/.github/workflows/disabled/main.yml index 981878d674..7d9d543458 100644 --- a/.github/workflows/disabled/main.yml +++ b/.github/workflows/disabled/main.yml @@ -68,4 +68,4 @@ jobs: cd hedera-services docker-compose up & cd ../hedera-sdk-java - ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID testIntegration + ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID jacocoTestReport From b976dd0b9d4d52fe87b407628d6bb2867373760b Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 16:22:30 +0200 Subject: [PATCH 08/15] rename com.hiero to org.hiero Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 4 +- .github/workflows/disabled/testnet.yml | 2 +- .github/workflows/release-artifacts.yml | 2 +- examples/build.gradle.kts | 1 + gradle/aggregation/build.gradle.kts | 28 +++++ scripts/update_protobufs.py | 6 +- sdk-full/src/main/java/module-info.java | 10 +- sdk/src/main/java/module-info.java | 10 +- .../sdk/AbstractTokenTransferTransaction.java | 20 +-- .../AccountAllowanceAdjustTransaction.java | 14 +-- .../AccountAllowanceApproveTransaction.java | 20 +-- .../AccountAllowanceDeleteTransaction.java | 20 +-- .../hiero/sdk/AccountBalance.java | 6 +- .../hiero/sdk/AccountBalanceQuery.java | 20 +-- .../hiero/sdk/AccountCreateTransaction.java | 20 +-- .../hiero/sdk/AccountDeleteTransaction.java | 18 +-- .../{com => org}/hiero/sdk/AccountId.java | 4 +- .../{com => org}/hiero/sdk/AccountInfo.java | 8 +- .../hiero/sdk/AccountInfoFlow.java | 2 +- .../hiero/sdk/AccountInfoQuery.java | 20 +-- .../hiero/sdk/AccountRecordsQuery.java | 20 +-- .../hiero/sdk/AccountStakersQuery.java | 20 +-- .../hiero/sdk/AccountUpdateTransaction.java | 18 +-- .../hiero/sdk/AddressBookQuery.java | 16 +-- .../hiero/sdk/AssessedCustomFee.java | 12 +- .../hiero/sdk/BadEntityIdException.java | 2 +- .../hiero/sdk/BadKeyException.java | 2 +- .../hiero/sdk/BadMnemonicException.java | 2 +- .../hiero/sdk/BadMnemonicReason.java | 2 +- .../{com => org}/hiero/sdk/BaseNetwork.java | 2 +- .../java/{com => org}/hiero/sdk/BaseNode.java | 2 +- .../hiero/sdk/BaseNodeAddress.java | 2 +- .../hiero/sdk/ChunkedTransaction.java | 18 +-- .../java/{com => org}/hiero/sdk/Client.java | 30 ++--- .../hiero/sdk/ConsumerHelper.java | 2 +- .../hiero/sdk/ContractByteCodeQuery.java | 20 +-- .../hiero/sdk/ContractCallQuery.java | 20 +-- .../hiero/sdk/ContractCreateFlow.java | 2 +- .../hiero/sdk/ContractCreateTransaction.java | 18 +-- .../hiero/sdk/ContractDeleteTransaction.java | 18 +-- .../hiero/sdk/ContractExecuteTransaction.java | 18 +-- .../hiero/sdk/ContractFunctionParameters.java | 2 +- .../hiero/sdk/ContractFunctionResult.java | 10 +- .../hiero/sdk/ContractFunctionSelector.java | 2 +- .../{com => org}/hiero/sdk/ContractId.java | 8 +- .../{com => org}/hiero/sdk/ContractInfo.java | 4 +- .../hiero/sdk/ContractInfoQuery.java | 20 +-- .../hiero/sdk/ContractLogInfo.java | 10 +- .../hiero/sdk/ContractNonceInfo.java | 10 +- .../hiero/sdk/ContractStateChange.java | 10 +- .../hiero/sdk/ContractUpdateTransaction.java | 20 +-- .../java/{com => org}/hiero/sdk/Crypto.java | 2 +- .../{com => org}/hiero/sdk/CustomFee.java | 12 +- .../{com => org}/hiero/sdk/CustomFeeBase.java | 2 +- .../hiero/sdk/CustomFixedFee.java | 8 +- .../hiero/sdk/CustomFractionalFee.java | 10 +- .../hiero/sdk/CustomRoyaltyFee.java | 10 +- .../java/{com => org}/hiero/sdk/Delayer.java | 2 +- .../hiero/sdk/DelegateContractId.java | 8 +- .../hiero/sdk/DurationConverter.java | 8 +- .../java/{com => org}/hiero/sdk/Endpoint.java | 4 +- .../hiero/sdk/EntityIdHelper.java | 2 +- .../{com => org}/hiero/sdk/EthereumFlow.java | 2 +- .../hiero/sdk/EthereumTransaction.java | 18 +-- .../hiero/sdk/EthereumTransactionData.java | 2 +- .../sdk/EthereumTransactionDataEip1559.java | 2 +- .../sdk/EthereumTransactionDataLegacy.java | 2 +- .../{com => org}/hiero/sdk/EvmAddress.java | 4 +- .../{com => org}/hiero/sdk/ExchangeRate.java | 4 +- .../{com => org}/hiero/sdk/ExchangeRates.java | 6 +- .../{com => org}/hiero/sdk/Executable.java | 8 +- .../hiero/sdk/ExecutionState.java | 2 +- .../hiero/sdk/FeeAssessmentMethod.java | 2 +- .../{com => org}/hiero/sdk/FeeComponents.java | 10 +- .../java/{com => org}/hiero/sdk/FeeData.java | 12 +- .../{com => org}/hiero/sdk/FeeDataType.java | 4 +- .../{com => org}/hiero/sdk/FeeSchedule.java | 10 +- .../{com => org}/hiero/sdk/FeeSchedules.java | 4 +- .../hiero/sdk/FileAppendTransaction.java | 22 ++-- .../hiero/sdk/FileContentsQuery.java | 20 +-- .../hiero/sdk/FileCreateTransaction.java | 26 ++-- .../hiero/sdk/FileDeleteTransaction.java | 22 ++-- .../java/{com => org}/hiero/sdk/FileId.java | 4 +- .../java/{com => org}/hiero/sdk/FileInfo.java | 6 +- .../{com => org}/hiero/sdk/FileInfoQuery.java | 20 +-- .../hiero/sdk/FileUpdateTransaction.java | 20 +-- .../hiero/sdk/FreezeTransaction.java | 22 ++-- .../{com => org}/hiero/sdk/FreezeType.java | 20 +-- .../hiero/sdk/FutureConverter.java | 2 +- .../java/{com => org}/hiero/sdk/Hbar.java | 20 +-- .../{com => org}/hiero/sdk/HbarAllowance.java | 6 +- .../java/{com => org}/hiero/sdk/HbarUnit.java | 2 +- .../sdk/HederaPreCheckStatusException.java | 2 +- .../sdk/HederaReceiptStatusException.java | 2 +- .../hiero/sdk/HederaTrustManager.java | 2 +- .../hiero/sdk/InstantConverter.java | 6 +- .../main/java/{com => org}/hiero/sdk/Key.java | 8 +- .../java/{com => org}/hiero/sdk/KeyList.java | 18 +-- .../java/{com => org}/hiero/sdk/Keystore.java | 2 +- .../java/{com => org}/hiero/sdk/LedgerId.java | 2 +- .../java/{com => org}/hiero/sdk/LiveHash.java | 12 +- .../hiero/sdk/LiveHashAddTransaction.java | 20 +-- .../hiero/sdk/LiveHashDeleteTransaction.java | 18 +-- .../{com => org}/hiero/sdk/LiveHashQuery.java | 20 +-- .../{com => org}/hiero/sdk/LockableList.java | 2 +- .../sdk/MaxAttemptsExceededException.java | 2 +- .../sdk/MaxQueryPaymentExceededException.java | 2 +- .../{com => org}/hiero/sdk/MirrorNetwork.java | 2 +- .../{com => org}/hiero/sdk/MirrorNode.java | 2 +- .../sdk/MirrorNodeContractCallQuery.java | 2 +- .../MirrorNodeContractEstimateGasQuery.java | 2 +- .../hiero/sdk/MirrorNodeContractQuery.java | 8 +- .../java/{com => org}/hiero/sdk/Mnemonic.java | 4 +- .../java/{com => org}/hiero/sdk/Network.java | 4 +- .../{com => org}/hiero/sdk/NetworkName.java | 2 +- .../hiero/sdk/NetworkVersionInfo.java | 4 +- .../hiero/sdk/NetworkVersionInfoQuery.java | 20 +-- .../java/{com => org}/hiero/sdk/NftId.java | 4 +- .../java/{com => org}/hiero/sdk/Node.java | 2 +- .../{com => org}/hiero/sdk/NodeAddress.java | 10 +- .../hiero/sdk/NodeAddressBook.java | 10 +- .../hiero/sdk/NodeCreateTransaction.java | 20 +-- .../hiero/sdk/NodeDeleteTransaction.java | 18 +-- .../hiero/sdk/NodeUpdateTransaction.java | 20 +-- .../main/java/{com => org}/hiero/sdk/Pem.java | 2 +- .../hiero/sdk/PendingAirdropId.java | 8 +- .../hiero/sdk/PendingAirdropLogic.java | 6 +- .../hiero/sdk/PendingAirdropRecord.java | 10 +- .../hiero/sdk/PrecheckStatusException.java | 2 +- .../{com => org}/hiero/sdk/PrivateKey.java | 12 +- .../hiero/sdk/PrivateKeyECDSA.java | 4 +- .../hiero/sdk/PrivateKeyED25519.java | 4 +- .../hiero/sdk/PrngTransaction.java | 8 +- .../{com => org}/hiero/sdk/ProxyStaker.java | 4 +- .../{com => org}/hiero/sdk/PublicKey.java | 6 +- .../hiero/sdk/PublicKeyECDSA.java | 10 +- .../hiero/sdk/PublicKeyED25519.java | 8 +- .../java/{com => org}/hiero/sdk/Query.java | 38 +++--- .../hiero/sdk/ReceiptStatusException.java | 2 +- .../{com => org}/hiero/sdk/RequestType.java | 4 +- .../hiero/sdk/ScheduleCreateTransaction.java | 18 +-- .../hiero/sdk/ScheduleDeleteTransaction.java | 20 +-- .../{com => org}/hiero/sdk/ScheduleId.java | 4 +- .../{com => org}/hiero/sdk/ScheduleInfo.java | 12 +- .../hiero/sdk/ScheduleInfoQuery.java | 20 +-- .../hiero/sdk/ScheduleSignTransaction.java | 18 +-- .../hiero/sdk/SemanticVersion.java | 10 +- .../{com => org}/hiero/sdk/StakingInfo.java | 10 +- .../java/{com => org}/hiero/sdk/Status.java | 4 +- .../{com => org}/hiero/sdk/StorageChange.java | 10 +- .../hiero/sdk/SubscriptionHandle.java | 2 +- .../hiero/sdk/SystemDeleteTransaction.java | 22 ++-- .../hiero/sdk/SystemUndeleteTransaction.java | 22 ++-- .../hiero/sdk/ThreadLocalSecureRandom.java | 2 +- .../hiero/sdk/TokenAirdropTransaction.java | 20 +-- .../hiero/sdk/TokenAllowance.java | 12 +- .../hiero/sdk/TokenAssociateTransaction.java | 20 +-- .../hiero/sdk/TokenAssociation.java | 10 +- .../hiero/sdk/TokenBurnTransaction.java | 22 ++-- .../sdk/TokenCancelAirdropTransaction.java | 20 +-- .../sdk/TokenClaimAirdropTransaction.java | 20 +-- .../hiero/sdk/TokenCreateTransaction.java | 20 +-- .../hiero/sdk/TokenDeleteTransaction.java | 22 ++-- .../hiero/sdk/TokenDissociateTransaction.java | 22 ++-- .../TokenFeeScheduleUpdateTransaction.java | 20 +-- .../hiero/sdk/TokenFreezeTransaction.java | 22 ++-- .../hiero/sdk/TokenGrantKycTransaction.java | 22 ++-- .../java/{com => org}/hiero/sdk/TokenId.java | 4 +- .../{com => org}/hiero/sdk/TokenInfo.java | 14 +-- .../hiero/sdk/TokenInfoQuery.java | 20 +-- .../hiero/sdk/TokenKeyValidation.java | 14 +-- .../hiero/sdk/TokenMintTransaction.java | 22 ++-- .../hiero/sdk/TokenNftAllowance.java | 6 +- .../{com => org}/hiero/sdk/TokenNftInfo.java | 10 +- .../hiero/sdk/TokenNftInfoQuery.java | 24 ++-- .../hiero/sdk/TokenNftTransfer.java | 8 +- .../hiero/sdk/TokenPauseTransaction.java | 20 +-- .../hiero/sdk/TokenRejectFlow.java | 2 +- .../hiero/sdk/TokenRejectTransaction.java | 22 ++-- .../hiero/sdk/TokenRelationship.java | 14 +-- .../hiero/sdk/TokenRevokeKycTransaction.java | 22 ++-- .../hiero/sdk/TokenSupplyType.java | 14 +-- .../{com => org}/hiero/sdk/TokenTransfer.java | 6 +- .../hiero/sdk/TokenTransferList.java | 10 +- .../{com => org}/hiero/sdk/TokenType.java | 14 +-- .../hiero/sdk/TokenUnfreezeTransaction.java | 22 ++-- .../hiero/sdk/TokenUnpauseTransaction.java | 20 +-- .../hiero/sdk/TokenUpdateNftsTransaction.java | 20 +-- .../hiero/sdk/TokenUpdateTransaction.java | 20 +-- .../hiero/sdk/TokenWipeTransaction.java | 22 ++-- .../hiero/sdk/TopicCreateTransaction.java | 20 +-- .../hiero/sdk/TopicDeleteTransaction.java | 20 +-- .../java/{com => org}/hiero/sdk/TopicId.java | 4 +- .../{com => org}/hiero/sdk/TopicInfo.java | 6 +- .../hiero/sdk/TopicInfoQuery.java | 20 +-- .../{com => org}/hiero/sdk/TopicMessage.java | 4 +- .../hiero/sdk/TopicMessageChunk.java | 4 +- .../hiero/sdk/TopicMessageQuery.java | 12 +- .../sdk/TopicMessageSubmitTransaction.java | 24 ++-- .../hiero/sdk/TopicUpdateTransaction.java | 20 +-- .../{com => org}/hiero/sdk/Transaction.java | 50 ++++---- .../hiero/sdk/TransactionFeeSchedule.java | 12 +- .../{com => org}/hiero/sdk/TransactionId.java | 6 +- .../hiero/sdk/TransactionReceipt.java | 20 +-- .../hiero/sdk/TransactionReceiptQuery.java | 22 ++-- .../hiero/sdk/TransactionRecord.java | 20 +-- .../hiero/sdk/TransactionRecordQuery.java | 22 ++-- .../hiero/sdk/TransactionResponse.java | 6 +- .../java/{com => org}/hiero/sdk/Transfer.java | 4 +- .../hiero/sdk/TransferTransaction.java | 24 ++-- .../hiero/sdk/logger/LogLevel.java | 2 +- .../{com => org}/hiero/sdk/logger/Logger.java | 2 +- .../{com => org}/hiero/sdk/package-info.java | 2 +- .../hiero/sdk/utils/Bip32Utils.java | 2 +- sdk/src/main/proto/account.proto | 2 +- .../main/proto/account_pending_airdrop.proto | 2 +- sdk/src/main/proto/address_book_service.proto | 2 +- sdk/src/main/proto/basic_types.proto | 2 +- sdk/src/main/proto/block_info.proto | 2 +- sdk/src/main/proto/block_stream_info.proto | 2 +- sdk/src/main/proto/bytecode.proto | 2 +- sdk/src/main/proto/common.proto | 2 +- .../main/proto/congestion_level_starts.proto | 2 +- .../main/proto/consensus_create_topic.proto | 2 +- .../main/proto/consensus_delete_topic.proto | 2 +- .../main/proto/consensus_get_topic_info.proto | 2 +- sdk/src/main/proto/consensus_service.proto | 2 +- .../main/proto/consensus_submit_message.proto | 2 +- sdk/src/main/proto/consensus_topic_info.proto | 2 +- .../main/proto/consensus_update_topic.proto | 2 +- sdk/src/main/proto/contract_call.proto | 2 +- sdk/src/main/proto/contract_call_local.proto | 2 +- sdk/src/main/proto/contract_create.proto | 2 +- sdk/src/main/proto/contract_delete.proto | 2 +- .../main/proto/contract_get_bytecode.proto | 2 +- sdk/src/main/proto/contract_get_info.proto | 2 +- sdk/src/main/proto/contract_get_records.proto | 2 +- sdk/src/main/proto/contract_types.proto | 2 +- sdk/src/main/proto/contract_update.proto | 2 +- sdk/src/main/proto/crypto_add_live_hash.proto | 2 +- .../main/proto/crypto_approve_allowance.proto | 2 +- sdk/src/main/proto/crypto_create.proto | 2 +- sdk/src/main/proto/crypto_delete.proto | 2 +- .../main/proto/crypto_delete_allowance.proto | 2 +- .../main/proto/crypto_delete_live_hash.proto | 2 +- .../proto/crypto_get_account_balance.proto | 2 +- .../proto/crypto_get_account_records.proto | 2 +- sdk/src/main/proto/crypto_get_info.proto | 2 +- sdk/src/main/proto/crypto_get_live_hash.proto | 2 +- sdk/src/main/proto/crypto_get_stakers.proto | 2 +- sdk/src/main/proto/crypto_service.proto | 2 +- sdk/src/main/proto/crypto_transfer.proto | 2 +- sdk/src/main/proto/crypto_update.proto | 2 +- sdk/src/main/proto/custom_fees.proto | 2 +- sdk/src/main/proto/duration.proto | 2 +- sdk/src/main/proto/ethereum_transaction.proto | 2 +- sdk/src/main/proto/exchange_rate.proto | 2 +- sdk/src/main/proto/file.proto | 2 +- sdk/src/main/proto/file_append.proto | 2 +- sdk/src/main/proto/file_create.proto | 2 +- sdk/src/main/proto/file_delete.proto | 2 +- sdk/src/main/proto/file_get_contents.proto | 2 +- sdk/src/main/proto/file_get_info.proto | 2 +- sdk/src/main/proto/file_service.proto | 2 +- sdk/src/main/proto/file_update.proto | 2 +- sdk/src/main/proto/freeze.proto | 2 +- sdk/src/main/proto/freeze_service.proto | 2 +- sdk/src/main/proto/freeze_type.proto | 2 +- sdk/src/main/proto/get_account_details.proto | 2 +- sdk/src/main/proto/get_by_key.proto | 2 +- sdk/src/main/proto/get_by_solidity_id.proto | 2 +- sdk/src/main/proto/ledger_id.proto | 2 +- .../main/proto/mirror/consensus_service.proto | 2 +- .../proto/mirror/mirror_network_service.proto | 2 +- .../proto/network_get_execution_time.proto | 2 +- .../main/proto/network_get_version_info.proto | 2 +- sdk/src/main/proto/network_service.proto | 2 +- .../main/proto/network_staking_rewards.proto | 2 +- sdk/src/main/proto/nft.proto | 2 +- sdk/src/main/proto/node.proto | 2 +- sdk/src/main/proto/node_create.proto | 2 +- sdk/src/main/proto/node_delete.proto | 2 +- sdk/src/main/proto/node_stake_update.proto | 2 +- sdk/src/main/proto/node_update.proto | 2 +- sdk/src/main/proto/primitives.proto | 2 +- sdk/src/main/proto/query.proto | 2 +- sdk/src/main/proto/query_header.proto | 2 +- sdk/src/main/proto/recordcache.proto | 2 +- sdk/src/main/proto/response.proto | 2 +- sdk/src/main/proto/response_code.proto | 2 +- sdk/src/main/proto/response_header.proto | 2 +- sdk/src/main/proto/roster.proto | 2 +- sdk/src/main/proto/roster_state.proto | 2 +- sdk/src/main/proto/running_hashes.proto | 2 +- .../proto/schedulable_transaction_body.proto | 2 +- sdk/src/main/proto/schedule.proto | 2 +- sdk/src/main/proto/schedule_create.proto | 2 +- sdk/src/main/proto/schedule_delete.proto | 2 +- sdk/src/main/proto/schedule_get_info.proto | 2 +- sdk/src/main/proto/schedule_service.proto | 2 +- sdk/src/main/proto/schedule_sign.proto | 2 +- .../main/proto/smart_contract_service.proto | 2 +- sdk/src/main/proto/staking_node_info.proto | 2 +- sdk/src/main/proto/storage_slot.proto | 2 +- sdk/src/main/proto/system_delete.proto | 2 +- sdk/src/main/proto/system_undelete.proto | 2 +- sdk/src/main/proto/throttle_definitions.proto | 2 +- .../main/proto/throttle_usage_snapshots.proto | 2 +- sdk/src/main/proto/timestamp.proto | 2 +- sdk/src/main/proto/token.proto | 2 +- sdk/src/main/proto/token_airdrop.proto | 2 +- sdk/src/main/proto/token_associate.proto | 2 +- sdk/src/main/proto/token_burn.proto | 2 +- sdk/src/main/proto/token_cancel_airdrop.proto | 2 +- sdk/src/main/proto/token_claim_airdrop.proto | 2 +- sdk/src/main/proto/token_create.proto | 2 +- sdk/src/main/proto/token_delete.proto | 2 +- sdk/src/main/proto/token_dissociate.proto | 2 +- .../proto/token_fee_schedule_update.proto | 2 +- sdk/src/main/proto/token_freeze_account.proto | 2 +- .../proto/token_get_account_nft_infos.proto | 2 +- sdk/src/main/proto/token_get_info.proto | 2 +- sdk/src/main/proto/token_get_nft_info.proto | 2 +- sdk/src/main/proto/token_get_nft_infos.proto | 2 +- sdk/src/main/proto/token_grant_kyc.proto | 2 +- sdk/src/main/proto/token_mint.proto | 2 +- sdk/src/main/proto/token_pause.proto | 2 +- sdk/src/main/proto/token_reject.proto | 2 +- sdk/src/main/proto/token_relation.proto | 2 +- sdk/src/main/proto/token_revoke_kyc.proto | 2 +- sdk/src/main/proto/token_service.proto | 2 +- .../main/proto/token_unfreeze_account.proto | 2 +- sdk/src/main/proto/token_unpause.proto | 2 +- sdk/src/main/proto/token_update.proto | 2 +- sdk/src/main/proto/token_update_nfts.proto | 2 +- sdk/src/main/proto/token_wipe_account.proto | 2 +- sdk/src/main/proto/topic.proto | 2 +- sdk/src/main/proto/transaction.proto | 2 +- sdk/src/main/proto/transaction_body.proto | 2 +- sdk/src/main/proto/transaction_contents.proto | 2 +- .../proto/transaction_get_fast_record.proto | 2 +- .../main/proto/transaction_get_receipt.proto | 2 +- .../main/proto/transaction_get_record.proto | 2 +- sdk/src/main/proto/transaction_list.proto | 2 +- sdk/src/main/proto/transaction_receipt.proto | 2 +- sdk/src/main/proto/transaction_record.proto | 2 +- sdk/src/main/proto/transaction_response.proto | 2 +- sdk/src/main/proto/unchecked_submit.proto | 2 +- sdk/src/main/proto/util_prng.proto | 2 +- sdk/src/main/proto/util_service.proto | 2 +- .../hiero/sdk/AccountBalanceQueryTest.snap | 8 -- .../java/com/hiero/sdk/AccountIdTest.snap | 88 -------------- .../com/hiero/sdk/AccountInfoQueryTest.snap | 3 - .../hiero/sdk/AccountRecordsQueryTest.snap | 3 - .../hiero/sdk/AccountStakersQueryTest.snap | 3 - .../hiero/sdk/ContractByteCodeQueryTest.snap | 3 - .../java/com/hiero/sdk/ContractIdTest.snap | 48 -------- .../com/hiero/sdk/ContractInfoQueryTest.snap | 3 - .../com/hiero/sdk/DelegateContractIdTest.snap | 28 ----- .../com/hiero/sdk/FileContentsQueryTest.snap | 3 - .../test/java/com/hiero/sdk/FileIdTest.snap | 23 ---- .../java/com/hiero/sdk/FileInfoQueryTest.snap | 3 - .../sdk/NetworkVersionInfoQueryTest.snap | 3 - .../com/hiero/sdk/NetworkVersionInfoTest.snap | 3 - .../test/java/com/hiero/sdk/NftIdTest.snap | 33 ----- .../com/hiero/sdk/ScheduleInfoQueryTest.snap | 3 - .../com/hiero/sdk/TokenAssociationTest.snap | 3 - .../com/hiero/sdk/TokenInfoQueryTest.snap | 3 - .../com/hiero/sdk/TokenSupplyTypeTest.snap | 10 -- .../test/java/com/hiero/sdk/TopicIdTest.snap | 23 ---- .../com/hiero/sdk/TopicInfoQueryTest.snap | 3 - .../java/com/hiero/sdk/TransactionIdTest.snap | 8 -- ...ccountAllowanceApproveTransactionTest.java | 6 +- ...ccountAllowanceApproveTransactionTest.snap | 4 +- ...AccountAllowanceDeleteTransactionTest.java | 6 +- ...AccountAllowanceDeleteTransactionTest.snap | 4 +- .../hiero/sdk/AccountBalanceQueryTest.java | 8 +- .../hiero/sdk/AccountBalanceQueryTest.snap | 8 ++ .../sdk/AccountCreateTransactionTest.java | 6 +- .../sdk/AccountCreateTransactionTest.snap | 8 +- .../sdk/AccountDeleteTransactionTest.java | 6 +- .../sdk/AccountDeleteTransactionTest.snap | 4 +- .../{com => org}/hiero/sdk/AccountIdTest.java | 2 +- .../java/org/hiero/sdk/AccountIdTest.snap | 88 ++++++++++++++ .../hiero/sdk/AccountInfoQueryTest.java | 6 +- .../org/hiero/sdk/AccountInfoQueryTest.snap | 3 + .../hiero/sdk/AccountInfoTest.java | 8 +- .../hiero/sdk/AccountInfoTest.snap | 10 +- .../hiero/sdk/AccountRecordsQueryTest.java | 6 +- .../hiero/sdk/AccountRecordsQueryTest.snap | 3 + .../hiero/sdk/AccountStakersQueryTest.java | 6 +- .../hiero/sdk/AccountStakersQueryTest.snap | 3 + .../sdk/AccountUpdateTransactionTest.java | 6 +- .../sdk/AccountUpdateTransactionTest.snap | 8 +- .../hiero/sdk/AddressBookQueryMockTest.java | 34 +++--- .../hiero/sdk/AllowancesTest.java | 2 +- .../hiero/sdk/AllowancesTest.snap | 2 +- .../hiero/sdk/AssessedCustomFeeTest.java | 4 +- .../hiero/sdk/AssessedCustomFeeTest.snap | 8 +- .../hiero/sdk/BaseNodeAddressTest.java | 8 +- .../hiero/sdk/ClientCloseTest.java | 8 +- .../{com => org}/hiero/sdk/ClientTest.java | 18 +-- .../hiero/sdk/ConsumerHelperTest.java | 2 +- .../hiero/sdk/ContractByteCodeQueryTest.java | 6 +- .../hiero/sdk/ContractByteCodeQueryTest.snap | 3 + .../hiero/sdk/ContractCallQueryTest.java | 8 +- .../hiero/sdk/ContractCallQueryTest.snap | 8 +- .../sdk/ContractCreateTransactionTest.java | 6 +- .../sdk/ContractCreateTransactionTest.snap | 8 +- .../sdk/ContractDeleteTransactionTest.java | 6 +- .../sdk/ContractDeleteTransactionTest.snap | 4 +- .../sdk/ContractExecuteTransactionTest.java | 6 +- .../sdk/ContractExecuteTransactionTest.snap | 4 +- .../sdk/ContractFunctionParametersTest.java | 2 +- .../sdk/ContractFunctionParametersTest.snap | 2 +- .../hiero/sdk/ContractFunctionResultTest.java | 6 +- .../sdk/ContractFunctionSelectorTest.java | 2 +- .../hiero/sdk/ContractIdTest.java | 2 +- .../java/org/hiero/sdk/ContractIdTest.snap | 48 ++++++++ .../hiero/sdk/ContractInfoQueryTest.java | 6 +- .../org/hiero/sdk/ContractInfoQueryTest.snap | 3 + .../hiero/sdk/ContractInfoTest.java | 4 +- .../hiero/sdk/ContractInfoTest.snap | 8 +- .../hiero/sdk/ContractLogInfoTest.java | 4 +- .../hiero/sdk/ContractLogInfoTest.snap | 10 +- .../hiero/sdk/ContractNonceInfoTest.java | 4 +- .../hiero/sdk/ContractNonceInfoTest.snap | 8 +- .../sdk/ContractUpdateTransactionTest.java | 6 +- .../sdk/ContractUpdateTransactionTest.snap | 8 +- .../sdk/CryptoTransferTransactionTest.java | 12 +- .../sdk/CryptoTransferTransactionTest.snap | 4 +- .../hiero/sdk/CustomFeeListTest.java | 2 +- .../hiero/sdk/CustomFeeListTest.snap | 4 +- .../hiero/sdk/CustomFixedFeeTest.java | 4 +- .../hiero/sdk/CustomFixedFeeTest.snap | 10 +- .../hiero/sdk/CustomFractionalFeeTest.java | 6 +- .../hiero/sdk/CustomFractionalFeeTest.snap | 6 +- .../hiero/sdk/CustomRoyaltyFeeTest.java | 8 +- .../hiero/sdk/CustomRoyaltyFeeTest.snap | 6 +- .../hiero/sdk/DelegateContractIdTest.java | 2 +- .../org/hiero/sdk/DelegateContractIdTest.snap | 28 +++++ .../hiero/sdk/DuplicateTransactionTest.java | 2 +- .../hiero/sdk/ECDSAPrivateKeyTest.java | 4 +- .../hiero/sdk/ECDSAPublicKeyTest.java | 11 +- .../hiero/sdk/Ed25519PrivateKeyTest.java | 7 +- .../hiero/sdk/Ed25519PublicKeyTest.java | 8 +- .../hiero/sdk/EthereumFlowMockTest.java | 23 ++-- .../EthereumTransactionDataLegacyTest.java | 2 +- .../hiero/sdk/EthereumTransactionTest.java | 2 +- .../hiero/sdk/EthereumTransactionTest.snap | 4 +- .../hiero/sdk/ExchangeRatesTest.java | 2 +- .../hiero/sdk/ExecutableTest.java | 115 +++++++++--------- .../hiero/sdk/FeeAssessmentMethodTest.java | 4 +- .../hiero/sdk/FeeSchedulesTest.java | 2 +- .../hiero/sdk/FeeSchedulesTest.snap | 2 +- .../hiero/sdk/FileAppendTransactionTest.java | 6 +- .../hiero/sdk/FileAppendTransactionTest.snap | 14 +-- .../hiero/sdk/FileContentsQueryTest.java | 6 +- .../org/hiero/sdk/FileContentsQueryTest.snap | 3 + .../hiero/sdk/FileCreateTransactionTest.java | 6 +- .../hiero/sdk/FileCreateTransactionTest.snap | 4 +- .../hiero/sdk/FileDeleteTransactionTest.java | 6 +- .../hiero/sdk/FileDeleteTransactionTest.snap | 4 +- .../{com => org}/hiero/sdk/FileIdTest.java | 2 +- .../test/java/org/hiero/sdk/FileIdTest.snap | 23 ++++ .../hiero/sdk/FileInfoQueryTest.java | 6 +- .../java/org/hiero/sdk/FileInfoQueryTest.snap | 3 + .../{com => org}/hiero/sdk/FileInfoTest.java | 6 +- .../{com => org}/hiero/sdk/FileInfoTest.snap | 10 +- .../hiero/sdk/FileUpdateTransactionTest.java | 6 +- .../hiero/sdk/FileUpdateTransactionTest.snap | 4 +- .../hiero/sdk/FreezeTransactionTest.java | 10 +- .../hiero/sdk/FreezeTransactionTest.snap | 4 +- .../java/{com => org}/hiero/sdk/Function.java | 2 +- .../java/{com => org}/hiero/sdk/HbarTest.java | 2 +- .../hiero/sdk/HederaTrustManagerTest.java | 2 +- .../{com => org}/hiero/sdk/KeyListTest.java | 6 +- .../java/{com => org}/hiero/sdk/KeyTest.java | 36 +++--- .../{com => org}/hiero/sdk/KeystoreTest.java | 2 +- .../{com => org}/hiero/sdk/ListInputTest.java | 2 +- .../hiero/sdk/LiveHashAddTransactionTest.java | 2 +- .../hiero/sdk/LiveHashAddTransactionTest.snap | 4 +- .../sdk/LiveHashDeleteTransactionTest.java | 2 +- .../sdk/LiveHashDeleteTransactionTest.snap | 4 +- .../hiero/sdk/LiveHashQueryTest.java | 6 +- .../hiero/sdk/LiveHashQueryTest.snap | 4 +- .../MaxQueryPaymentExceededExceptionTest.java | 2 +- .../sdk/MessageSubmitTransactionTest.java | 6 +- .../sdk/MessageSubmitTransactionTest.snap | 4 +- .../sdk/MirrorNodeContractQueryTest.java | 2 +- .../sdk/MirrorNodeContractQueryTest.snap | 2 +- .../{com => org}/hiero/sdk/MnemonicTest.java | 4 +- .../java/{com => org}/hiero/sdk/Mocker.java | 18 +-- .../{com => org}/hiero/sdk/MockingTest.java | 64 +++++----- .../sdk/NetworkVersionInfoQueryTest.java | 8 +- .../sdk/NetworkVersionInfoQueryTest.snap | 3 + .../hiero/sdk/NetworkVersionInfoTest.java | 2 +- .../org/hiero/sdk/NetworkVersionInfoTest.snap | 3 + .../{com => org}/hiero/sdk/NftIdTest.java | 2 +- .../test/java/org/hiero/sdk/NftIdTest.snap | 33 +++++ .../hiero/sdk/NodeCreateTransactionTest.java | 8 +- .../hiero/sdk/NodeCreateTransactionTest.snap | 4 +- .../hiero/sdk/NodeDeleteTransactionTest.java | 8 +- .../hiero/sdk/NodeDeleteTransactionTest.snap | 4 +- .../hiero/sdk/NodeUpdateTransactionTest.java | 8 +- .../hiero/sdk/NodeUpdateTransactionTest.snap | 4 +- .../hiero/sdk/PendingAirdropIdTest.java | 10 +- .../hiero/sdk/PrivateKeyTest.java | 2 +- .../hiero/sdk/PrngTransactionTest.java | 2 +- .../hiero/sdk/PrngTransactionTest.snap | 8 +- .../hiero/sdk/ProxyStakerTest.java | 6 +- .../hiero/sdk/ProxyStakerTest.snap | 2 +- .../hiero/sdk/ReceiptStatusExceptionTest.java | 6 +- .../sdk/RegenerateTransactionIdsTest.java | 12 +- .../hiero/sdk/RequestTypeTest.java | 4 +- .../sdk/ScheduleCreateTransactionTest.java | 2 +- .../sdk/ScheduleCreateTransactionTest.snap | 4 +- .../sdk/ScheduleDeleteTransactionTest.java | 6 +- .../sdk/ScheduleDeleteTransactionTest.snap | 4 +- .../hiero/sdk/ScheduleInfoQueryTest.java | 6 +- .../org/hiero/sdk/ScheduleInfoQueryTest.snap | 3 + .../hiero/sdk/ScheduleInfoTest.java | 6 +- .../hiero/sdk/ScheduleInfoTest.snap | 4 +- .../sdk/ScheduleSignTransactionTest.java | 2 +- .../sdk/ScheduleSignTransactionTest.snap | 4 +- .../java/{com => org}/hiero/sdk/Snapshot.java | 2 +- .../hiero/sdk/StakingInfoTest.java | 2 +- .../hiero/sdk/StakingInfoTest.snap | 4 +- .../{com => org}/hiero/sdk/StatusTest.java | 4 +- .../sdk/SystemDeleteTransactionTest.java | 10 +- .../sdk/SystemDeleteTransactionTest.snap | 8 +- .../sdk/SystemUndeleteTransactionTest.java | 6 +- .../sdk/SystemUndeleteTransactionTest.snap | 8 +- .../{com => org}/hiero/sdk/TestResponse.java | 10 +- .../{com => org}/hiero/sdk/TestServer.java | 2 +- .../{com => org}/hiero/sdk/TestService.java | 10 +- .../sdk/TokenAirdropTransactionTest.java | 8 +- .../sdk/TokenAirdropTransactionTest.snap | 4 +- .../hiero/sdk/TokenAllowanceTest.java | 2 +- .../sdk/TokenAssociateTransactionTest.java | 8 +- .../sdk/TokenAssociateTransactionTest.snap | 4 +- .../hiero/sdk/TokenAssociationTest.java | 2 +- .../org/hiero/sdk/TokenAssociationTest.snap | 3 + .../hiero/sdk/TokenBurnTransactionTest.java | 8 +- .../hiero/sdk/TokenBurnTransactionTest.snap | 8 +- .../TokenCancelAirdropTransactionTest.java | 10 +- .../TokenCancelAirdropTransactionTest.snap | 4 +- .../sdk/TokenClaimAirdropTransactionTest.java | 10 +- .../sdk/TokenClaimAirdropTransactionTest.snap | 4 +- .../hiero/sdk/TokenCreateTransactionTest.java | 18 +-- .../hiero/sdk/TokenCreateTransactionTest.snap | 8 +- .../hiero/sdk/TokenDeleteTransactionTest.java | 8 +- .../hiero/sdk/TokenDeleteTransactionTest.snap | 4 +- .../sdk/TokenDissociateTransactionTest.java | 8 +- .../sdk/TokenDissociateTransactionTest.snap | 4 +- ...TokenFeeScheduleUpdateTransactionTest.java | 6 +- ...TokenFeeScheduleUpdateTransactionTest.snap | 4 +- .../hiero/sdk/TokenFreezeTransactionTest.java | 6 +- .../hiero/sdk/TokenFreezeTransactionTest.snap | 4 +- .../sdk/TokenGrantKycTransactionTest.java | 8 +- .../sdk/TokenGrantKycTransactionTest.snap | 4 +- .../hiero/sdk/TokenInfoQueryTest.java | 6 +- .../org/hiero/sdk/TokenInfoQueryTest.snap | 3 + .../{com => org}/hiero/sdk/TokenInfoTest.java | 6 +- .../{com => org}/hiero/sdk/TokenInfoTest.snap | 2 +- .../hiero/sdk/TokenMintTransactionTest.java | 8 +- .../hiero/sdk/TokenMintTransactionTest.snap | 8 +- .../hiero/sdk/TokenNftInfoQueryTest.java | 6 +- .../hiero/sdk/TokenNftInfoQueryTest.snap | 4 +- .../hiero/sdk/TokenNftInfoTest.java | 2 +- .../hiero/sdk/TokenNftInfoTest.snap | 4 +- .../hiero/sdk/TokenPauseTransactionTest.java | 8 +- .../hiero/sdk/TokenPauseTransactionTest.snap | 4 +- .../hiero/sdk/TokenRejectTransactionTest.java | 10 +- .../hiero/sdk/TokenRejectTransactionTest.snap | 4 +- .../hiero/sdk/TokenRelationshipTest.java | 2 +- .../hiero/sdk/TokenRelationshipTest.snap | 2 +- .../sdk/TokenRevokeKycTransactionTest.java | 8 +- .../sdk/TokenRevokeKycTransactionTest.snap | 4 +- .../hiero/sdk/TokenSupplyTypeTest.java | 16 +-- .../org/hiero/sdk/TokenSupplyTypeTest.snap | 10 ++ .../{com => org}/hiero/sdk/TokenTypeTest.java | 12 +- .../{com => org}/hiero/sdk/TokenTypeTest.snap | 4 +- .../sdk/TokenUnfreezeTransactionTest.java | 6 +- .../sdk/TokenUnfreezeTransactionTest.snap | 4 +- .../sdk/TokenUnpauseTransactionTest.java | 8 +- .../sdk/TokenUnpauseTransactionTest.snap | 4 +- .../sdk/TokenUpdateNftsTransactionTest.java | 8 +- .../sdk/TokenUpdateNftsTransactionTest.snap | 4 +- .../hiero/sdk/TokenUpdateTransactionTest.java | 14 +-- .../hiero/sdk/TokenUpdateTransactionTest.snap | 4 +- .../hiero/sdk/TokenWipeTransactionTest.java | 8 +- .../hiero/sdk/TokenWipeTransactionTest.snap | 8 +- .../hiero/sdk/TopicCreateTransactionTest.java | 6 +- .../hiero/sdk/TopicCreateTransactionTest.snap | 4 +- .../hiero/sdk/TopicDeleteTransactionTest.java | 6 +- .../hiero/sdk/TopicDeleteTransactionTest.snap | 4 +- .../{com => org}/hiero/sdk/TopicIdTest.java | 2 +- .../test/java/org/hiero/sdk/TopicIdTest.snap | 23 ++++ .../hiero/sdk/TopicInfoQueryTest.java | 6 +- .../org/hiero/sdk/TopicInfoQueryTest.snap | 3 + .../{com => org}/hiero/sdk/TopicInfoTest.java | 6 +- .../{com => org}/hiero/sdk/TopicInfoTest.snap | 10 +- .../hiero/sdk/TopicMessageChunkTest.java | 8 +- .../hiero/sdk/TopicMessageQueryTest.java | 39 +++--- .../hiero/sdk/TopicMessageQueryTest.snap | 0 .../TopicMessageSubmitTransactionTest.java | 8 +- .../TopicMessageSubmitTransactionTest.snap | 0 .../hiero/sdk/TopicMessageTest.java | 8 +- .../hiero/sdk/TopicUpdateTransactionTest.java | 14 +-- .../hiero/sdk/TopicUpdateTransactionTest.snap | 8 +- .../hiero/sdk/TransactionIdTest.java | 2 +- .../java/org/hiero/sdk/TransactionIdTest.snap | 8 ++ .../sdk/TransactionReceiptQueryTest.java | 6 +- .../sdk/TransactionReceiptQueryTest.snap | 4 +- .../hiero/sdk/TransactionReceiptTest.java | 2 +- .../hiero/sdk/TransactionReceiptTest.snap | 2 +- .../hiero/sdk/TransactionRecordQueryTest.java | 6 +- .../hiero/sdk/TransactionRecordQueryTest.snap | 4 +- .../hiero/sdk/TransactionRecordTest.java | 8 +- .../hiero/sdk/TransactionRecordTest.snap | 4 +- .../hiero/sdk/TransactionTest.java | 12 +- .../hiero/sdk}/logger/LoggerTest.java | 6 +- sdk/src/testIntegration/java/module-info.java | 4 +- .../AccountAllowanceIntegrationTest.java | 16 +-- .../AccountBalanceIntegrationTest.java | 16 +-- .../AccountCreateIntegrationTest.java | 4 +- .../AccountDeleteIntegrationTest.java | 18 +-- .../AccountIdPopulationIntegrationTest.java | 12 +- .../AccountInfoIntegrationTest.java | 18 +-- .../AccountRecordsIntegrationTest.java | 12 +- .../AccountStakersIntegrationTest.java | 10 +- .../AccountUpdateIntegrationTest.java | 16 +-- .../integration/ClientIntegrationTest.java | 4 +- .../hiero/sdk/test/integration/Contents.java | 2 +- .../ContractBytecodeIntegrationTest.java | 22 ++-- .../ContractCallIntegrationTest.java | 24 ++-- .../ContractCreateFlowIntegrationTest.java | 4 +- .../ContractCreateIntegrationTest.java | 20 +-- .../ContractDeleteIntegrationTest.java | 20 +-- .../ContractExecuteIntegrationTest.java | 22 ++-- ...ractFunctionParametersIntegrationTest.java | 24 ++-- .../ContractIdPopulationIntegrationTest.java | 12 +- .../ContractInfoIntegrationTest.java | 4 +- .../ContractNonceInfoIntegrationTest.java | 14 +-- .../ContractUpdateIntegrationTest.java | 22 ++-- .../sdk/test/integration/EntityHelper.java | 28 ++--- .../EthereumTransactionIntegrationTest.java | 24 ++-- .../test/integration/FeeSchedulesTest.java | 8 +- .../FileAppendIntegrationTest.java | 14 +-- .../FileContentsIntegrationTest.java | 16 +-- .../FileCreateIntegrationTest.java | 10 +- .../FileDeleteIntegrationTest.java | 14 +-- .../integration/FileInfoIntegrationTest.java | 16 +-- .../FileUpdateIntegrationTest.java | 24 ++-- .../test/integration/IntegrationTestEnv.java | 18 +-- .../LiveHashAddIntegrationTest.java | 14 +-- .../LiveHashDeleteIntegrationTest.java | 14 +-- .../test/integration/LoadIntegrationTest.java | 10 +- ...irrorNodeContractQueryIntegrationTest.java | 30 ++--- .../NetworkVersionInfoIntegrationTest.java | 4 +- .../NftAllowancesIntegrationTest.java | 34 +++--- .../integration/NftMetadataGenerator.java | 2 +- .../NodeCreateTransactionIntegrationTest.java | 16 +-- .../ReceiptQueryIntegrationTest.java | 14 +-- .../ScheduleCreateIntegrationTest.java | 48 ++++---- .../integration/SystemIntegrationTest.java | 16 +-- .../TokenAirdropCancelIntegrationTest.java | 36 +++--- .../TokenAirdropClaimIntegrationTest.java | 34 +++--- ...okenAirdropTransactionIntegrationTest.java | 40 +++--- ...enAutomaticAssociationIntegrationTest.java | 22 ++-- .../integration/TokenBurnIntegrationTest.java | 26 ++-- .../TokenCreateIntegrationTest.java | 26 ++-- .../TokenDeleteIntegrationTest.java | 14 +-- .../TokenDissociateIntegrationTest.java | 20 +-- ...TokenFeeScheduleUpdateIntegrationTest.java | 20 +-- .../TokenFreezeIntegrationTest.java | 20 +-- .../TokenGrantKycIntegrationTest.java | 20 +-- .../integration/TokenInfoIntegrationTest.java | 22 ++-- ...TokenManualAssociationIntegrationTest.java | 26 ++-- .../integration/TokenMintIntegrationTest.java | 22 ++-- .../TokenNftInfoIntegrationTest.java | 16 +-- .../TokenNftTransferIntegrationTest.java | 28 ++--- .../TokenPauseIntegrationTest.java | 20 +-- .../TokenRejectFlowIntegrationTest.java | 18 +-- .../TokenRejectIntegrationTest.java | 36 +++--- .../TokenRevokeKycIntegrationTest.java | 20 +-- .../TokenTransferIntegrationTest.java | 24 ++-- .../TokenUnfreezeIntegrationTest.java | 20 +-- .../TokenUnpauseIntegrationTest.java | 24 ++-- .../TokenUpdateIntegrationTest.java | 24 ++-- .../TokenUpdateNftsIntegrationTest.java | 26 ++-- .../integration/TokenWipeIntegrationTest.java | 28 ++--- .../TopicCreateIntegrationTest.java | 6 +- .../TopicDeleteIntegrationTest.java | 10 +- .../integration/TopicInfoIntegrationTest.java | 14 +-- .../TopicMessageIntegrationTest.java | 4 +- .../TopicMessageSubmitIntegrationTest.java | 16 +-- .../TopicUpdateIntegrationTest.java | 10 +- .../TransactionIntegrationTest.java | 64 +++++----- .../integration/TransactionResponseTest.java | 6 +- settings.gradle.kts | 6 +- .../{com => org}/hiero/tck/TckServer.java | 2 +- .../tck/annotation/JSONRPC2Controller.java | 2 +- .../hiero/tck/annotation/JSONRPC2Method.java | 2 +- .../hiero/tck/annotation/JSONRPC2Service.java | 2 +- .../hiero/tck/config/BeanConfig.java | 2 +- .../hiero/tck/config/WebConfig.java | 4 +- .../hiero/tck/controller/JRPCController.java | 9 +- .../hiero/tck/controller/JRPCInterceptor.java | 2 +- .../InvalidJSONRPC2ParamsException.java | 2 +- .../InvalidJSONRPC2RequestException.java | 2 +- .../tck/methods/AbstractJSONRPC2Service.java | 16 +-- .../hiero/tck/methods/JSONRPC2Error.java | 4 +- .../hiero/tck/methods/JSONRPC2Param.java | 2 +- .../hiero/tck/methods/sdk/AccountService.java | 34 +++--- .../hiero/tck/methods/sdk/KeyService.java | 53 ++++---- .../hiero/tck/methods/sdk/SdkService.java | 18 +-- .../hiero/tck/methods/sdk/TokenService.java | 44 +++---- .../sdk/param/AccountCreateParams.java | 4 +- .../sdk/param/AccountDeleteParams.java | 4 +- .../sdk/param/AccountUpdateParams.java | 4 +- .../sdk/param/CommonTransactionParams.java | 12 +- .../tck/methods/sdk/param/CustomFee.java | 4 +- .../methods/sdk/param/GenerateKeyParams.java | 6 +- .../tck/methods/sdk/param/SetupParams.java | 4 +- .../methods/sdk/param/TokenCreateParams.java | 4 +- .../methods/sdk/param/TokenDeleteParams.java | 4 +- .../methods/sdk/param/TokenUpdateParams.java | 4 +- .../methods/sdk/response/AccountResponse.java | 4 +- .../sdk/response/GenerateKeyResponse.java | 2 +- .../methods/sdk/response/SetupResponse.java | 2 +- .../methods/sdk/response/TokenResponse.java | 4 +- .../tck/util/JSONRPC2ServiceScanner.java | 4 +- .../{com => org}/hiero/tck/util/KeyUtils.java | 8 +- .../tck/controller/JRPCControllerTest.java | 3 +- .../tck/controller/JRPCInterceptorTest.java | 3 +- .../hiero/tck/methods/sdk/KeyServiceTest.java | 10 +- .../hiero/tck/methods/sdk/SdkServiceTest.java | 7 +- .../sdk/param/AccountCreateParamsTest.java | 4 +- .../param/CommonTransactionParamsTest.java | 3 +- .../sdk/param/GenerateKeyParamsTest.java | 5 +- .../methods/sdk/param/SetupParamsTest.java | 3 +- .../sdk/response/SetupResponseTest.java | 3 +- 744 files changed, 3355 insertions(+), 3314 deletions(-) rename sdk/src/main/java/{com => org}/hiero/sdk/AbstractTokenTransferTransaction.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountAllowanceAdjustTransaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountAllowanceApproveTransaction.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountAllowanceDeleteTransaction.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountBalance.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountBalanceQuery.java (86%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountCreateTransaction.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountDeleteTransaction.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountId.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountInfo.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountInfoFlow.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountInfoQuery.java (83%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountRecordsQuery.java (82%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountStakersQuery.java (83%) rename sdk/src/main/java/{com => org}/hiero/sdk/AccountUpdateTransaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/AddressBookQuery.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/AssessedCustomFee.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/BadEntityIdException.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/BadKeyException.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/BadMnemonicException.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/BadMnemonicReason.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/BaseNetwork.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/BaseNode.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/BaseNodeAddress.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ChunkedTransaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/Client.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/ConsumerHelper.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractByteCodeQuery.java (80%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractCallQuery.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractCreateFlow.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractCreateTransaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractDeleteTransaction.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractExecuteTransaction.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractFunctionParameters.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractFunctionResult.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractFunctionSelector.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractId.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractInfo.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractInfoQuery.java (84%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractLogInfo.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractNonceInfo.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractStateChange.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/ContractUpdateTransaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/Crypto.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/CustomFee.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/CustomFeeBase.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/CustomFixedFee.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/CustomFractionalFee.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/CustomRoyaltyFee.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/Delayer.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/DelegateContractId.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/DurationConverter.java (78%) rename sdk/src/main/java/{com => org}/hiero/sdk/Endpoint.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/EntityIdHelper.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/EthereumFlow.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/EthereumTransaction.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/EthereumTransactionData.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/EthereumTransactionDataEip1559.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/EthereumTransactionDataLegacy.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/EvmAddress.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/ExchangeRate.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/ExchangeRates.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/Executable.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ExecutionState.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/FeeAssessmentMethod.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/FeeComponents.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/FeeData.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/FeeDataType.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/FeeSchedule.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/FeeSchedules.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileAppendTransaction.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileContentsQuery.java (85%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileCreateTransaction.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileDeleteTransaction.java (84%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileId.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileInfo.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileInfoQuery.java (83%) rename sdk/src/main/java/{com => org}/hiero/sdk/FileUpdateTransaction.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/FreezeTransaction.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/FreezeType.java (78%) rename sdk/src/main/java/{com => org}/hiero/sdk/FutureConverter.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/Hbar.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/HbarAllowance.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/HbarUnit.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/HederaPreCheckStatusException.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/HederaReceiptStatusException.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/HederaTrustManager.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/InstantConverter.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/Key.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/KeyList.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/Keystore.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/LedgerId.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/LiveHash.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/LiveHashAddTransaction.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/LiveHashDeleteTransaction.java (89%) rename sdk/src/main/java/{com => org}/hiero/sdk/LiveHashQuery.java (81%) rename sdk/src/main/java/{com => org}/hiero/sdk/LockableList.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/MaxAttemptsExceededException.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/MaxQueryPaymentExceededException.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/MirrorNetwork.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/MirrorNode.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/MirrorNodeContractCallQuery.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/MirrorNodeContractEstimateGasQuery.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/MirrorNodeContractQuery.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/Mnemonic.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/Network.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/NetworkName.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/NetworkVersionInfo.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/NetworkVersionInfoQuery.java (69%) rename sdk/src/main/java/{com => org}/hiero/sdk/NftId.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/Node.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/NodeAddress.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/NodeAddressBook.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/NodeCreateTransaction.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/NodeDeleteTransaction.java (88%) rename sdk/src/main/java/{com => org}/hiero/sdk/NodeUpdateTransaction.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/Pem.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/PendingAirdropId.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/PendingAirdropLogic.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/PendingAirdropRecord.java (83%) rename sdk/src/main/java/{com => org}/hiero/sdk/PrecheckStatusException.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/PrivateKey.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/PrivateKeyECDSA.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/PrivateKeyED25519.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/PrngTransaction.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/ProxyStaker.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/PublicKey.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/PublicKeyECDSA.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/PublicKeyED25519.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/Query.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/ReceiptStatusException.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/RequestType.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/ScheduleCreateTransaction.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/ScheduleDeleteTransaction.java (85%) rename sdk/src/main/java/{com => org}/hiero/sdk/ScheduleId.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/ScheduleInfo.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/ScheduleInfoQuery.java (84%) rename sdk/src/main/java/{com => org}/hiero/sdk/ScheduleSignTransaction.java (89%) rename sdk/src/main/java/{com => org}/hiero/sdk/SemanticVersion.java (89%) rename sdk/src/main/java/{com => org}/hiero/sdk/StakingInfo.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/Status.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/StorageChange.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/SubscriptionHandle.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/SystemDeleteTransaction.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/SystemUndeleteTransaction.java (89%) rename sdk/src/main/java/{com => org}/hiero/sdk/ThreadLocalSecureRandom.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenAirdropTransaction.java (86%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenAllowance.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenAssociateTransaction.java (88%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenAssociation.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenBurnTransaction.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenCancelAirdropTransaction.java (80%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenClaimAirdropTransaction.java (80%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenCreateTransaction.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenDeleteTransaction.java (85%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenDissociateTransaction.java (88%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenFeeScheduleUpdateTransaction.java (89%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenFreezeTransaction.java (86%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenGrantKycTransaction.java (87%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenId.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenInfo.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenInfoQuery.java (83%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenKeyValidation.java (70%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenMintTransaction.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenNftAllowance.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenNftInfo.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenNftInfoQuery.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenNftTransfer.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenPauseTransaction.java (85%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenRejectFlow.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenRejectTransaction.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenRelationship.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenRevokeKycTransaction.java (87%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenSupplyType.java (76%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenTransfer.java (96%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenTransferList.java (87%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenType.java (82%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenUnfreezeTransaction.java (86%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenUnpauseTransaction.java (85%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenUpdateNftsTransaction.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenUpdateTransaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/TokenWipeTransaction.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicCreateTransaction.java (94%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicDeleteTransaction.java (85%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicId.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicInfo.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicInfoQuery.java (77%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicMessage.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicMessageChunk.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicMessageQuery.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicMessageSubmitTransaction.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/TopicUpdateTransaction.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/Transaction.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionFeeSchedule.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionId.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionReceipt.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionReceiptQuery.java (91%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionRecord.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionRecordQuery.java (92%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransactionResponse.java (98%) rename sdk/src/main/java/{com => org}/hiero/sdk/Transfer.java (95%) rename sdk/src/main/java/{com => org}/hiero/sdk/TransferTransaction.java (93%) rename sdk/src/main/java/{com => org}/hiero/sdk/logger/LogLevel.java (90%) rename sdk/src/main/java/{com => org}/hiero/sdk/logger/Logger.java (99%) rename sdk/src/main/java/{com => org}/hiero/sdk/package-info.java (97%) rename sdk/src/main/java/{com => org}/hiero/sdk/utils/Bip32Utils.java (96%) delete mode 100644 sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/FileIdTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/NftIdTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap delete mode 100644 sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/AccountAllowanceApproveTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountAllowanceApproveTransactionTest.snap (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountAllowanceDeleteTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap (86%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountBalanceQueryTest.java (86%) create mode 100644 sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/AccountCreateTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountCreateTransactionTest.snap (87%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountDeleteTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountDeleteTransactionTest.snap (79%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountIdTest.java (99%) create mode 100644 sdk/src/test/java/org/hiero/sdk/AccountIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/AccountInfoQueryTest.java (87%) create mode 100644 sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/AccountInfoTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountInfoTest.snap (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountRecordsQueryTest.java (87%) create mode 100644 sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/AccountStakersQueryTest.java (87%) create mode 100644 sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/AccountUpdateTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/AccountUpdateTransactionTest.snap (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/AddressBookQueryMockTest.java (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/AllowancesTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/AllowancesTest.snap (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/AssessedCustomFeeTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/AssessedCustomFeeTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/BaseNodeAddressTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/ClientCloseTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/ClientTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/ConsumerHelperTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractByteCodeQueryTest.java (86%) create mode 100644 sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/ContractCallQueryTest.java (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractCallQueryTest.snap (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractCreateTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractCreateTransactionTest.snap (87%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractDeleteTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractDeleteTransactionTest.snap (79%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractExecuteTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractExecuteTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractFunctionParametersTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractFunctionParametersTest.snap (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractFunctionResultTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractFunctionSelectorTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractIdTest.java (99%) create mode 100644 sdk/src/test/java/org/hiero/sdk/ContractIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/ContractInfoQueryTest.java (86%) create mode 100644 sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/ContractInfoTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractInfoTest.snap (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractLogInfoTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractLogInfoTest.snap (54%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractNonceInfoTest.java (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractNonceInfoTest.snap (80%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractUpdateTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/ContractUpdateTransactionTest.snap (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/CryptoTransferTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/CryptoTransferTransactionTest.snap (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomFeeListTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomFeeListTest.snap (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomFixedFeeTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomFixedFeeTest.snap (50%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomFractionalFeeTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomFractionalFeeTest.snap (63%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomRoyaltyFeeTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/CustomRoyaltyFeeTest.snap (67%) rename sdk/src/test/java/{com => org}/hiero/sdk/DelegateContractIdTest.java (98%) create mode 100644 sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/DuplicateTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/ECDSAPrivateKeyTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/ECDSAPublicKeyTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/Ed25519PrivateKeyTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/Ed25519PublicKeyTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/EthereumFlowMockTest.java (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/EthereumTransactionDataLegacyTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/EthereumTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/EthereumTransactionTest.snap (79%) rename sdk/src/test/java/{com => org}/hiero/sdk/ExchangeRatesTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/ExecutableTest.java (85%) rename sdk/src/test/java/{com => org}/hiero/sdk/FeeAssessmentMethodTest.java (72%) rename sdk/src/test/java/{com => org}/hiero/sdk/FeeSchedulesTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/FeeSchedulesTest.snap (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileAppendTransactionTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileAppendTransactionTest.snap (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileContentsQueryTest.java (86%) create mode 100644 sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/FileCreateTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileCreateTransactionTest.snap (82%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileDeleteTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileDeleteTransactionTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileIdTest.java (98%) create mode 100644 sdk/src/test/java/org/hiero/sdk/FileIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/FileInfoQueryTest.java (86%) create mode 100644 sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/FileInfoTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileInfoTest.snap (81%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileUpdateTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/FileUpdateTransactionTest.snap (85%) rename sdk/src/test/java/{com => org}/hiero/sdk/FreezeTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/FreezeTransactionTest.snap (82%) rename sdk/src/test/java/{com => org}/hiero/sdk/Function.java (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/HbarTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/HederaTrustManagerTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/KeyListTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/KeyTest.java (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/KeystoreTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/ListInputTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/LiveHashAddTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/LiveHashAddTransactionTest.snap (84%) rename sdk/src/test/java/{com => org}/hiero/sdk/LiveHashDeleteTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/LiveHashDeleteTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/LiveHashQueryTest.java (87%) rename sdk/src/test/java/{com => org}/hiero/sdk/LiveHashQueryTest.snap (51%) rename sdk/src/test/java/{com => org}/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/MessageSubmitTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/MessageSubmitTransactionTest.snap (77%) rename sdk/src/test/java/{com => org}/hiero/sdk/MirrorNodeContractQueryTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/MirrorNodeContractQueryTest.snap (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/MnemonicTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/Mocker.java (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/MockingTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/NetworkVersionInfoQueryTest.java (87%) create mode 100644 sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/NetworkVersionInfoTest.java (98%) create mode 100644 sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/NftIdTest.java (99%) create mode 100644 sdk/src/test/java/org/hiero/sdk/NftIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/NodeCreateTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/NodeCreateTransactionTest.snap (92%) rename sdk/src/test/java/{com => org}/hiero/sdk/NodeDeleteTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/NodeDeleteTransactionTest.snap (72%) rename sdk/src/test/java/{com => org}/hiero/sdk/NodeUpdateTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/NodeUpdateTransactionTest.snap (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/PendingAirdropIdTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/PrivateKeyTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/PrngTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/PrngTransactionTest.snap (73%) rename sdk/src/test/java/{com => org}/hiero/sdk/ProxyStakerTest.java (85%) rename sdk/src/test/java/{com => org}/hiero/sdk/ProxyStakerTest.snap (54%) rename sdk/src/test/java/{com => org}/hiero/sdk/ReceiptStatusExceptionTest.java (84%) rename sdk/src/test/java/{com => org}/hiero/sdk/RegenerateTransactionIdsTest.java (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/RequestTypeTest.java (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleCreateTransactionTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleCreateTransactionTest.snap (89%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleDeleteTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleDeleteTransactionTest.snap (76%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleInfoQueryTest.java (87%) create mode 100644 sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleInfoTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleInfoTest.snap (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleSignTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/ScheduleSignTransactionTest.snap (76%) rename sdk/src/test/java/{com => org}/hiero/sdk/Snapshot.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/StakingInfoTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/StakingInfoTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/StatusTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/SystemDeleteTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/SystemDeleteTransactionTest.snap (77%) rename sdk/src/test/java/{com => org}/hiero/sdk/SystemUndeleteTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/SystemUndeleteTransactionTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/TestResponse.java (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/TestServer.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TestService.java (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenAirdropTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenAirdropTransactionTest.snap (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenAllowanceTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenAssociateTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenAssociateTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenAssociationTest.java (99%) create mode 100644 sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/TokenBurnTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenBurnTransactionTest.snap (76%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenCancelAirdropTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenCancelAirdropTransactionTest.snap (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenClaimAirdropTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenClaimAirdropTransactionTest.snap (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenCreateTransactionTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenCreateTransactionTest.snap (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenDeleteTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenDeleteTransactionTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenDissociateTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenDissociateTransactionTest.snap (82%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenFreezeTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenFreezeTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenGrantKycTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenGrantKycTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenInfoQueryTest.java (90%) create mode 100644 sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/TokenInfoTest.java (99%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenInfoTest.snap (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenMintTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenMintTransactionTest.snap (77%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenNftInfoQueryTest.java (92%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenNftInfoQueryTest.snap (54%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenNftInfoTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenNftInfoTest.snap (73%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenPauseTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenPauseTransactionTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenRejectTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenRejectTransactionTest.snap (89%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenRelationshipTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenRelationshipTest.snap (69%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenRevokeKycTransactionTest.java (95%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenRevokeKycTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenSupplyTypeTest.java (73%) create mode 100644 sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/TokenTypeTest.java (74%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenTypeTest.snap (53%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUnfreezeTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUnfreezeTransactionTest.snap (78%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUnpauseTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUnpauseTransactionTest.snap (75%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUpdateNftsTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUpdateNftsTransactionTest.snap (80%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUpdateTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenUpdateTransactionTest.snap (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenWipeTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/TokenWipeTransactionTest.snap (80%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicCreateTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicCreateTransactionTest.snap (86%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicDeleteTransactionTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicDeleteTransactionTest.snap (76%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicIdTest.java (98%) create mode 100644 sdk/src/test/java/org/hiero/sdk/TopicIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/TopicInfoQueryTest.java (86%) create mode 100644 sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/TopicInfoTest.java (94%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicInfoTest.snap (88%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicMessageChunkTest.java (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicMessageQueryTest.java (93%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicMessageQueryTest.snap (100%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicMessageSubmitTransactionTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicMessageSubmitTransactionTest.snap (100%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicMessageTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicUpdateTransactionTest.java (97%) rename sdk/src/test/java/{com => org}/hiero/sdk/TopicUpdateTransactionTest.snap (85%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionIdTest.java (99%) create mode 100644 sdk/src/test/java/org/hiero/sdk/TransactionIdTest.snap rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionReceiptQueryTest.java (90%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionReceiptQueryTest.snap (61%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionReceiptTest.java (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionReceiptTest.snap (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionRecordQueryTest.java (91%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionRecordQueryTest.snap (67%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionRecordTest.java (96%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionRecordTest.snap (98%) rename sdk/src/test/java/{com => org}/hiero/sdk/TransactionTest.java (94%) rename sdk/src/test/java/{com/hiero => org/hiero/sdk}/logger/LoggerTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java (88%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountCreateIntegrationTest.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java (89%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountInfoIntegrationTest.java (92%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java (87%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountStakersIntegrationTest.java (83%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java (90%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ClientIntegrationTest.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/Contents.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractCallIntegrationTest.java (97%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractCreateIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractInfoIntegrationTest.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java (92%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/EntityHelper.java (93%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java (93%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FeeSchedulesTest.java (86%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FileAppendIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FileContentsIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FileCreateIntegrationTest.java (93%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FileDeleteIntegrationTest.java (90%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FileInfoIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/FileUpdateIntegrationTest.java (91%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/IntegrationTestEnv.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java (86%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java (84%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/LoadIntegrationTest.java (93%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java (83%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/NftMetadataGenerator.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/SystemIntegrationTest.java (93%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java (98%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenBurnIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenCreateIntegrationTest.java (97%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java (93%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenInfoIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenMintIntegrationTest.java (95%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java (91%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenPauseIntegrationTest.java (88%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenRejectIntegrationTest.java (98%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenTransferIntegrationTest.java (92%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java (87%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java (99%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java (97%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TokenWipeIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TopicCreateIntegrationTest.java (90%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java (89%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TopicInfoIntegrationTest.java (94%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TopicMessageIntegrationTest.java (98%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java (87%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TransactionIntegrationTest.java (96%) rename sdk/src/testIntegration/java/{com => org}/hiero/sdk/test/integration/TransactionResponseTest.java (88%) rename tck/src/main/java/{com => org}/hiero/tck/TckServer.java (93%) rename tck/src/main/java/{com => org}/hiero/tck/annotation/JSONRPC2Controller.java (94%) rename tck/src/main/java/{com => org}/hiero/tck/annotation/JSONRPC2Method.java (95%) rename tck/src/main/java/{com => org}/hiero/tck/annotation/JSONRPC2Service.java (92%) rename tck/src/main/java/{com => org}/hiero/tck/config/BeanConfig.java (91%) rename tck/src/main/java/{com => org}/hiero/tck/config/WebConfig.java (85%) rename tck/src/main/java/{com => org}/hiero/tck/controller/JRPCController.java (85%) rename tck/src/main/java/{com => org}/hiero/tck/controller/JRPCInterceptor.java (97%) rename tck/src/main/java/{com => org}/hiero/tck/exception/InvalidJSONRPC2ParamsException.java (94%) rename tck/src/main/java/{com => org}/hiero/tck/exception/InvalidJSONRPC2RequestException.java (88%) rename tck/src/main/java/{com => org}/hiero/tck/methods/AbstractJSONRPC2Service.java (92%) rename tck/src/main/java/{com => org}/hiero/tck/methods/JSONRPC2Error.java (89%) rename tck/src/main/java/{com => org}/hiero/tck/methods/JSONRPC2Param.java (95%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/AccountService.java (88%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/KeyService.java (73%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/SdkService.java (82%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/TokenService.java (93%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/AccountCreateParams.java (97%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/AccountDeleteParams.java (94%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/AccountUpdateParams.java (97%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/CommonTransactionParams.java (93%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/CustomFee.java (97%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/GenerateKeyParams.java (92%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/SetupParams.java (94%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/TokenCreateParams.java (98%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/TokenDeleteParams.java (92%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/param/TokenUpdateParams.java (97%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/response/AccountResponse.java (69%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/response/GenerateKeyResponse.java (84%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/response/SetupResponse.java (88%) rename tck/src/main/java/{com => org}/hiero/tck/methods/sdk/response/TokenResponse.java (69%) rename tck/src/main/java/{com => org}/hiero/tck/util/JSONRPC2ServiceScanner.java (91%) rename tck/src/main/java/{com => org}/hiero/tck/util/KeyUtils.java (92%) rename tck/src/test/java/{com => org}/hiero/tck/controller/JRPCControllerTest.java (96%) rename tck/src/test/java/{com => org}/hiero/tck/controller/JRPCInterceptorTest.java (96%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/KeyServiceTest.java (95%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/SdkServiceTest.java (89%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java (97%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java (93%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java (96%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/param/SetupParamsTest.java (92%) rename tck/src/test/java/{com => org}/hiero/tck/methods/sdk/response/SetupResponseTest.java (93%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5a809d128..ac499fdd6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,11 +101,13 @@ jobs: OPERATOR_ID: '0.0.1022' HEDERA_NETWORK: 'localhost' run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK jacocoTestReport --scan + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport --scan - name: Upload coverage to Codecov if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }} uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.2 + with: + files: gradle/aggregation/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml - name: Stop the local node run: npx @hashgraph/hedera-local stop diff --git a/.github/workflows/disabled/testnet.yml b/.github/workflows/disabled/testnet.yml index 243a2ae440..56000afdb6 100644 --- a/.github/workflows/disabled/testnet.yml +++ b/.github/workflows/disabled/testnet.yml @@ -93,7 +93,7 @@ jobs: OPERATOR_ID: ${{ secrets.TESTNET_OPERATOR_ID }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=testnet testIntegration && bash <(curl -s https://codecov.io/bash) + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=testnet :aggregation:testCodeCoverageReport && bash <(curl -s https://codecov.io/bash) - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 71944cfbd5..656484c6a0 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -129,4 +129,4 @@ jobs: env: NEXUS_USERNAME: ${{ secrets.SONATYPE_USERNAME }} NEXUS_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - run: ./gradlew releaseMavenCentral -PpublishingPackageGroup=com.hiero -PpublishSigningEnabled=true --scan --no-configuration-cache + run: ./gradlew releaseMavenCentral -PpublishingPackageGroup=org.hiero -PpublishSigningEnabled=true --scan --no-configuration-cache diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index 9194b96042..90c5f84aca 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -18,6 +18,7 @@ dependencyAnalysis { } dependencies.constraints { + implementation("com.google.guava:guava:33.3.1-android") implementation("io.github.cdimascio:dotenv-java:3.0.2") implementation("com.hedera.hashgraph:sdk:2.46.0") implementation("com.hedera.hashgraph:sdk-full:2.46.0") diff --git a/gradle/aggregation/build.gradle.kts b/gradle/aggregation/build.gradle.kts index aa94166ca9..317b7608c5 100644 --- a/gradle/aggregation/build.gradle.kts +++ b/gradle/aggregation/build.gradle.kts @@ -10,3 +10,31 @@ dependencies { implementation(project(":sdk")) implementation("io.grpc:grpc-protobuf") } + +tasks.testCodeCoverageReport { + // Integrate coverage data from integration tests into the report + @Suppress("UnstableApiUsage") + val testIntegrationExecutionData = + configurations.aggregateCodeCoverageReportResults + .get() + .incoming + .artifactView { + withVariantReselection() + componentFilter { id -> id is ProjectComponentIdentifier } + attributes.attribute( + Category.CATEGORY_ATTRIBUTE, + objects.named(Category.VERIFICATION) + ) + attributes.attribute( + VerificationType.VERIFICATION_TYPE_ATTRIBUTE, + objects.named(VerificationType.JACOCO_RESULTS) + ) + attributes.attribute( + TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, + objects.named(TestSuiteType.INTEGRATION_TEST) + ) + } + .files + + executionData.from(testIntegrationExecutionData) +} diff --git a/scripts/update_protobufs.py b/scripts/update_protobufs.py index da27e04c63..38e805d332 100755 --- a/scripts/update_protobufs.py +++ b/scripts/update_protobufs.py @@ -75,13 +75,13 @@ def go_to_script_dir(): PROTO_REPLACEMENTS = ( ("option java_package = \"com.hederahashgraph.api.proto.java\";", - "option java_package = \"com.hiero.sdk.proto\";"), + "option java_package = \"org.hiero.sdk.proto\";"), ("option java_package = \"com.hederahashgraph.service.proto.java\";", - "option java_package = \"com.hiero.sdk.proto\";"), + "option java_package = \"org.hiero.sdk.proto\";"), ("option java_package = \"com.hedera.mirror.api.proto\";", - "option java_package = \"com.hiero.sdk.proto.mirror\";") + "option java_package = \"org.hiero.sdk.proto.mirror\";") ) PROTO_REPLACEMENTS_IMPORTS = ( diff --git a/sdk-full/src/main/java/module-info.java b/sdk-full/src/main/java/module-info.java index 347a71d26d..252a0434af 100644 --- a/sdk-full/src/main/java/module-info.java +++ b/sdk-full/src/main/java/module-info.java @@ -18,7 +18,7 @@ * */ -module com.hiero.sdk.full { +module org.hiero.sdk.full { requires transitive com.google.protobuf; requires com.esaulpaugh.headlong; requires com.google.common; @@ -33,9 +33,9 @@ requires org.slf4j; requires static transitive java.annotation; - exports com.hiero.sdk; - exports com.hiero.sdk.logger; - exports com.hiero.sdk.proto; + exports org.hiero.sdk; + exports org.hiero.sdk.logger; + exports org.hiero.sdk.proto; - opens com.hiero.sdk; + opens org.hiero.sdk; } diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java index 27dc991264..bd51141775 100644 --- a/sdk/src/main/java/module-info.java +++ b/sdk/src/main/java/module-info.java @@ -18,7 +18,7 @@ * */ -module com.hiero.sdk { +module org.hiero.sdk { requires transitive com.google.protobuf; requires com.esaulpaugh.headlong; requires com.google.common; @@ -33,9 +33,9 @@ requires org.slf4j; requires static transitive java.annotation; - exports com.hiero.sdk; - exports com.hiero.sdk.logger; - exports com.hiero.sdk.proto; + exports org.hiero.sdk; + exports org.hiero.sdk.proto; - opens com.hiero.sdk; + opens org.hiero.sdk; + exports org.hiero.sdk.logger; } diff --git a/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java b/sdk/src/main/java/org/hiero/sdk/AbstractTokenTransferTransaction.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AbstractTokenTransferTransaction.java index a94b750c8a..7ddd9d9170 100644 --- a/sdk/src/main/java/com/hiero/sdk/AbstractTokenTransferTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AbstractTokenTransferTransaction.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; @@ -23,7 +23,7 @@ protected AbstractTokenTransferTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AbstractTokenTransferTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); } @@ -33,7 +33,7 @@ protected AbstractTokenTransferTransaction() {} * * @param txBody protobuf TransactionBody */ - AbstractTokenTransferTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AbstractTokenTransferTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); } @@ -265,8 +265,8 @@ public T setNftTransferApproval(NftId nftId, boolean isApproved) { return (T) this; } - protected ArrayList sortTransfersAndBuild() { - var transferLists = new ArrayList(); + protected ArrayList sortTransfersAndBuild() { + var transferLists = new ArrayList(); this.tokenTransfers.sort(Comparator.comparing((TokenTransfer a) -> a.tokenId) .thenComparing(a -> a.accountId) @@ -300,17 +300,17 @@ protected ArrayList sortTransfersAndBuild() { var result = iTokenId.compareTo(jTokenId); if (result == 0) { - transferLists.add(new com.hiero.sdk.TokenTransferList( + transferLists.add(new org.hiero.sdk.TokenTransferList( iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), this.nftTransfers.get(j++))); } else if (result < 0) { - transferLists.add(new com.hiero.sdk.TokenTransferList( + transferLists.add(new org.hiero.sdk.TokenTransferList( iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); } else { transferLists.add( - new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); + new org.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); } } else if (i < this.tokenTransfers.size()) { var iTokenId = this.tokenTransfers.get(i).tokenId; @@ -322,7 +322,7 @@ protected ArrayList sortTransfersAndBuild() { continue; } - transferLists.add(new com.hiero.sdk.TokenTransferList( + transferLists.add(new org.hiero.sdk.TokenTransferList( iTokenId, this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null)); } else { var jTokenId = this.nftTransfers.get(j).tokenId; @@ -335,7 +335,7 @@ protected ArrayList sortTransfersAndBuild() { } transferLists.add( - new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); + new org.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++))); } } return transferLists; diff --git a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java index 7300b24611..e3db66d9c9 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceAdjustTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.Collections; @@ -33,13 +33,13 @@ public class AccountAllowanceAdjustTransaction extends Transaction> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } - AccountAllowanceAdjustTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AccountAllowanceAdjustTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -322,7 +322,7 @@ public List getTokenNftAllowances() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { throw new UnsupportedOperationException("Cannot get method descriptor for AccountAllowanceAdjustTransaction"); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java index c77117f1d9..bd87b2154b 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceApproveTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.Collections; @@ -39,7 +39,7 @@ public AccountAllowanceApproveTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records */ AccountAllowanceApproveTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public AccountAllowanceApproveTransaction() {} * * @param txBody protobuf TransactionBody */ - AccountAllowanceApproveTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AccountAllowanceApproveTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -378,14 +378,14 @@ public List getTokenNftApprovals() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getApproveAllowancesMethod(); } /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody builder } + * @return {@link org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody builder } */ CryptoApproveAllowanceTransactionBody.Builder build() { var builder = CryptoApproveAllowanceTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java index 99132b7371..1a49f9c535 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountAllowanceDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.HashMap; @@ -20,7 +20,7 @@ /** * This transaction type is for deleting an account allowance. */ -public class AccountAllowanceDeleteTransaction extends com.hiero.sdk.Transaction { +public class AccountAllowanceDeleteTransaction extends org.hiero.sdk.Transaction { private final List hbarAllowances = new ArrayList<>(); private final List tokenAllowances = new ArrayList<>(); private final List nftAllowances = new ArrayList<>(); @@ -39,7 +39,7 @@ public AccountAllowanceDeleteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AccountAllowanceDeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public AccountAllowanceDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - AccountAllowanceDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AccountAllowanceDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountBalance.java b/sdk/src/main/java/org/hiero/sdk/AccountBalance.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/AccountBalance.java rename to sdk/src/main/java/org/hiero/sdk/AccountBalance.java index f66d411270..61033984c3 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountBalance.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountBalance.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse; -import com.hiero.sdk.proto.TokenBalance; +import org.hiero.sdk.proto.CryptoGetAccountBalanceResponse; +import org.hiero.sdk.proto.TokenBalance; import java.util.HashMap; import java.util.Map; import java.util.Objects; diff --git a/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java similarity index 86% rename from sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java rename to sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java index e35e1245a5..c440795e11 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountBalanceQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.CryptoGetAccountBalanceQuery; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.CryptoGetAccountBalanceQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import javax.annotation.Nullable; @@ -93,7 +93,7 @@ boolean isPaymentRequired() { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetAccountBalanceQuery.newBuilder(); if (accountId != null) { builder.setAccountID(accountId.toProtobuf()); @@ -107,7 +107,7 @@ void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader h } @Override - AccountBalance mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + AccountBalance mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return AccountBalance.fromProtobuf(response.getCryptogetAccountBalance()); } @@ -117,12 +117,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getCryptogetAccountBalance().getHeader(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoGetBalanceMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java index f745452d3d..87468472be 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoCreateTransactionBody; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoCreateTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.LinkedHashMap; @@ -55,7 +55,7 @@ public AccountCreateTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AccountCreateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -66,7 +66,7 @@ public AccountCreateTransaction() { * * @param txBody protobuf TransactionBody */ - AccountCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AccountCreateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -373,7 +373,7 @@ public AccountCreateTransaction setAlias(String aliasEvmAddress) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.CryptoCreateTransactionBody} + * @return {@link org.hiero.sdk.proto.CryptoCreateTransactionBody} */ CryptoCreateTransactionBody.Builder build() { var builder = CryptoCreateTransactionBody.newBuilder() @@ -449,7 +449,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCreateAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java index bea922e1a0..aea978e8ae 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoDeleteTransactionBody; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoDeleteTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -38,7 +38,7 @@ public AccountDeleteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AccountDeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -49,7 +49,7 @@ public AccountDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - AccountDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AccountDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -112,7 +112,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoDeleteMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountId.java b/sdk/src/main/java/org/hiero/sdk/AccountId.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/AccountId.java rename to sdk/src/main/java/org/hiero/sdk/AccountId.java index 0659bfec7f..fcb38e2c44 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountId.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountId.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AccountID; +import org.hiero.sdk.proto.AccountID; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; diff --git a/sdk/src/main/java/com/hiero/sdk/AccountInfo.java b/sdk/src/main/java/org/hiero/sdk/AccountInfo.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/AccountInfo.java rename to sdk/src/main/java/org/hiero/sdk/AccountInfo.java index 28a9fc0b2c..d97637d31e 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountInfo.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static java.util.stream.Collectors.toList; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoGetInfoResponse; +import org.hiero.sdk.proto.CryptoGetInfoResponse; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -239,12 +239,12 @@ static AccountInfo fromProtobuf(CryptoGetInfoResponse.AccountInfo accountInfo) { : null; var liveHashes = Arrays.stream(accountInfo.getLiveHashesList().toArray()) - .map((liveHash) -> LiveHash.fromProtobuf((com.hiero.sdk.proto.LiveHash) liveHash)) + .map((liveHash) -> LiveHash.fromProtobuf((org.hiero.sdk.proto.LiveHash) liveHash)) .collect(toList()); Map relationships = new HashMap<>(); - for (com.hiero.sdk.proto.TokenRelationship relationship : accountInfo.getTokenRelationshipsList()) { + for (org.hiero.sdk.proto.TokenRelationship relationship : accountInfo.getTokenRelationshipsList()) { TokenId tokenId = TokenId.fromProtobuf(relationship.getTokenId()); relationships.put(tokenId, TokenRelationship.fromProtobuf(relationship)); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java b/sdk/src/main/java/org/hiero/sdk/AccountInfoFlow.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java rename to sdk/src/main/java/org/hiero/sdk/AccountInfoFlow.java index f943a5c96b..11ebc1d315 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountInfoFlow.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountInfoFlow.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; diff --git a/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java similarity index 83% rename from sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java index dafff909de..db047af868 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.CryptoGetInfoQuery; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.CryptoGetInfoQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -55,7 +55,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetInfoQuery.newBuilder(); if (accountId != null) { @@ -71,17 +71,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getCryptoGetInfo().getHeader(); } @Override - AccountInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + AccountInfo mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return AccountInfo.fromProtobuf(response.getCryptoGetInfo().getAccountInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetAccountInfoMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java similarity index 82% rename from sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java rename to sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java index 0c0a745981..f844e5f1ca 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountRecordsQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.CryptoGetAccountRecordsQuery; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.CryptoGetAccountRecordsQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; @@ -55,7 +55,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetAccountRecordsQuery.newBuilder(); if (accountId != null) { @@ -71,12 +71,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getCryptoGetAccountRecords().getHeader(); } @Override - List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + List mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { var rawTransactionRecords = response.getCryptoGetAccountRecords().getRecordsList(); var transactionRecords = new ArrayList(rawTransactionRecords.size()); @@ -88,7 +88,7 @@ List mapResponse(Response response, AccountId nodeId, com.hie } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetAccountRecordsMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java similarity index 83% rename from sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java rename to sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java index 2e5f6abedb..e7626a4fe7 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountStakersQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.CryptoGetStakersQuery; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.CryptoGetStakersQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; @@ -57,7 +57,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetStakersQuery.newBuilder(); if (accountId != null) { @@ -73,12 +73,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getCryptoGetProxyStakers().getHeader(); } @Override - List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + List mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { var rawStakers = response.getCryptoGetProxyStakers().getStakers(); var stakers = new ArrayList(rawStakers.getProxyStakerCount()); @@ -90,7 +90,7 @@ List mapResponse(Response response, AccountId nodeId, com.hiero.sdk } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetStakersByAccountIDMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java index f594a0c6f7..9b3fd546b7 100644 --- a/sdk/src/main/java/com/hiero/sdk/AccountUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.BoolValue; import com.google.protobuf.Int32Value; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.CryptoUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.CryptoUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -82,7 +82,7 @@ public AccountUpdateTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ AccountUpdateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -93,7 +93,7 @@ public AccountUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - AccountUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + AccountUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -493,7 +493,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getUpdateAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java b/sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java rename to sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java index 35be25cd89..e2bfc23d9e 100644 --- a/sdk/src/main/java/com/hiero/sdk/AddressBookQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.mirror.NetworkServiceGrpc; +import org.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Deadline; @@ -205,9 +205,9 @@ public CompletableFuture executeAsync(Client client, Duration t void executeAsync(Client client, Deadline deadline, CompletableFuture returnFuture, int attempt) { List addresses = new ArrayList<>(); ClientCalls.asyncServerStreamingCall( - buildCall(client, deadline), buildQuery(), new StreamObserver() { + buildCall(client, deadline), buildQuery(), new StreamObserver() { @Override - public void onNext(com.hiero.sdk.proto.NodeAddress addressProto) { + public void onNext(org.hiero.sdk.proto.NodeAddress addressProto) { addresses.add(NodeAddress.fromProtobuf(addressProto)); } @@ -233,10 +233,10 @@ public void onCompleted() { /** * Build the address book query. * - * @return {@link com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery } + * @return {@link org.hiero.sdk.proto.mirror.AddressBookQuery buildQuery } */ - com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery() { - var builder = com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder(); + org.hiero.sdk.proto.mirror.AddressBookQuery buildQuery() { + var builder = org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder(); if (fileId != null) { builder.setFileId(fileId.toProtobuf()); } @@ -246,7 +246,7 @@ com.hiero.sdk.proto.mirror.AddressBookQuery buildQuery() { return builder.build(); } - private ClientCall buildCall( + private ClientCall buildCall( Client client, Deadline deadline) { try { return client.mirrorNetwork diff --git a/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java b/sdk/src/main/java/org/hiero/sdk/AssessedCustomFee.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java rename to sdk/src/main/java/org/hiero/sdk/AssessedCustomFee.java index d46cab956e..62ca4ee656 100644 --- a/sdk/src/main/java/com/hiero/sdk/AssessedCustomFee.java +++ b/sdk/src/main/java/org/hiero/sdk/AssessedCustomFee.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -50,7 +50,7 @@ public class AssessedCustomFee { * @param assessedCustomFee protobuf response object * @return the converted assessed custom fee object */ - static AssessedCustomFee fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee assessedCustomFee) { + static AssessedCustomFee fromProtobuf(org.hiero.sdk.proto.AssessedCustomFee assessedCustomFee) { var payerList = new ArrayList(assessedCustomFee.getEffectivePayerAccountIdCount()); for (var payerId : assessedCustomFee.getEffectivePayerAccountIdList()) { payerList.add(AccountId.fromProtobuf(payerId)); @@ -72,7 +72,7 @@ static AssessedCustomFee fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee asse * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static AssessedCustomFee fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.AssessedCustomFee.parseFrom(bytes).toBuilder() + return fromProtobuf(org.hiero.sdk.proto.AssessedCustomFee.parseFrom(bytes).toBuilder() .build()); } @@ -89,10 +89,10 @@ public String toString() { /** * Create the protobuf representation. * - * @return {@link com.hiero.sdk.proto.AssessedCustomFee} + * @return {@link org.hiero.sdk.proto.AssessedCustomFee} */ - com.hiero.sdk.proto.AssessedCustomFee toProtobuf() { - var builder = com.hiero.sdk.proto.AssessedCustomFee.newBuilder().setAmount(amount); + org.hiero.sdk.proto.AssessedCustomFee toProtobuf() { + var builder = org.hiero.sdk.proto.AssessedCustomFee.newBuilder().setAmount(amount); if (tokenId != null) { builder.setTokenId(tokenId.toProtobuf()); } diff --git a/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java b/sdk/src/main/java/org/hiero/sdk/BadEntityIdException.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java rename to sdk/src/main/java/org/hiero/sdk/BadEntityIdException.java index 00b04ed088..c78ae02ee8 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadEntityIdException.java +++ b/sdk/src/main/java/org/hiero/sdk/BadEntityIdException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Custom exception thrown by the entity helper validate method when the account id and checksum are invalid. diff --git a/sdk/src/main/java/com/hiero/sdk/BadKeyException.java b/sdk/src/main/java/org/hiero/sdk/BadKeyException.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/BadKeyException.java rename to sdk/src/main/java/org/hiero/sdk/BadKeyException.java index aebe3d81c8..24782389c3 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadKeyException.java +++ b/sdk/src/main/java/org/hiero/sdk/BadKeyException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Signals that a key could not be realized from the given input. diff --git a/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java b/sdk/src/main/java/org/hiero/sdk/BadMnemonicException.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java rename to sdk/src/main/java/org/hiero/sdk/BadMnemonicException.java index f327f7d596..3cc6080d78 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadMnemonicException.java +++ b/sdk/src/main/java/org/hiero/sdk/BadMnemonicException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.List; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java b/sdk/src/main/java/org/hiero/sdk/BadMnemonicReason.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java rename to sdk/src/main/java/org/hiero/sdk/BadMnemonicReason.java index d59c203ab2..b448ce31a9 100644 --- a/sdk/src/main/java/com/hiero/sdk/BadMnemonicReason.java +++ b/sdk/src/main/java/org/hiero/sdk/BadMnemonicReason.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Possible reason why a {@link Mnemonic} failed validation. diff --git a/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java b/sdk/src/main/java/org/hiero/sdk/BaseNetwork.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/BaseNetwork.java rename to sdk/src/main/java/org/hiero/sdk/BaseNetwork.java index d97c9d1ee2..d883e4dc90 100644 --- a/sdk/src/main/java/com/hiero/sdk/BaseNetwork.java +++ b/sdk/src/main/java/org/hiero/sdk/BaseNetwork.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.annotations.VisibleForTesting; import java.time.Duration; diff --git a/sdk/src/main/java/com/hiero/sdk/BaseNode.java b/sdk/src/main/java/org/hiero/sdk/BaseNode.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/BaseNode.java rename to sdk/src/main/java/org/hiero/sdk/BaseNode.java index f84875b455..4c06a07795 100644 --- a/sdk/src/main/java/com/hiero/sdk/BaseNode.java +++ b/sdk/src/main/java/org/hiero/sdk/BaseNode.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import io.grpc.ChannelCredentials; import io.grpc.ConnectivityState; diff --git a/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java b/sdk/src/main/java/org/hiero/sdk/BaseNodeAddress.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java rename to sdk/src/main/java/org/hiero/sdk/BaseNodeAddress.java index 2ea1171e6f..e7600a3143 100644 --- a/sdk/src/main/java/com/hiero/sdk/BaseNodeAddress.java +++ b/sdk/src/main/java/org/hiero/sdk/BaseNodeAddress.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.Objects; import java.util.regex.Pattern; diff --git a/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java b/sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java index 012ce1d3fe..4bc3d4f91b 100644 --- a/sdk/src/main/java/com/hiero/sdk/ChunkedTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SignatureMap; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.SignatureMap; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionID; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; @@ -46,7 +46,7 @@ abstract class ChunkedTransaction> extends Trans * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ChunkedTransaction(LinkedHashMap> txs) + ChunkedTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); } @@ -56,7 +56,7 @@ abstract class ChunkedTransaction> extends Trans * * @param txBody protobuf TransactionBody */ - ChunkedTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + ChunkedTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); } @@ -348,7 +348,7 @@ public CompletableFuture> executeAllAsync(Client clien public CompletableFuture> executeAllAsync(Client client, Duration timeoutPerChunk) { freezeAndSign(client); - CompletableFuture> future = + CompletableFuture> future = CompletableFuture.supplyAsync(() -> new ArrayList<>(transactionIds.size())); for (var i = 0; i < transactionIds.size(); i++) { @@ -426,7 +426,7 @@ public void executeAllAsync( } @Override - public CompletableFuture executeAsync(Client client, Duration timeoutPerChunk) { + public CompletableFuture executeAsync(Client client, Duration timeoutPerChunk) { return executeAllAsync(client, timeoutPerChunk).thenApply(responses -> responses.get(0)); } diff --git a/sdk/src/main/java/com/hiero/sdk/Client.java b/sdk/src/main/java/org/hiero/sdk/Client.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/Client.java rename to sdk/src/main/java/org/hiero/sdk/Client.java index 4dfed14b37..3598374303 100644 --- a/sdk/src/main/java/com/hiero/sdk/Client.java +++ b/sdk/src/main/java/org/hiero/sdk/Client.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.annotations.VisibleForTesting; import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -8,8 +8,8 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; import java.io.File; import java.io.IOException; import java.io.Reader; @@ -147,7 +147,7 @@ static ExecutorService createExecutor() { * * @param networkMap the map of node IDs to node addresses that make up the network. * @param executor runs the grpc requests asynchronously. - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forNetwork(Map networkMap, ExecutorService executor) { var network = Network.forNetwork(executor, networkMap); @@ -166,7 +166,7 @@ public static Client forNetwork(Map networkMap, ExecutorServi * chose nodes to send transactions to. For one transaction, at most 1/3 of the nodes will be tried. * * @param networkMap the map of node IDs to node addresses that make up the network. - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forNetwork(Map networkMap) { var executor = createExecutor(); @@ -213,7 +213,7 @@ public static Client forName(String name) { * href="https://docs.hedera.com/guides/mainnet/address-book#mainnet-address-book">Mainnet access. * * @param executor runs the grpc requests asynchronously. - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forMainnet(ExecutorService executor) { var network = Network.forMainnet(executor); @@ -228,7 +228,7 @@ public static Client forMainnet(ExecutorService executor) { * access. * * @param executor runs the grpc requests asynchronously. - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forTestnet(ExecutorService executor) { var network = Network.forTestnet(executor); @@ -244,7 +244,7 @@ public static Client forTestnet(ExecutorService executor) { * nodes. * * @param executor runs the grpc requests asynchronously. - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forPreviewnet(ExecutorService executor) { var network = Network.forPreviewnet(executor); @@ -258,7 +258,7 @@ public static Client forPreviewnet(ExecutorService executor) { * Construct a Hedera client pre-configured for Mainnet access. * - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forMainnet() { var executor = createExecutor(); @@ -273,7 +273,7 @@ public static Client forMainnet() { * Construct a Hedera client pre-configured for Testnet * access. * - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forTestnet() { var executor = createExecutor(); @@ -289,7 +289,7 @@ public static Client forTestnet() { * href="https://docs.hedera.com/guides/testnet/testnet-nodes#previewnet-node-public-keys">Preview Testnet * nodes. * - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} */ public static Client forPreviewnet() { var executor = createExecutor(); @@ -304,7 +304,7 @@ public static Client forPreviewnet() { * Configure a client based off the given JSON string. * * @param json The json string containing the client configuration - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} * @throws Exception if the config is incorrect */ public static Client fromConfig(String json) throws Exception { @@ -315,7 +315,7 @@ public static Client fromConfig(String json) throws Exception { * Configure a client based off the given JSON reader. * * @param json The Reader containing the client configuration - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} * @throws Exception if the config is incorrect */ public static Client fromConfig(Reader json) throws Exception { @@ -336,7 +336,7 @@ private static Map getNetworkNodes(JsonObject networks) { * Configure a client based on a JSON file at the given path. * * @param fileName The string containing the file path - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} * @throws IOException if IO operations fail */ public static Client fromConfigFile(String fileName) throws Exception { @@ -347,7 +347,7 @@ public static Client fromConfigFile(String fileName) throws Exception { * Configure a client based on a JSON file. * * @param file The file containing the client configuration - * @return {@link com.hiero.sdk.Client} + * @return {@link org.hiero.sdk.Client} * @throws IOException if IO operations fail */ public static Client fromConfigFile(File file) throws Exception { diff --git a/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java b/sdk/src/main/java/org/hiero/sdk/ConsumerHelper.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java rename to sdk/src/main/java/org/hiero/sdk/ConsumerHelper.java index fa37d076fb..8e586a9b8d 100644 --- a/sdk/src/main/java/com/hiero/sdk/ConsumerHelper.java +++ b/sdk/src/main/java/org/hiero/sdk/ConsumerHelper.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.concurrent.CompletableFuture; import java.util.function.BiConsumer; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java b/sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java similarity index 80% rename from sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java rename to sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java index f2ee254640..f8bef9b868 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractByteCodeQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ContractGetBytecodeQuery; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.ContractGetBytecodeQuery; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import javax.annotation.Nullable; @@ -53,7 +53,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ContractGetBytecodeQuery.newBuilder(); if (contractId != null) { builder.setContractID(contractId.toProtobuf()); @@ -68,17 +68,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getContractGetBytecode().getHeader(); } @Override - ByteString mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + ByteString mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return response.getContractGetBytecodeResponse().getBytecode(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getContractGetBytecodeMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractCallQuery.java b/sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/ContractCallQuery.java rename to sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java index 52a0a63e81..6cadf89320 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractCallQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ContractCallLocalQuery; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.ContractCallLocalQuery; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.Objects; @@ -198,7 +198,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ContractCallLocalQuery.newBuilder(); if (contractId != null) { builder.setContractID(contractId.toProtobuf()); @@ -218,17 +218,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getContractCallLocal().getHeader(); } @Override - ContractFunctionResult mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + ContractFunctionResult mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return new ContractFunctionResult(response.getContractCallLocal().getFunctionResult()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getContractCallLocalMethodMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java b/sdk/src/main/java/org/hiero/sdk/ContractCreateFlow.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java rename to sdk/src/main/java/org/hiero/sdk/ContractCreateFlow.java index bed7ad0299..6a88833f4a 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractCreateFlow.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractCreateFlow.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import java.time.Duration; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java index f4133d47c9..428bffe59d 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractCreateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ContractCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.LinkedHashMap; @@ -114,7 +114,7 @@ public ContractCreateTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ ContractCreateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -125,7 +125,7 @@ public ContractCreateTransaction() { * * @param txBody protobuf TransactionBody */ - ContractCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + ContractCreateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -590,7 +590,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getCreateContractMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java index 3885ec37dd..a94dd5b7db 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ContractDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -39,7 +39,7 @@ public ContractDeleteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ ContractDeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public ContractDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - ContractDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + ContractDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -150,7 +150,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getDeleteContractMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java index a7214ba752..c31488a246 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractExecuteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractCallTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ContractCallTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -44,7 +44,7 @@ public ContractExecuteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ ContractExecuteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -55,7 +55,7 @@ public ContractExecuteTransaction() {} * * @param txBody protobuf TransactionBody */ - ContractExecuteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + ContractExecuteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -214,7 +214,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getContractCallMethodMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java b/sdk/src/main/java/org/hiero/sdk/ContractFunctionParameters.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java rename to sdk/src/main/java/org/hiero/sdk/ContractFunctionParameters.java index 6b077f2fab..a9e45b0798 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractFunctionParameters.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractFunctionParameters.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import java.math.BigInteger; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java b/sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java rename to sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java index db01756adc..8a346983e1 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractFunctionResult.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.esaulpaugh.headlong.abi.Tuple; import com.esaulpaugh.headlong.abi.TupleType; @@ -7,7 +7,7 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.Int64Value; -import com.hiero.sdk.proto.ContractFunctionResultOrBuilder; +import org.hiero.sdk.proto.ContractFunctionResultOrBuilder; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -416,10 +416,10 @@ private ByteString getByteString(int startIndex, int endIndex) { /** * Create the protobuf representation. * - * @return {@link com.hiero.sdk.proto.ContractFunctionResult} + * @return {@link org.hiero.sdk.proto.ContractFunctionResult} */ - com.hiero.sdk.proto.ContractFunctionResult toProtobuf() { - var contractFunctionResult = com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + org.hiero.sdk.proto.ContractFunctionResult toProtobuf() { + var contractFunctionResult = org.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(contractId.toProtobuf()) .setContractCallResult(rawResult) .setBloom(bloom) diff --git a/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java b/sdk/src/main/java/org/hiero/sdk/ContractFunctionSelector.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java rename to sdk/src/main/java/org/hiero/sdk/ContractFunctionSelector.java index e6018191ae..fb5f9a719b 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractFunctionSelector.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractFunctionSelector.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static java.nio.charset.StandardCharsets.US_ASCII; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractId.java b/sdk/src/main/java/org/hiero/sdk/ContractId.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/ContractId.java rename to sdk/src/main/java/org/hiero/sdk/ContractId.java index 9096d97754..7b0706c89a 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractId.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractId.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractID; +import org.hiero.sdk.proto.ContractID; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -253,8 +253,8 @@ public String getChecksum() { } @Override - com.hiero.sdk.proto.Key toProtobufKey() { - return com.hiero.sdk.proto.Key.newBuilder().setContractID(toProtobuf()).build(); + org.hiero.sdk.proto.Key toProtobufKey() { + return org.hiero.sdk.proto.Key.newBuilder().setContractID(toProtobuf()).build(); } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/ContractInfo.java b/sdk/src/main/java/org/hiero/sdk/ContractInfo.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/ContractInfo.java rename to sdk/src/main/java/org/hiero/sdk/ContractInfo.java index c6f049319b..0183042db5 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractInfo.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractGetInfoResponse; +import org.hiero.sdk.proto.ContractGetInfoResponse; import java.time.Duration; import java.time.Instant; import java.util.HashMap; diff --git a/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java similarity index 84% rename from sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java index e8a47aa86a..f484758d1b 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.ContractGetInfoQuery; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.ContractGetInfoQuery; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -64,7 +64,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ContractGetInfoQuery.newBuilder(); if (contractId != null) { builder.setContractID(contractId.toProtobuf()); @@ -79,17 +79,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getContractGetInfo().getHeader(); } @Override - ContractInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + ContractInfo mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return ContractInfo.fromProtobuf(response.getContractGetInfo().getContractInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getGetContractInfoMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ContractLogInfo.java b/sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/ContractLogInfo.java rename to sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java index f0cdd254c6..30c450ac41 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractLogInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractLoginfo; +import org.hiero.sdk.proto.ContractLoginfo; import java.util.ArrayList; import java.util.List; import org.bouncycastle.util.encoders.Hex; @@ -55,7 +55,7 @@ private ContractLogInfo(ContractId contractId, ByteString bloom, List storageChanges = new ArrayList<>(stateChangeProto.getStorageChangesCount()); // for (var storageChangeProto : stateChangeProto.getStorageChangesList()) { // storageChanges.add(StorageChange.fromProtobuf(storageChangeProto)); @@ -54,7 +54,7 @@ public class ContractStateChange { // * @throws InvalidProtocolBufferException when there is an issue with the protobuf // */ // public static ContractStateChange fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - // return fromProtobuf(com.hiero.sdk.proto.ContractStateChange.parseFrom(bytes)); + // return fromProtobuf(org.hiero.sdk.proto.ContractStateChange.parseFrom(bytes)); // } // // /** @@ -62,8 +62,8 @@ public class ContractStateChange { // * // * @return the protobuf representation // */ - // com.hiero.sdk.proto.ContractStateChange toProtobuf() { - // var builder = com.hiero.sdk.proto.ContractStateChange.newBuilder() + // org.hiero.sdk.proto.ContractStateChange toProtobuf() { + // var builder = org.hiero.sdk.proto.ContractStateChange.newBuilder() // .setContractID(contractId.toProtobuf()); // for (var storageChange : storageChanges) { // builder.addStorageChanges(storageChange.toProtobuf()); diff --git a/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java index 216061caa7..c82e0424e9 100644 --- a/sdk/src/main/java/com/hiero/sdk/ContractUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.BoolValue; import com.google.protobuf.Int32Value; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.ContractUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ContractUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -89,7 +89,7 @@ public ContractUpdateTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ ContractUpdateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -99,7 +99,7 @@ public ContractUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - ContractUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + ContractUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -499,7 +499,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.ContractUpdateTransactionBody builder } + * @return {@link org.hiero.sdk.proto.ContractUpdateTransactionBody builder } */ ContractUpdateTransactionBody.Builder build() { var builder = ContractUpdateTransactionBody.newBuilder(); @@ -565,7 +565,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getUpdateContractMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/Crypto.java b/sdk/src/main/java/org/hiero/sdk/Crypto.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Crypto.java rename to sdk/src/main/java/org/hiero/sdk/Crypto.java index cf9f37be6b..6bc6de0861 100644 --- a/sdk/src/main/java/com/hiero/sdk/Crypto.java +++ b/sdk/src/main/java/org/hiero/sdk/Crypto.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.math.BigInteger; import java.nio.charset.StandardCharsets; diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFee.java b/sdk/src/main/java/org/hiero/sdk/CustomFee.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/CustomFee.java rename to sdk/src/main/java/org/hiero/sdk/CustomFee.java index fc050a79ae..68c0fd51e7 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomFee.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -33,7 +33,7 @@ public abstract class CustomFee { * @param customFee protobuf response object * @return the converted custom fee object */ - static CustomFee fromProtobufInner(com.hiero.sdk.proto.CustomFee customFee) { + static CustomFee fromProtobufInner(org.hiero.sdk.proto.CustomFee customFee) { switch (customFee.getFeeCase()) { case FIXED_FEE: return CustomFixedFee.fromProtobuf(customFee.getFixedFee()); @@ -50,7 +50,7 @@ static CustomFee fromProtobufInner(com.hiero.sdk.proto.CustomFee customFee) { } } - static CustomFee fromProtobuf(com.hiero.sdk.proto.CustomFee customFee) { + static CustomFee fromProtobuf(org.hiero.sdk.proto.CustomFee customFee) { var outFee = fromProtobufInner(customFee); if (customFee.hasFeeCollectorAccountId()) { outFee.feeCollectorAccountId = AccountId.fromProtobuf(customFee.getFeeCollectorAccountId()); @@ -69,7 +69,7 @@ static CustomFee fromProtobuf(com.hiero.sdk.proto.CustomFee customFee) { */ public static CustomFee fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.CustomFee.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.CustomFee.parseFrom(bytes).toBuilder().build()); } /** @@ -129,7 +129,7 @@ void validateChecksums(Client client) throws BadEntityIdException { * @param customFeeBuilder the builder object * @return the protobuf */ - protected com.hiero.sdk.proto.CustomFee finishToProtobuf(com.hiero.sdk.proto.CustomFee.Builder customFeeBuilder) { + protected org.hiero.sdk.proto.CustomFee finishToProtobuf(org.hiero.sdk.proto.CustomFee.Builder customFeeBuilder) { if (feeCollectorAccountId != null) { customFeeBuilder.setFeeCollectorAccountId(feeCollectorAccountId.toProtobuf()); } @@ -142,7 +142,7 @@ protected com.hiero.sdk.proto.CustomFee finishToProtobuf(com.hiero.sdk.proto.Cus * * @return the protobuf for the custom fee object */ - abstract com.hiero.sdk.proto.CustomFee toProtobuf(); + abstract org.hiero.sdk.proto.CustomFee toProtobuf(); /** * Create the byte array. diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java b/sdk/src/main/java/org/hiero/sdk/CustomFeeBase.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java rename to sdk/src/main/java/org/hiero/sdk/CustomFeeBase.java index 9342bec1ec..54b5ac627e 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFeeBase.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomFeeBase.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.Objects; diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java b/sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java rename to sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java index ac0cbcb8bd..958d51457f 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFixedFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.FixedFee; +import org.hiero.sdk.proto.FixedFee; import javax.annotation.Nullable; /** @@ -145,8 +145,8 @@ FixedFee toFixedFeeProtobuf() { } @Override - com.hiero.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder().setFixedFee(toFixedFeeProtobuf()); + org.hiero.sdk.proto.CustomFee toProtobuf() { + var customFeeBuilder = org.hiero.sdk.proto.CustomFee.newBuilder().setFixedFee(toFixedFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } } diff --git a/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java b/sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java rename to sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java index 6481db15c2..872f623de0 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomFractionalFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Fraction; -import com.hiero.sdk.proto.FractionalFee; +import org.hiero.sdk.proto.Fraction; +import org.hiero.sdk.proto.FractionalFee; import java.util.Objects; /** @@ -184,8 +184,8 @@ FractionalFee toFractionalFeeProtobuf() { } @Override - com.hiero.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder().setFractionalFee(toFractionalFeeProtobuf()); + org.hiero.sdk.proto.CustomFee toProtobuf() { + var customFeeBuilder = org.hiero.sdk.proto.CustomFee.newBuilder().setFractionalFee(toFractionalFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } } diff --git a/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java b/sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java rename to sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java index 9b4ca8ffbf..707d539cde 100644 --- a/sdk/src/main/java/com/hiero/sdk/CustomRoyaltyFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Fraction; -import com.hiero.sdk.proto.RoyaltyFee; +import org.hiero.sdk.proto.Fraction; +import org.hiero.sdk.proto.RoyaltyFee; import java.util.Objects; import javax.annotation.Nullable; @@ -128,8 +128,8 @@ RoyaltyFee toRoyaltyFeeProtobuf() { } @Override - com.hiero.sdk.proto.CustomFee toProtobuf() { - var customFeeBuilder = com.hiero.sdk.proto.CustomFee.newBuilder().setRoyaltyFee(toRoyaltyFeeProtobuf()); + org.hiero.sdk.proto.CustomFee toProtobuf() { + var customFeeBuilder = org.hiero.sdk.proto.CustomFee.newBuilder().setRoyaltyFee(toRoyaltyFeeProtobuf()); return finishToProtobuf(customFeeBuilder); } diff --git a/sdk/src/main/java/com/hiero/sdk/Delayer.java b/sdk/src/main/java/org/hiero/sdk/Delayer.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/Delayer.java rename to sdk/src/main/java/org/hiero/sdk/Delayer.java index 55fb8b968f..722ec569eb 100644 --- a/sdk/src/main/java/com/hiero/sdk/Delayer.java +++ b/sdk/src/main/java/org/hiero/sdk/Delayer.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.time.Duration; import java.util.concurrent.CompletableFuture; diff --git a/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java b/sdk/src/main/java/org/hiero/sdk/DelegateContractId.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/DelegateContractId.java rename to sdk/src/main/java/org/hiero/sdk/DelegateContractId.java index f3dca902f4..ee95febe07 100644 --- a/sdk/src/main/java/com/hiero/sdk/DelegateContractId.java +++ b/sdk/src/main/java/org/hiero/sdk/DelegateContractId.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractID; +import org.hiero.sdk.proto.ContractID; import java.util.Objects; import javax.annotation.Nullable; @@ -85,8 +85,8 @@ public static DelegateContractId fromBytes(byte[] bytes) throws InvalidProtocolB } @Override - com.hiero.sdk.proto.Key toProtobufKey() { - return com.hiero.sdk.proto.Key.newBuilder() + org.hiero.sdk.proto.Key toProtobufKey() { + return org.hiero.sdk.proto.Key.newBuilder() .setDelegatableContractId(toProtobuf()) .build(); } diff --git a/sdk/src/main/java/com/hiero/sdk/DurationConverter.java b/sdk/src/main/java/org/hiero/sdk/DurationConverter.java similarity index 78% rename from sdk/src/main/java/com/hiero/sdk/DurationConverter.java rename to sdk/src/main/java/org/hiero/sdk/DurationConverter.java index a2d78b88d3..6006c25ea9 100644 --- a/sdk/src/main/java/com/hiero/sdk/DurationConverter.java +++ b/sdk/src/main/java/org/hiero/sdk/DurationConverter.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.time.Duration; @@ -15,7 +15,7 @@ private DurationConverter() {} * @param duration the duration protobuf * @return the duration object */ - static Duration fromProtobuf(com.hiero.sdk.proto.Duration duration) { + static Duration fromProtobuf(org.hiero.sdk.proto.Duration duration) { return Duration.ofSeconds(duration.getSeconds()); } @@ -25,8 +25,8 @@ static Duration fromProtobuf(com.hiero.sdk.proto.Duration duration) { * @param duration the duration object * @return the protobuf */ - static com.hiero.sdk.proto.Duration toProtobuf(Duration duration) { - return com.hiero.sdk.proto.Duration.newBuilder() + static org.hiero.sdk.proto.Duration toProtobuf(Duration duration) { + return org.hiero.sdk.proto.Duration.newBuilder() .setSeconds(duration.getSeconds()) .build(); } diff --git a/sdk/src/main/java/com/hiero/sdk/Endpoint.java b/sdk/src/main/java/org/hiero/sdk/Endpoint.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/Endpoint.java rename to sdk/src/main/java/org/hiero/sdk/Endpoint.java index 040660c822..23f24d419d 100644 --- a/sdk/src/main/java/com/hiero/sdk/Endpoint.java +++ b/sdk/src/main/java/org/hiero/sdk/Endpoint.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ServiceEndpoint; +import org.hiero.sdk.proto.ServiceEndpoint; import javax.annotation.Nullable; /** diff --git a/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java b/sdk/src/main/java/org/hiero/sdk/EntityIdHelper.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java rename to sdk/src/main/java/org/hiero/sdk/EntityIdHelper.java index 0e389aee06..c3d9837f37 100644 --- a/sdk/src/main/java/com/hiero/sdk/EntityIdHelper.java +++ b/sdk/src/main/java/org/hiero/sdk/EntityIdHelper.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.gson.JsonObject; import com.google.gson.JsonParser; diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java b/sdk/src/main/java/org/hiero/sdk/EthereumFlow.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/EthereumFlow.java rename to sdk/src/main/java/org/hiero/sdk/EthereumFlow.java index 0d0e2a9f1c..304f470774 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumFlow.java +++ b/sdk/src/main/java/org/hiero/sdk/EthereumFlow.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.time.Duration; import java.util.Arrays; diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java b/sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java rename to sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java index f95b1d6b91..61ce6c6c51 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.EthereumTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.EthereumTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.LinkedHashMap; @@ -27,13 +27,13 @@ public class EthereumTransaction extends Transaction { */ public EthereumTransaction() {} - EthereumTransaction(LinkedHashMap> txs) + EthereumTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } - EthereumTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + EthereumTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -144,7 +144,7 @@ private EthereumTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return SmartContractServiceGrpc.getCallEthereumMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java b/sdk/src/main/java/org/hiero/sdk/EthereumTransactionData.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java rename to sdk/src/main/java/org/hiero/sdk/EthereumTransactionData.java index 49a1b695b4..4059766e11 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionData.java +++ b/sdk/src/main/java/org/hiero/sdk/EthereumTransactionData.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java b/sdk/src/main/java/org/hiero/sdk/EthereumTransactionDataEip1559.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java rename to sdk/src/main/java/org/hiero/sdk/EthereumTransactionDataEip1559.java index fe3deff537..5d26c33b1c 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataEip1559.java +++ b/sdk/src/main/java/org/hiero/sdk/EthereumTransactionDataEip1559.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; import com.esaulpaugh.headlong.rlp.RLPEncoder; diff --git a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java b/sdk/src/main/java/org/hiero/sdk/EthereumTransactionDataLegacy.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java rename to sdk/src/main/java/org/hiero/sdk/EthereumTransactionDataLegacy.java index f97367ed01..183e0e7e30 100644 --- a/sdk/src/main/java/com/hiero/sdk/EthereumTransactionDataLegacy.java +++ b/sdk/src/main/java/org/hiero/sdk/EthereumTransactionDataLegacy.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.esaulpaugh.headlong.rlp.RLPDecoder; import com.esaulpaugh.headlong.rlp.RLPEncoder; diff --git a/sdk/src/main/java/com/hiero/sdk/EvmAddress.java b/sdk/src/main/java/org/hiero/sdk/EvmAddress.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/EvmAddress.java rename to sdk/src/main/java/org/hiero/sdk/EvmAddress.java index 13bd446080..90ead27816 100644 --- a/sdk/src/main/java/com/hiero/sdk/EvmAddress.java +++ b/sdk/src/main/java/org/hiero/sdk/EvmAddress.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import java.util.Arrays; @@ -54,7 +54,7 @@ public static EvmAddress fromBytes(byte[] bytes) { } @Override - com.hiero.sdk.proto.Key toProtobufKey() { + org.hiero.sdk.proto.Key toProtobufKey() { throw new UnsupportedOperationException("toProtobufKey() not implemented for EvmAddress"); } diff --git a/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java b/sdk/src/main/java/org/hiero/sdk/ExchangeRate.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/ExchangeRate.java rename to sdk/src/main/java/org/hiero/sdk/ExchangeRate.java index d61924afa1..e5ba9f7075 100644 --- a/sdk/src/main/java/com/hiero/sdk/ExchangeRate.java +++ b/sdk/src/main/java/org/hiero/sdk/ExchangeRate.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import java.time.Instant; @@ -41,7 +41,7 @@ public final class ExchangeRate { * @param pb the protobuf * @return the new exchange rate */ - static ExchangeRate fromProtobuf(com.hiero.sdk.proto.ExchangeRate pb) { + static ExchangeRate fromProtobuf(org.hiero.sdk.proto.ExchangeRate pb) { return new ExchangeRate( pb.getHbarEquiv(), pb.getCentEquiv(), InstantConverter.fromProtobuf(pb.getExpirationTime())); } diff --git a/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java b/sdk/src/main/java/org/hiero/sdk/ExchangeRates.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/ExchangeRates.java rename to sdk/src/main/java/org/hiero/sdk/ExchangeRates.java index 416713a9e4..b089496121 100644 --- a/sdk/src/main/java/com/hiero/sdk/ExchangeRates.java +++ b/sdk/src/main/java/org/hiero/sdk/ExchangeRates.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -29,7 +29,7 @@ private ExchangeRates(ExchangeRate currentRate, ExchangeRate nextRate) { * @param pb the protobuf * @return the new exchange rates */ - static ExchangeRates fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet pb) { + static ExchangeRates fromProtobuf(org.hiero.sdk.proto.ExchangeRateSet pb) { return new ExchangeRates( ExchangeRate.fromProtobuf(pb.getCurrentRate()), ExchangeRate.fromProtobuf(pb.getNextRate())); } @@ -43,7 +43,7 @@ static ExchangeRates fromProtobuf(com.hiero.sdk.proto.ExchangeRateSet pb) { */ public static ExchangeRates fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.ExchangeRateSet.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.ExchangeRateSet.parseFrom(bytes).toBuilder().build()); } @Override diff --git a/sdk/src/main/java/com/hiero/sdk/Executable.java b/sdk/src/main/java/org/hiero/sdk/Executable.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Executable.java rename to sdk/src/main/java/org/hiero/sdk/Executable.java index d80aedd19f..74733d45c7 100644 --- a/sdk/src/main/java/com/hiero/sdk/Executable.java +++ b/sdk/src/main/java/org/hiero/sdk/Executable.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.FutureConverter.toCompletableFuture; +import static org.hiero.sdk.FutureConverter.toCompletableFuture; import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.MessageLite; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.MethodDescriptor; diff --git a/sdk/src/main/java/com/hiero/sdk/ExecutionState.java b/sdk/src/main/java/org/hiero/sdk/ExecutionState.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/ExecutionState.java rename to sdk/src/main/java/org/hiero/sdk/ExecutionState.java index 6fc199a4ad..7674ebda06 100644 --- a/sdk/src/main/java/com/hiero/sdk/ExecutionState.java +++ b/sdk/src/main/java/org/hiero/sdk/ExecutionState.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Enum for the execution states. diff --git a/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java b/sdk/src/main/java/org/hiero/sdk/FeeAssessmentMethod.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java rename to sdk/src/main/java/org/hiero/sdk/FeeAssessmentMethod.java index 8136b49071..40c668b37d 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeAssessmentMethod.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeAssessmentMethod.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Enum for the fee assessment method. diff --git a/sdk/src/main/java/com/hiero/sdk/FeeComponents.java b/sdk/src/main/java/org/hiero/sdk/FeeComponents.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/FeeComponents.java rename to sdk/src/main/java/org/hiero/sdk/FeeComponents.java index 7aec8a6ea0..5911a74733 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeComponents.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeComponents.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -64,7 +64,7 @@ public FeeComponents() {} * @param feeComponents the protobuf * @return the fee component object */ - static FeeComponents fromProtobuf(com.hiero.sdk.proto.FeeComponents feeComponents) { + static FeeComponents fromProtobuf(org.hiero.sdk.proto.FeeComponents feeComponents) { return new FeeComponents() .setMin(feeComponents.getMin()) .setMax(feeComponents.getMax()) @@ -88,7 +88,7 @@ static FeeComponents fromProtobuf(com.hiero.sdk.proto.FeeComponents feeComponent */ public static FeeComponents fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.FeeComponents.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.FeeComponents.parseFrom(bytes).toBuilder().build()); } /** @@ -316,8 +316,8 @@ public FeeComponents setResponseDiskByte(long responseDiskByte) { * * @return the protobuf */ - com.hiero.sdk.proto.FeeComponents toProtobuf() { - return com.hiero.sdk.proto.FeeComponents.newBuilder() + org.hiero.sdk.proto.FeeComponents toProtobuf() { + return org.hiero.sdk.proto.FeeComponents.newBuilder() .setMin(getMin()) .setMax(getMax()) .setConstant(getConstant()) diff --git a/sdk/src/main/java/com/hiero/sdk/FeeData.java b/sdk/src/main/java/org/hiero/sdk/FeeData.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/FeeData.java rename to sdk/src/main/java/org/hiero/sdk/FeeData.java index 9fa18b385b..e1b26f46b8 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeData.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeData.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -32,7 +32,7 @@ public FeeData() {} * @param feeData the protobuf * @return the fee data object */ - static FeeData fromProtobuf(com.hiero.sdk.proto.FeeData feeData) { + static FeeData fromProtobuf(org.hiero.sdk.proto.FeeData feeData) { return new FeeData() .setNodeData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getNodedata()) : null) .setNetworkData(feeData.hasNetworkdata() ? FeeComponents.fromProtobuf(feeData.getNetworkdata()) : null) @@ -49,7 +49,7 @@ static FeeData fromProtobuf(com.hiero.sdk.proto.FeeData feeData) { */ public static FeeData fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.FeeData.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.FeeData.parseFrom(bytes).toBuilder().build()); } /** @@ -126,7 +126,7 @@ FeeDataType getType() { /** * Assign the fee data type. - * {@link com.hiero.sdk.FeeDataType} + * {@link org.hiero.sdk.FeeDataType} * * @param type the fee data type * @return {@code this} @@ -141,8 +141,8 @@ FeeData setType(FeeDataType type) { * * @return the protobuf */ - com.hiero.sdk.proto.FeeData toProtobuf() { - var builder = com.hiero.sdk.proto.FeeData.newBuilder().setSubType(type.code); + org.hiero.sdk.proto.FeeData toProtobuf() { + var builder = org.hiero.sdk.proto.FeeData.newBuilder().setSubType(type.code); if (nodeData != null) { builder.setNodedata(nodeData.toProtobuf()); } diff --git a/sdk/src/main/java/com/hiero/sdk/FeeDataType.java b/sdk/src/main/java/org/hiero/sdk/FeeDataType.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/FeeDataType.java rename to sdk/src/main/java/org/hiero/sdk/FeeDataType.java index a4cc5af3fc..ccc295b0c7 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeDataType.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeDataType.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.SubType; +import org.hiero.sdk.proto.SubType; /** * Enum for the fee data types. diff --git a/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java b/sdk/src/main/java/org/hiero/sdk/FeeSchedule.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/FeeSchedule.java rename to sdk/src/main/java/org/hiero/sdk/FeeSchedule.java index 92324afaf2..25988a8461 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeSchedule.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeSchedule.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -32,7 +32,7 @@ public FeeSchedule() {} * @param feeSchedule the protobuf * @return the fee schedule */ - static FeeSchedule fromProtobuf(com.hiero.sdk.proto.FeeSchedule feeSchedule) { + static FeeSchedule fromProtobuf(org.hiero.sdk.proto.FeeSchedule feeSchedule) { FeeSchedule returnFeeSchedule = new FeeSchedule() .setExpirationTime( feeSchedule.hasExpiryTime() @@ -53,7 +53,7 @@ static FeeSchedule fromProtobuf(com.hiero.sdk.proto.FeeSchedule feeSchedule) { */ public static FeeSchedule fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.FeeSchedule.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.FeeSchedule.parseFrom(bytes).toBuilder().build()); } /** @@ -121,8 +121,8 @@ public FeeSchedule setExpirationTime(@Nullable Instant expirationTime) { * * @return the protobuf */ - com.hiero.sdk.proto.FeeSchedule toProtobuf() { - var returnBuilder = com.hiero.sdk.proto.FeeSchedule.newBuilder(); + org.hiero.sdk.proto.FeeSchedule toProtobuf() { + var returnBuilder = org.hiero.sdk.proto.FeeSchedule.newBuilder(); if (expirationTime != null) { returnBuilder.setExpiryTime(InstantConverter.toSecondsProtobuf(expirationTime)); } diff --git a/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java b/sdk/src/main/java/org/hiero/sdk/FeeSchedules.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/FeeSchedules.java rename to sdk/src/main/java/org/hiero/sdk/FeeSchedules.java index ce85a5ee85..d27d651530 100644 --- a/sdk/src/main/java/com/hiero/sdk/FeeSchedules.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeSchedules.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CurrentAndNextFeeSchedule; +import org.hiero.sdk.proto.CurrentAndNextFeeSchedule; import javax.annotation.Nullable; /** diff --git a/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java rename to sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java index 91ae9b9836..71fa7447bf 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileAppendTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileAppendTransactionBody; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionID; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileAppendTransactionBody; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -43,7 +43,7 @@ public FileAppendTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileAppendTransaction(LinkedHashMap> txs) + FileAppendTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); @@ -55,7 +55,7 @@ public FileAppendTransaction() { * * @param txBody protobuf TransactionBody */ - FileAppendTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + FileAppendTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -140,7 +140,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getAppendContentMethod(); } @@ -174,7 +174,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.FileAppendTransactionBody builder} + * @return {@link org.hiero.sdk.proto.FileAppendTransactionBody builder} */ FileAppendTransactionBody.Builder build() { var builder = FileAppendTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java b/sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java similarity index 85% rename from sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java rename to sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java index 97fb5049f8..5de53fe5e0 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileContentsQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.FileGetContentsQuery; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.FileGetContentsQuery; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -70,7 +70,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = FileGetContentsQuery.newBuilder(); if (fileId != null) { builder.setFileID(fileId.toProtobuf()); @@ -85,17 +85,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getFileGetContents().getHeader(); } @Override - ByteString mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + ByteString mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return response.getFileGetContents().getFileContents().getContents(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getGetFileContentMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/FileCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/FileCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java index 739c2f52b1..39d0791973 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileCreateTransactionBody; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileCreateTransactionBody; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.nio.charset.StandardCharsets; import java.time.Instant; @@ -49,7 +49,7 @@ public FileCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileCreateTransaction(LinkedHashMap> txs) + FileCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -60,7 +60,7 @@ public FileCreateTransaction() { * * @param txBody protobuf TransactionBody */ - FileCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + FileCreateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -112,7 +112,7 @@ public Collection getKeys() { * paying for the transaction). Only one key must sign to delete the file, however. * *

To require more than one key to sign to delete a file, add them to a - * {@link com.hiero.sdk.KeyList} and pass that here. + * {@link org.hiero.sdk.KeyList} and pass that here. * *

The network currently requires a file to have at least one key (or key list or threshold key) * but this requirement may be lifted in the future. @@ -142,7 +142,7 @@ public ByteString getContents() { * *

Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the * network; if you exceed this you may receive a {@link PrecheckStatusException} - * with {@link com.hiero.sdk.Status#TRANSACTION_OVERSIZE}. + * with {@link org.hiero.sdk.Status#TRANSACTION_OVERSIZE}. * *

In this case, you can use {@link FileAppendTransaction}, which automatically breaks the contents * into chunks for you, to append contents of arbitrary size. @@ -168,7 +168,7 @@ public FileCreateTransaction setContents(byte[] bytes) { * *

Note that total size for a given transaction is limited to 6KiB (as of March 2020) by the * network; if you exceed this you may receive a {@link PrecheckStatusException} - * with {@link com.hiero.sdk.Status#TRANSACTION_OVERSIZE}. + * with {@link org.hiero.sdk.Status#TRANSACTION_OVERSIZE}. * *

In this case, you can use {@link FileAppendTransaction}, which automatically breaks the contents * into chunks for you, to append contents of arbitrary size. @@ -206,7 +206,7 @@ public FileCreateTransaction setFileMemo(String memo) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getCreateFileMethod(); } @@ -233,7 +233,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.FileCreateTransactionBody builder} + * @return {@link org.hiero.sdk.proto.FileCreateTransactionBody builder} */ FileCreateTransactionBody.Builder build() { var builder = FileCreateTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java similarity index 84% rename from sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java index b4ade447e7..36ece2e283 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileDeleteTransactionBody; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileDeleteTransactionBody; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -20,7 +20,7 @@ * will throw {@link PrecheckStatusException} with a status of {@link Status#FILE_DELETED}. * *

Only one of the file's keys needs to sign to delete the file, unless the key you have is part - * of a {@link com.hiero.sdk.KeyList}. + * of a {@link org.hiero.sdk.KeyList}. */ public final class FileDeleteTransaction extends Transaction { @@ -39,7 +39,7 @@ public FileDeleteTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileDeleteTransaction(LinkedHashMap> txs) + FileDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public FileDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - FileDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + FileDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -91,7 +91,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.FileDeleteTransactionBody builder} + * @return {@link org.hiero.sdk.proto.FileDeleteTransactionBody builder} */ FileDeleteTransactionBody.Builder build() { var builder = FileDeleteTransactionBody.newBuilder(); @@ -110,7 +110,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getDeleteFileMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/FileId.java b/sdk/src/main/java/org/hiero/sdk/FileId.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/FileId.java rename to sdk/src/main/java/org/hiero/sdk/FileId.java index 31f3c201e4..f51a116bf7 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileId.java +++ b/sdk/src/main/java/org/hiero/sdk/FileId.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileID; +import org.hiero.sdk.proto.FileID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/FileInfo.java b/sdk/src/main/java/org/hiero/sdk/FileInfo.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/FileInfo.java rename to sdk/src/main/java/org/hiero/sdk/FileInfo.java index 1790ca51fd..8ec912f564 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/FileInfo.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileGetInfoResponse; +import org.hiero.sdk.proto.FileGetInfoResponse; import java.time.Instant; import javax.annotation.Nullable; @@ -113,7 +113,7 @@ FileGetInfoResponse.FileInfo toProtobuf() { .setLedgerId(ledgerId.toByteString()); if (keys != null) { - var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); + var keyList = org.hiero.sdk.proto.KeyList.newBuilder(); for (Key key : keys) { keyList.addKeys(key.toProtobufKey()); diff --git a/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java similarity index 83% rename from sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java index 10f68ef9ab..e45bf5ef77 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.FileGetInfoQuery; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.FileGetInfoQuery; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -61,7 +61,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = FileGetInfoQuery.newBuilder(); if (fileId != null) { builder.setFileID(fileId.toProtobuf()); @@ -76,17 +76,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getFileGetInfo().getHeader(); } @Override - FileInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + FileInfo mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return FileInfo.fromProtobuf(response.getFileGetInfo().getFileInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getGetFileInfoMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java index fad3013ac4..38fbcf890f 100644 --- a/sdk/src/main/java/com/hiero/sdk/FileUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.FileUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.FileUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.nio.charset.StandardCharsets; import java.time.Instant; @@ -52,7 +52,7 @@ public FileUpdateTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FileUpdateTransaction(LinkedHashMap> txs) + FileUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -63,7 +63,7 @@ public FileUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - FileUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + FileUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -263,7 +263,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.FileUpdateTransactionBody builder } + * @return {@link org.hiero.sdk.proto.FileUpdateTransactionBody builder } */ FileUpdateTransactionBody.Builder build() { var builder = FileUpdateTransactionBody.newBuilder(); @@ -292,7 +292,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FileServiceGrpc.getUpdateFileMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java b/sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java rename to sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java index 4fb3126328..14a04c9af3 100644 --- a/sdk/src/main/java/com/hiero/sdk/FreezeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FreezeServiceGrpc; -import com.hiero.sdk.proto.FreezeTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FreezeServiceGrpc; +import org.hiero.sdk.proto.FreezeTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.time.OffsetTime; @@ -46,7 +46,7 @@ public FreezeTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - FreezeTransaction(LinkedHashMap> txs) + FreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -57,7 +57,7 @@ public FreezeTransaction() {} * * @param txBody protobuf TransactionBody */ - FreezeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + FreezeTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -218,7 +218,7 @@ public FreezeType getFreezeType() { /** * Assign the freeze type. - * {@link com.hiero.sdk.FreezeTransaction} + * {@link org.hiero.sdk.FreezeTransaction} * * @param freezeType the freeze type * @return {@code this} @@ -234,7 +234,7 @@ public FreezeTransaction setFreezeType(FreezeType freezeType) { void validateChecksums(Client client) {} @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return FreezeServiceGrpc.getFreezeMethod(); } @@ -256,7 +256,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.FreezeTransactionBody builder } + * @return {@link org.hiero.sdk.proto.FreezeTransactionBody builder } */ FreezeTransactionBody.Builder build() { var builder = FreezeTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/FreezeType.java b/sdk/src/main/java/org/hiero/sdk/FreezeType.java similarity index 78% rename from sdk/src/main/java/com/hiero/sdk/FreezeType.java rename to sdk/src/main/java/org/hiero/sdk/FreezeType.java index 1a1fe0bd87..fe05df3c1a 100644 --- a/sdk/src/main/java/com/hiero/sdk/FreezeType.java +++ b/sdk/src/main/java/org/hiero/sdk/FreezeType.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Enum for the freeze types. @@ -9,7 +9,7 @@ public enum FreezeType { * An (invalid) default value for this enum, to ensure the client explicitly sets * the intended type of freeze transaction. */ - UNKNOWN_FREEZE_TYPE(com.hiero.sdk.proto.FreezeType.UNKNOWN_FREEZE_TYPE), + UNKNOWN_FREEZE_TYPE(org.hiero.sdk.proto.FreezeType.UNKNOWN_FREEZE_TYPE), /** * Freezes the network at the specified time. The start_time field must be provided and @@ -17,39 +17,39 @@ public enum FreezeType { * fields will be ignored. This transaction does not perform any network changes or * upgrades and requires manual intervention to restart the network. */ - FREEZE_ONLY(com.hiero.sdk.proto.FreezeType.FREEZE_ONLY), + FREEZE_ONLY(org.hiero.sdk.proto.FreezeType.FREEZE_ONLY), /** * A non-freezing operation that initiates network wide preparation in advance of a * scheduled freeze upgrade. The update_file and file_hash fields must be provided and * valid. The start_time field may be omitted and any value present will be ignored. */ - PREPARE_UPGRADE(com.hiero.sdk.proto.FreezeType.PREPARE_UPGRADE), + PREPARE_UPGRADE(org.hiero.sdk.proto.FreezeType.PREPARE_UPGRADE), /** * Freezes the network at the specified time and performs the previously prepared * automatic upgrade across the entire network. */ - FREEZE_UPGRADE(com.hiero.sdk.proto.FreezeType.FREEZE_UPGRADE), + FREEZE_UPGRADE(org.hiero.sdk.proto.FreezeType.FREEZE_UPGRADE), /** * Aborts a pending network freeze operation. */ - FREEZE_ABORT(com.hiero.sdk.proto.FreezeType.FREEZE_ABORT), + FREEZE_ABORT(org.hiero.sdk.proto.FreezeType.FREEZE_ABORT), /** * Performs an immediate upgrade on auxilary services and containers providing * telemetry/metrics. Does not impact network operations. */ - TELEMETRY_UPGRADE(com.hiero.sdk.proto.FreezeType.TELEMETRY_UPGRADE); + TELEMETRY_UPGRADE(org.hiero.sdk.proto.FreezeType.TELEMETRY_UPGRADE); - final com.hiero.sdk.proto.FreezeType code; + final org.hiero.sdk.proto.FreezeType code; - FreezeType(com.hiero.sdk.proto.FreezeType code) { + FreezeType(org.hiero.sdk.proto.FreezeType code) { this.code = code; } - static FreezeType valueOf(com.hiero.sdk.proto.FreezeType code) { + static FreezeType valueOf(org.hiero.sdk.proto.FreezeType code) { return switch (code) { case UNKNOWN_FREEZE_TYPE -> UNKNOWN_FREEZE_TYPE; case FREEZE_ONLY -> FREEZE_ONLY; diff --git a/sdk/src/main/java/com/hiero/sdk/FutureConverter.java b/sdk/src/main/java/org/hiero/sdk/FutureConverter.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/FutureConverter.java rename to sdk/src/main/java/org/hiero/sdk/FutureConverter.java index e691b6be6c..eff4a8f4b9 100644 --- a/sdk/src/main/java/com/hiero/sdk/FutureConverter.java +++ b/sdk/src/main/java/org/hiero/sdk/FutureConverter.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; diff --git a/sdk/src/main/java/com/hiero/sdk/Hbar.java b/sdk/src/main/java/org/hiero/sdk/Hbar.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/Hbar.java rename to sdk/src/main/java/org/hiero/sdk/Hbar.java index 8110273588..a00ebf284c 100644 --- a/sdk/src/main/java/com/hiero/sdk/Hbar.java +++ b/sdk/src/main/java/org/hiero/sdk/Hbar.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.Splitter; import java.math.BigDecimal; @@ -42,7 +42,7 @@ public Hbar(long amount) { /** * Constructs a new hbar of the specified value in the specified unit. - * {@link com.hiero.sdk.HbarUnit} + * {@link org.hiero.sdk.HbarUnit} * * @param amount the amount * @param unit the unit for amount @@ -66,7 +66,7 @@ public Hbar(BigDecimal amount) { /** * Constructs a new hbar of the specified value in the specified unit. - * {@link com.hiero.sdk.HbarUnit} + * {@link org.hiero.sdk.HbarUnit} * * @param amount the amount * @param unit the unit for amount @@ -96,7 +96,7 @@ private static HbarUnit getUnit(String symbolString) { * Converts the provided string into an amount of hbars. * * @param text The string representing the amount of Hbar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar fromString(CharSequence text) { var matcher = FROM_STRING_PATTERN.matcher(text); @@ -113,7 +113,7 @@ public static Hbar fromString(CharSequence text) { * * @param text The string representing the amount of set units * @param unit The unit to convert from to Hbar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar fromString(CharSequence text, HbarUnit unit) { return new Hbar(new BigDecimal(text.toString()), unit); @@ -123,7 +123,7 @@ public static Hbar fromString(CharSequence text, HbarUnit unit) { * Returns an Hbar whose value is equal to the specified long. * * @param hbars The value of Hbar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar from(long hbars) { return new Hbar(hbars, HbarUnit.HBAR); @@ -134,7 +134,7 @@ public static Hbar from(long hbars) { * * @param amount The long representing the amount of set units * @param unit The unit to convert from to Hbar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar from(long amount, HbarUnit unit) { return new Hbar(amount, unit); @@ -144,7 +144,7 @@ public static Hbar from(long amount, HbarUnit unit) { * Returns an Hbar whose value is equal to the specified long. * * @param hbars The BigDecimal representing the amount of Hbar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar from(BigDecimal hbars) { return new Hbar(hbars, HbarUnit.HBAR); @@ -155,7 +155,7 @@ public static Hbar from(BigDecimal hbars) { * * @param amount The BigDecimal representing the amount of set units * @param unit The unit to convert from to Hbar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar from(BigDecimal amount, HbarUnit unit) { return new Hbar(amount, unit); @@ -165,7 +165,7 @@ public static Hbar from(BigDecimal amount, HbarUnit unit) { * Returns an Hbar converted from the specified number of tinybars. * * @param tinybars The long representing the amount of tinybar - * @return {@link com.hiero.sdk.Hbar} + * @return {@link org.hiero.sdk.Hbar} */ public static Hbar fromTinybars(long tinybars) { return new Hbar(tinybars, HbarUnit.TINYBAR); diff --git a/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java b/sdk/src/main/java/org/hiero/sdk/HbarAllowance.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/HbarAllowance.java rename to sdk/src/main/java/org/hiero/sdk/HbarAllowance.java index c35c49314e..cf92e16248 100644 --- a/sdk/src/main/java/com/hiero/sdk/HbarAllowance.java +++ b/sdk/src/main/java/org/hiero/sdk/HbarAllowance.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoAllowance; -import com.hiero.sdk.proto.GrantedCryptoAllowance; +import org.hiero.sdk.proto.CryptoAllowance; +import org.hiero.sdk.proto.GrantedCryptoAllowance; import java.util.Objects; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/HbarUnit.java b/sdk/src/main/java/org/hiero/sdk/HbarUnit.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/HbarUnit.java rename to sdk/src/main/java/org/hiero/sdk/HbarUnit.java index 428ef7f1f2..97bd8603c7 100644 --- a/sdk/src/main/java/com/hiero/sdk/HbarUnit.java +++ b/sdk/src/main/java/org/hiero/sdk/HbarUnit.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Common units of hbar; for the most part they follow SI prefix conventions. diff --git a/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java b/sdk/src/main/java/org/hiero/sdk/HederaPreCheckStatusException.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java rename to sdk/src/main/java/org/hiero/sdk/HederaPreCheckStatusException.java index 79b0be8b10..6f2bb85952 100644 --- a/sdk/src/main/java/com/hiero/sdk/HederaPreCheckStatusException.java +++ b/sdk/src/main/java/org/hiero/sdk/HederaPreCheckStatusException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java b/sdk/src/main/java/org/hiero/sdk/HederaReceiptStatusException.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java rename to sdk/src/main/java/org/hiero/sdk/HederaReceiptStatusException.java index a8fd715e27..9641814a04 100644 --- a/sdk/src/main/java/com/hiero/sdk/HederaReceiptStatusException.java +++ b/sdk/src/main/java/org/hiero/sdk/HederaReceiptStatusException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * An Exception thrown on error status by {@link TransactionId#getReceipt(Client)}. diff --git a/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java b/sdk/src/main/java/org/hiero/sdk/HederaTrustManager.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java rename to sdk/src/main/java/org/hiero/sdk/HederaTrustManager.java index 44a7dc6263..759e313ebe 100644 --- a/sdk/src/main/java/com/hiero/sdk/HederaTrustManager.java +++ b/sdk/src/main/java/org/hiero/sdk/HederaTrustManager.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import java.io.ByteArrayOutputStream; diff --git a/sdk/src/main/java/com/hiero/sdk/InstantConverter.java b/sdk/src/main/java/org/hiero/sdk/InstantConverter.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/InstantConverter.java rename to sdk/src/main/java/org/hiero/sdk/InstantConverter.java index 561f2a258f..855c49b883 100644 --- a/sdk/src/main/java/com/hiero/sdk/InstantConverter.java +++ b/sdk/src/main/java/org/hiero/sdk/InstantConverter.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TimestampSeconds; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TimestampSeconds; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/main/java/com/hiero/sdk/Key.java b/sdk/src/main/java/org/hiero/sdk/Key.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/Key.java rename to sdk/src/main/java/org/hiero/sdk/Key.java index a9152141b7..8abb8e66a8 100644 --- a/sdk/src/main/java/com/hiero/sdk/Key.java +++ b/sdk/src/main/java/org/hiero/sdk/Key.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import org.bouncycastle.asn1.ASN1ObjectIdentifier; @@ -32,7 +32,7 @@ public abstract class Key { * @param key the protobuf key of unknown type * @return the differentiated key */ - static Key fromProtobufKey(com.hiero.sdk.proto.Key key) { + static Key fromProtobufKey(org.hiero.sdk.proto.Key key) { switch (key.getKeyCase()) { case ED25519 -> { return PublicKeyED25519.fromBytesInternal(key.getEd25519().toByteArray()); @@ -68,7 +68,7 @@ static Key fromProtobufKey(com.hiero.sdk.proto.Key key) { /** * Serialize this key as a protobuf object */ - abstract com.hiero.sdk.proto.Key toProtobufKey(); + abstract org.hiero.sdk.proto.Key toProtobufKey(); /** * Create the byte array. @@ -87,6 +87,6 @@ public byte[] toBytes() { * @throws InvalidProtocolBufferException */ public static Key fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobufKey(com.hiero.sdk.proto.Key.parseFrom(bytes)); + return fromProtobufKey(org.hiero.sdk.proto.Key.parseFrom(bytes)); } } diff --git a/sdk/src/main/java/com/hiero/sdk/KeyList.java b/sdk/src/main/java/org/hiero/sdk/KeyList.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/KeyList.java rename to sdk/src/main/java/org/hiero/sdk/KeyList.java index 2c3fba5e89..191ef87266 100644 --- a/sdk/src/main/java/com/hiero/sdk/KeyList.java +++ b/sdk/src/main/java/org/hiero/sdk/KeyList.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hiero.sdk.proto.ThresholdKey; +import org.hiero.sdk.proto.ThresholdKey; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -78,7 +78,7 @@ public static KeyList withThreshold(int threshold) { * @param threshold the minimum number of keys that must sign * @return the key list */ - static KeyList fromProtobuf(com.hiero.sdk.proto.KeyList keyList, @Nullable Integer threshold) { + static KeyList fromProtobuf(org.hiero.sdk.proto.KeyList keyList, @Nullable Integer threshold) { var keys = (threshold != null ? new KeyList(threshold) : new KeyList()); for (var i = 0; i < keyList.getKeysCount(); ++i) { keys.add(Key.fromProtobufKey(keyList.getKeys(i))); @@ -175,20 +175,20 @@ public void clear() { } @Override - com.hiero.sdk.proto.Key toProtobufKey() { - var protoKeyList = com.hiero.sdk.proto.KeyList.newBuilder(); + org.hiero.sdk.proto.Key toProtobufKey() { + var protoKeyList = org.hiero.sdk.proto.KeyList.newBuilder(); for (var key : keys) { protoKeyList.addKeys(key.toProtobufKey()); } if (threshold != null) { - return com.hiero.sdk.proto.Key.newBuilder() + return org.hiero.sdk.proto.Key.newBuilder() .setThresholdKey( ThresholdKey.newBuilder().setThreshold(threshold).setKeys(protoKeyList)) .build(); } - return com.hiero.sdk.proto.Key.newBuilder().setKeyList(protoKeyList).build(); + return org.hiero.sdk.proto.Key.newBuilder().setKeyList(protoKeyList).build(); } /** @@ -196,8 +196,8 @@ com.hiero.sdk.proto.Key toProtobufKey() { * * @return the protobuf representation */ - com.hiero.sdk.proto.KeyList toProtobuf() { - var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); + org.hiero.sdk.proto.KeyList toProtobuf() { + var keyList = org.hiero.sdk.proto.KeyList.newBuilder(); for (Key key : keys) { keyList.addKeys(key.toProtobufKey()); diff --git a/sdk/src/main/java/com/hiero/sdk/Keystore.java b/sdk/src/main/java/org/hiero/sdk/Keystore.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Keystore.java rename to sdk/src/main/java/org/hiero/sdk/Keystore.java index 2b764be951..04af6246f6 100644 --- a/sdk/src/main/java/com/hiero/sdk/Keystore.java +++ b/sdk/src/main/java/org/hiero/sdk/Keystore.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.gson.Gson; import com.google.gson.JsonIOException; diff --git a/sdk/src/main/java/com/hiero/sdk/LedgerId.java b/sdk/src/main/java/org/hiero/sdk/LedgerId.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/LedgerId.java rename to sdk/src/main/java/org/hiero/sdk/LedgerId.java index 547a02273d..9cda165959 100644 --- a/sdk/src/main/java/com/hiero/sdk/LedgerId.java +++ b/sdk/src/main/java/org/hiero/sdk/LedgerId.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import java.util.Arrays; diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHash.java b/sdk/src/main/java/org/hiero/sdk/LiveHash.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/LiveHash.java rename to sdk/src/main/java/org/hiero/sdk/LiveHash.java index b262bc7510..f7412f5bf4 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHash.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHash.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; @@ -58,7 +58,7 @@ private LiveHash(AccountId accountId, ByteString hash, KeyList keys, Duration du * @param liveHash the protobuf * @return the new live hash */ - protected static LiveHash fromProtobuf(com.hiero.sdk.proto.LiveHash liveHash) { + protected static LiveHash fromProtobuf(org.hiero.sdk.proto.LiveHash liveHash) { return new LiveHash( AccountId.fromProtobuf(liveHash.getAccountId()), liveHash.getHash(), @@ -75,7 +75,7 @@ protected static LiveHash fromProtobuf(com.hiero.sdk.proto.LiveHash liveHash) { */ public static LiveHash fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.LiveHash.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.LiveHash.parseFrom(bytes).toBuilder().build()); } /** @@ -83,13 +83,13 @@ public static LiveHash fromBytes(byte[] bytes) throws InvalidProtocolBufferExcep * * @return the protobuf */ - protected com.hiero.sdk.proto.LiveHash toProtobuf() { - var keyList = com.hiero.sdk.proto.KeyList.newBuilder(); + protected org.hiero.sdk.proto.LiveHash toProtobuf() { + var keyList = org.hiero.sdk.proto.KeyList.newBuilder(); for (Key key : keys) { keyList.addKeys(key.toProtobufKey()); } - return com.hiero.sdk.proto.LiveHash.newBuilder() + return org.hiero.sdk.proto.LiveHash.newBuilder() .setAccountId(accountId.toProtobuf()) .setHash(hash) .setKeys(keyList) diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java b/sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java rename to sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java index 5d0cbadef8..148388ebcf 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHashAddTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoAddLiveHashTransactionBody; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.LiveHash; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoAddLiveHashTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.LiveHash; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.Arrays; @@ -46,7 +46,7 @@ public LiveHashAddTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - LiveHashAddTransaction(LinkedHashMap> txs) + LiveHashAddTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -178,7 +178,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.CryptoAddLiveHashTransactionBody} + * @return {@link org.hiero.sdk.proto.CryptoAddLiveHashTransactionBody} */ CryptoAddLiveHashTransactionBody.Builder build() { var builder = CryptoAddLiveHashTransactionBody.newBuilder(); @@ -205,7 +205,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getAddLiveHashMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java similarity index 89% rename from sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java index 12f223d6dc..26c96f2d96 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHashDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoDeleteLiveHashTransactionBody; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.CryptoDeleteLiveHashTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.LinkedHashMap; @@ -37,7 +37,7 @@ public LiveHashDeleteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ LiveHashDeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -113,7 +113,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.CryptoAddLiveHashTransactionBody} + * @return {@link org.hiero.sdk.proto.CryptoAddLiveHashTransactionBody} */ CryptoDeleteLiveHashTransactionBody.Builder build() { var builder = CryptoDeleteLiveHashTransactionBody.newBuilder(); @@ -133,7 +133,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getDeleteLiveHashMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java b/sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java similarity index 81% rename from sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java rename to sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java index 30eaf31e00..8034a59495 100644 --- a/sdk/src/main/java/com/hiero/sdk/LiveHashQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.CryptoGetLiveHashQuery; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.CryptoGetLiveHashQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.Objects; @@ -76,7 +76,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = CryptoGetLiveHashQuery.newBuilder(); if (accountId != null) { builder.setAccountID(accountId.toProtobuf()); @@ -87,7 +87,7 @@ void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader h } @Override - LiveHash mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + LiveHash mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return LiveHash.fromProtobuf(response.getCryptoGetLiveHash().getLiveHash()); } @@ -97,12 +97,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getCryptoGetLiveHash().getHeader(); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoGetBalanceMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/LockableList.java b/sdk/src/main/java/org/hiero/sdk/LockableList.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/LockableList.java rename to sdk/src/main/java/org/hiero/sdk/LockableList.java index 5750bf47c8..dd0522b3e5 100644 --- a/sdk/src/main/java/com/hiero/sdk/LockableList.java +++ b/sdk/src/main/java/org/hiero/sdk/LockableList.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.*; diff --git a/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java b/sdk/src/main/java/org/hiero/sdk/MaxAttemptsExceededException.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java rename to sdk/src/main/java/org/hiero/sdk/MaxAttemptsExceededException.java index cd31275cd4..15aaf00005 100644 --- a/sdk/src/main/java/com/hiero/sdk/MaxAttemptsExceededException.java +++ b/sdk/src/main/java/org/hiero/sdk/MaxAttemptsExceededException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java b/sdk/src/main/java/org/hiero/sdk/MaxQueryPaymentExceededException.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java rename to sdk/src/main/java/org/hiero/sdk/MaxQueryPaymentExceededException.java index f4aa8c362a..0295313620 100644 --- a/sdk/src/main/java/com/hiero/sdk/MaxQueryPaymentExceededException.java +++ b/sdk/src/main/java/org/hiero/sdk/MaxQueryPaymentExceededException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Signals that a query will cost more than a pre-configured maximum payment amount. diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java b/sdk/src/main/java/org/hiero/sdk/MirrorNetwork.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java rename to sdk/src/main/java/org/hiero/sdk/MirrorNetwork.java index 4f1c08e2c9..43f3a864fa 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNetwork.java +++ b/sdk/src/main/java/org/hiero/sdk/MirrorNetwork.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.ArrayList; import java.util.HashMap; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNode.java b/sdk/src/main/java/org/hiero/sdk/MirrorNode.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/MirrorNode.java rename to sdk/src/main/java/org/hiero/sdk/MirrorNode.java index d049f08ce5..328b33bafa 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNode.java +++ b/sdk/src/main/java/org/hiero/sdk/MirrorNode.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.concurrent.ExecutorService; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java b/sdk/src/main/java/org/hiero/sdk/MirrorNodeContractCallQuery.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java rename to sdk/src/main/java/org/hiero/sdk/MirrorNodeContractCallQuery.java index de2f3894fa..6b390ce974 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractCallQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/MirrorNodeContractCallQuery.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.concurrent.ExecutionException; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java b/sdk/src/main/java/org/hiero/sdk/MirrorNodeContractEstimateGasQuery.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java rename to sdk/src/main/java/org/hiero/sdk/MirrorNodeContractEstimateGasQuery.java index 361977f9f0..c941e53ecb 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractEstimateGasQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/MirrorNodeContractEstimateGasQuery.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.util.concurrent.ExecutionException; diff --git a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java b/sdk/src/main/java/org/hiero/sdk/MirrorNodeContractQuery.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java rename to sdk/src/main/java/org/hiero/sdk/MirrorNodeContractQuery.java index d633595772..5569275b51 100644 --- a/sdk/src/main/java/com/hiero/sdk/MirrorNodeContractQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/MirrorNodeContractQuery.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.EntityIdHelper.getContractAddressFromMirrorNodeAsync; -import static com.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; -import static com.hiero.sdk.EntityIdHelper.performQueryToMirrorNodeAsync; +import static org.hiero.sdk.EntityIdHelper.getContractAddressFromMirrorNodeAsync; +import static org.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; +import static org.hiero.sdk.EntityIdHelper.performQueryToMirrorNodeAsync; import com.google.gson.JsonObject; import com.google.gson.JsonParser; diff --git a/sdk/src/main/java/com/hiero/sdk/Mnemonic.java b/sdk/src/main/java/org/hiero/sdk/Mnemonic.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Mnemonic.java rename to sdk/src/main/java/org/hiero/sdk/Mnemonic.java index c4d158089f..63c3e9467d 100644 --- a/sdk/src/main/java/com/hiero/sdk/Mnemonic.java +++ b/sdk/src/main/java/org/hiero/sdk/Mnemonic.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.base.Joiner; -import com.hiero.sdk.utils.Bip32Utils; +import org.hiero.sdk.utils.Bip32Utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; diff --git a/sdk/src/main/java/com/hiero/sdk/Network.java b/sdk/src/main/java/org/hiero/sdk/Network.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Network.java rename to sdk/src/main/java/org/hiero/sdk/Network.java index 8131d61406..f807aef58b 100644 --- a/sdk/src/main/java/com/hiero/sdk/Network.java +++ b/sdk/src/main/java/org/hiero/sdk/Network.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.io.ByteStreams; import com.google.protobuf.ByteString; @@ -241,7 +241,7 @@ protected Node createNodeFromNetworkEntry(Map.Entry entry) { * Pick 1/3 of the nodes sorted by health and expected delay from the network. * This is used by Query and Transaction for selecting node AccountId's. * - * @return {@link java.util.List} + * @return {@link java.util.List} */ synchronized List getNodeAccountIdsForExecute() throws InterruptedException { var nodes = getNumberOfMostHealthyNodes(getNumberOfNodesForRequest()); diff --git a/sdk/src/main/java/com/hiero/sdk/NetworkName.java b/sdk/src/main/java/org/hiero/sdk/NetworkName.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/NetworkName.java rename to sdk/src/main/java/org/hiero/sdk/NetworkName.java index f6422acc4d..84353f3d6a 100644 --- a/sdk/src/main/java/com/hiero/sdk/NetworkName.java +++ b/sdk/src/main/java/org/hiero/sdk/NetworkName.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Enum for the network names. diff --git a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java b/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfo.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java rename to sdk/src/main/java/org/hiero/sdk/NetworkVersionInfo.java index 5d9e73f07c..24735ea175 100644 --- a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfo.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.NetworkGetVersionInfoResponse; +import org.hiero.sdk.proto.NetworkGetVersionInfoResponse; /** * Internal utility class. diff --git a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java similarity index 69% rename from sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java index ea7c12d746..d1067cb3fc 100644 --- a/sdk/src/main/java/com/hiero/sdk/NetworkVersionInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.NetworkGetVersionInfoQuery; -import com.hiero.sdk.proto.NetworkServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.NetworkGetVersionInfoQuery; +import org.hiero.sdk.proto.NetworkServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; /** @@ -18,7 +18,7 @@ public class NetworkVersionInfoQuery extends Query getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return NetworkServiceGrpc.getGetVersionInfoMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/NftId.java b/sdk/src/main/java/org/hiero/sdk/NftId.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/NftId.java rename to sdk/src/main/java/org/hiero/sdk/NftId.java index 7e733d0343..00c176b77f 100644 --- a/sdk/src/main/java/com/hiero/sdk/NftId.java +++ b/sdk/src/main/java/org/hiero/sdk/NftId.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.NftID; +import org.hiero.sdk.proto.NftID; import java.util.Objects; import javax.annotation.Nonnegative; diff --git a/sdk/src/main/java/com/hiero/sdk/Node.java b/sdk/src/main/java/org/hiero/sdk/Node.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Node.java rename to sdk/src/main/java/org/hiero/sdk/Node.java index 1f4eedcf80..779f329ae7 100644 --- a/sdk/src/main/java/com/hiero/sdk/Node.java +++ b/sdk/src/main/java/org/hiero/sdk/Node.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import io.grpc.ChannelCredentials; import io.grpc.TlsChannelCredentials; diff --git a/sdk/src/main/java/com/hiero/sdk/NodeAddress.java b/sdk/src/main/java/org/hiero/sdk/NodeAddress.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/NodeAddress.java rename to sdk/src/main/java/org/hiero/sdk/NodeAddress.java index 7c4f3bf192..454e6bbf84 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeAddress.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeAddress.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ServiceEndpoint; +import org.hiero.sdk.proto.ServiceEndpoint; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; @@ -60,7 +60,7 @@ public class NodeAddress implements Cloneable { * @param nodeAddress the protobuf * @return the new node */ - static NodeAddress fromProtobuf(com.hiero.sdk.proto.NodeAddress nodeAddress) { + static NodeAddress fromProtobuf(org.hiero.sdk.proto.NodeAddress nodeAddress) { var address = new ArrayList(nodeAddress.getServiceEndpointCount()); if (!nodeAddress.getIpAddress().isEmpty()) { @@ -247,8 +247,8 @@ public NodeAddress setStake(long stake) { * * @return the protobuf representation. */ - com.hiero.sdk.proto.NodeAddress toProtobuf() { - var builder = com.hiero.sdk.proto.NodeAddress.newBuilder().setNodeId(nodeId); + org.hiero.sdk.proto.NodeAddress toProtobuf() { + var builder = org.hiero.sdk.proto.NodeAddress.newBuilder().setNodeId(nodeId); if (certHash != null) { builder.setNodeCertHash(certHash); diff --git a/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java b/sdk/src/main/java/org/hiero/sdk/NodeAddressBook.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java rename to sdk/src/main/java/org/hiero/sdk/NodeAddressBook.java index 3de2dcc304..c481173a0d 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeAddressBook.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeAddressBook.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; @@ -55,7 +55,7 @@ static List cloneNodeAddresses(List addresses) { * @param book the protobuf * @return the new node address book */ - static NodeAddressBook fromProtobuf(com.hiero.sdk.proto.NodeAddressBook book) { + static NodeAddressBook fromProtobuf(org.hiero.sdk.proto.NodeAddressBook book) { var addresses = new ArrayList(book.getNodeAddressCount()); for (var address : book.getNodeAddressList()) { @@ -73,7 +73,7 @@ static NodeAddressBook fromProtobuf(com.hiero.sdk.proto.NodeAddressBook book) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static NodeAddressBook fromBytes(ByteString bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.NodeAddressBook.parseFrom(bytes)); + return fromProtobuf(org.hiero.sdk.proto.NodeAddressBook.parseFrom(bytes)); } /** @@ -81,8 +81,8 @@ public static NodeAddressBook fromBytes(ByteString bytes) throws InvalidProtocol * * @return the protobuf representation */ - com.hiero.sdk.proto.NodeAddressBook toProtobuf() { - var builder = com.hiero.sdk.proto.NodeAddressBook.newBuilder(); + org.hiero.sdk.proto.NodeAddressBook toProtobuf() { + var builder = org.hiero.sdk.proto.NodeAddressBook.newBuilder(); for (var nodeAdress : nodeAddresses) { builder.addNodeAddress(nodeAdress.toProtobuf()); diff --git a/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java index 7dde35a9ce..e25c01aae8 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AddressBookServiceGrpc; -import com.hiero.sdk.proto.NodeCreateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.AddressBookServiceGrpc; +import org.hiero.sdk.proto.NodeCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -144,7 +144,7 @@ public NodeCreateTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - NodeCreateTransaction(LinkedHashMap> txs) + NodeCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -155,7 +155,7 @@ public NodeCreateTransaction() {} * * @param txBody protobuf TransactionBody */ - NodeCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + NodeCreateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -327,7 +327,7 @@ public NodeCreateTransaction setAdminKey(Key adminKey) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.NodeCreateTransactionBody} + * @return {@link org.hiero.sdk.proto.NodeCreateTransactionBody} */ NodeCreateTransactionBody.Builder build() { var builder = NodeCreateTransactionBody.newBuilder(); @@ -400,7 +400,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return AddressBookServiceGrpc.getCreateNodeMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java similarity index 88% rename from sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java index c2ea1044a4..c27047b373 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AddressBookServiceGrpc; -import com.hiero.sdk.proto.NodeDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.AddressBookServiceGrpc; +import org.hiero.sdk.proto.NodeDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -50,7 +50,7 @@ public NodeDeleteTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - NodeDeleteTransaction(LinkedHashMap> txs) + NodeDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -88,7 +88,7 @@ public NodeDeleteTransaction setNodeId(long nodeId) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.NodeDeleteTransactionBody} + * @return {@link org.hiero.sdk.proto.NodeDeleteTransactionBody} */ NodeDeleteTransactionBody.Builder build() { var builder = NodeDeleteTransactionBody.newBuilder(); @@ -110,7 +110,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return AddressBookServiceGrpc.getDeleteNodeMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java index 88c595e187..e2c52907eb 100644 --- a/sdk/src/main/java/com/hiero/sdk/NodeUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.AddressBookServiceGrpc; -import com.hiero.sdk.proto.NodeUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.AddressBookServiceGrpc; +import org.hiero.sdk.proto.NodeUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -171,7 +171,7 @@ public NodeUpdateTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - NodeUpdateTransaction(LinkedHashMap> txs) + NodeUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -182,7 +182,7 @@ public NodeUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - NodeUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + NodeUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -384,7 +384,7 @@ public NodeUpdateTransaction setAdminKey(Key adminKey) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.NodeUpdateTransactionBody} + * @return {@link org.hiero.sdk.proto.NodeUpdateTransactionBody} */ NodeUpdateTransactionBody.Builder build() { var builder = NodeUpdateTransactionBody.newBuilder(); @@ -467,7 +467,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return AddressBookServiceGrpc.getUpdateNodeMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/Pem.java b/sdk/src/main/java/org/hiero/sdk/Pem.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Pem.java rename to sdk/src/main/java/org/hiero/sdk/Pem.java index 6284d11c4f..7dd81d74e7 100644 --- a/sdk/src/main/java/com/hiero/sdk/Pem.java +++ b/sdk/src/main/java/org/hiero/sdk/Pem.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.io.IOException; import java.io.Reader; diff --git a/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java b/sdk/src/main/java/org/hiero/sdk/PendingAirdropId.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java rename to sdk/src/main/java/org/hiero/sdk/PendingAirdropId.java index 731ffe0db6..735b84170b 100644 --- a/sdk/src/main/java/com/hiero/sdk/PendingAirdropId.java +++ b/sdk/src/main/java/org/hiero/sdk/PendingAirdropId.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import javax.annotation.Nonnull; @@ -74,7 +74,7 @@ public PendingAirdropId setNftId(@Nullable NftId nftId) { return this; } - static PendingAirdropId fromProtobuf(com.hiero.sdk.proto.PendingAirdropId pendingAirdropId) { + static PendingAirdropId fromProtobuf(org.hiero.sdk.proto.PendingAirdropId pendingAirdropId) { if (pendingAirdropId.hasFungibleTokenType()) { return new PendingAirdropId( AccountId.fromProtobuf(pendingAirdropId.getSenderId()), @@ -88,8 +88,8 @@ static PendingAirdropId fromProtobuf(com.hiero.sdk.proto.PendingAirdropId pendin } } - com.hiero.sdk.proto.PendingAirdropId toProtobuf() { - var builder = com.hiero.sdk.proto.PendingAirdropId.newBuilder() + org.hiero.sdk.proto.PendingAirdropId toProtobuf() { + var builder = org.hiero.sdk.proto.PendingAirdropId.newBuilder() .setSenderId(sender.toProtobuf()) .setReceiverId(receiver.toProtobuf()); diff --git a/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java b/sdk/src/main/java/org/hiero/sdk/PendingAirdropLogic.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java rename to sdk/src/main/java/org/hiero/sdk/PendingAirdropLogic.java index 740a20cdf9..48bfd80de0 100644 --- a/sdk/src/main/java/com/hiero/sdk/PendingAirdropLogic.java +++ b/sdk/src/main/java/org/hiero/sdk/PendingAirdropLogic.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; @@ -19,7 +19,7 @@ protected PendingAirdropLogic() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - PendingAirdropLogic(LinkedHashMap> txs) + PendingAirdropLogic(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); } @@ -29,7 +29,7 @@ protected PendingAirdropLogic() {} * * @param txBody protobuf TransactionBody */ - PendingAirdropLogic(com.hiero.sdk.proto.TransactionBody txBody) { + PendingAirdropLogic(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); } diff --git a/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java b/sdk/src/main/java/org/hiero/sdk/PendingAirdropRecord.java similarity index 83% rename from sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java rename to sdk/src/main/java/org/hiero/sdk/PendingAirdropRecord.java index 576e453578..c356c5eece 100644 --- a/sdk/src/main/java/com/hiero/sdk/PendingAirdropRecord.java +++ b/sdk/src/main/java/org/hiero/sdk/PendingAirdropRecord.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hiero.sdk.proto.PendingAirdropValue; +import org.hiero.sdk.proto.PendingAirdropValue; public class PendingAirdropRecord { private final PendingAirdropId pendingAirdropId; @@ -21,14 +21,14 @@ public long getPendingAirdropAmount() { return pendingAirdropAmount; } - com.hiero.sdk.proto.PendingAirdropRecord toProtobuf() { - return com.hiero.sdk.proto.PendingAirdropRecord.newBuilder() + org.hiero.sdk.proto.PendingAirdropRecord toProtobuf() { + return org.hiero.sdk.proto.PendingAirdropRecord.newBuilder() .setPendingAirdropId(this.pendingAirdropId.toProtobuf()) .setPendingAirdropValue(PendingAirdropValue.newBuilder().setAmount(pendingAirdropAmount)) .build(); } - static PendingAirdropRecord fromProtobuf(com.hiero.sdk.proto.PendingAirdropRecord pendingAirdropRecord) { + static PendingAirdropRecord fromProtobuf(org.hiero.sdk.proto.PendingAirdropRecord pendingAirdropRecord) { return new PendingAirdropRecord( PendingAirdropId.fromProtobuf(pendingAirdropRecord.getPendingAirdropId()), pendingAirdropRecord.getPendingAirdropValue().getAmount()); diff --git a/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java b/sdk/src/main/java/org/hiero/sdk/PrecheckStatusException.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java rename to sdk/src/main/java/org/hiero/sdk/PrecheckStatusException.java index 0133f4d656..7984da2a88 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrecheckStatusException.java +++ b/sdk/src/main/java/org/hiero/sdk/PrecheckStatusException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/PrivateKey.java b/sdk/src/main/java/org/hiero/sdk/PrivateKey.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/PrivateKey.java rename to sdk/src/main/java/org/hiero/sdk/PrivateKey.java index 3376dcf714..11cdf12bde 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrivateKey.java +++ b/sdk/src/main/java/org/hiero/sdk/PrivateKey.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.io.IOException; import java.io.Reader; @@ -232,7 +232,7 @@ private static PrivateKey fromPrivateKeyInfo(PrivateKeyInfo privateKeyInfo) { * This will read the first "PRIVATE KEY" section in the stream as an Ed25519 private key. * * @param pemFile The Reader containing the pem file - * @return {@link com.hiero.sdk.PrivateKey} + * @return {@link org.hiero.sdk.PrivateKey} * @throws IOException if one occurred while reading. * @throws BadKeyException if no "PRIVATE KEY" section was found or the key was not an Ed25519 * private key. @@ -262,7 +262,7 @@ public static PrivateKey readPem(Reader pemFile) throws IOException { * * @param pemFile the PEM encoded file * @param password the password to decrypt the PEM file; if null or empty, no decryption is performed. - * @return {@link com.hiero.sdk.PrivateKey} + * @return {@link org.hiero.sdk.PrivateKey} * @throws IOException if one occurred while reading the PEM file * @throws BadKeyException if no "ENCRYPTED PRIVATE KEY" or "PRIVATE KEY" section was found, * if the passphrase is wrong or the key was not an Ed25519 private key. @@ -275,7 +275,7 @@ public static PrivateKey readPem(Reader pemFile, @Nullable String password) thro * Parse a private key from a PEM encoded string. * * @param pemEncoded The String containing the pem - * @return {@link com.hiero.sdk.PrivateKey} + * @return {@link org.hiero.sdk.PrivateKey} * @throws IOException if the PEM string was improperly encoded * @throws BadKeyException if no "PRIVATE KEY" section was found or the key was not an Ed25519 * private key. @@ -292,7 +292,7 @@ public static PrivateKey fromPem(String pemEncoded) throws IOException { * * @param encodedPem the encoded PEM string * @param password the password to decrypt the PEM file; if null or empty, no decryption is performed. - * @return {@link com.hiero.sdk.PrivateKey} + * @return {@link org.hiero.sdk.PrivateKey} * @throws IOException if the PEM string was improperly encoded * @throws BadKeyException if no "ENCRYPTED PRIVATE KEY" or "PRIVATE KEY" section was found, * if the passphrase is wrong or the key was not an Ed25519 private key. @@ -432,7 +432,7 @@ public AccountId toAccountId(@Nonnegative long shard, @Nonnegative long realm) { } @Override - com.hiero.sdk.proto.Key toProtobufKey() { + org.hiero.sdk.proto.Key toProtobufKey() { // Forward to the corresponding public key. return getPublicKey().toProtobufKey(); } diff --git a/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java b/sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java rename to sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java index e71c1b7e12..17886ad428 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrivateKeyECDSA.java +++ b/sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.utils.Bip32Utils; +import org.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; diff --git a/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java b/sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java rename to sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java index bca6b70608..13c201a45a 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrivateKeyED25519.java +++ b/sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.utils.Bip32Utils; +import org.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java b/sdk/src/main/java/org/hiero/sdk/PrngTransaction.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/PrngTransaction.java rename to sdk/src/main/java/org/hiero/sdk/PrngTransaction.java index 0e2b848837..c24cb94f27 100644 --- a/sdk/src/main/java/com/hiero/sdk/PrngTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/PrngTransaction.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.*; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.*; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; @@ -67,7 +67,7 @@ void onScheduled(SchedulableTransactionBody.Builder scheduled) { void validateChecksums(Client client) throws BadEntityIdException {} @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return UtilServiceGrpc.getPrngMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java b/sdk/src/main/java/org/hiero/sdk/ProxyStaker.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/ProxyStaker.java rename to sdk/src/main/java/org/hiero/sdk/ProxyStaker.java index 91d20be6b8..c9641a59bb 100644 --- a/sdk/src/main/java/com/hiero/sdk/ProxyStaker.java +++ b/sdk/src/main/java/org/hiero/sdk/ProxyStaker.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Information about a single account that is proxy staking. @@ -32,7 +32,7 @@ private ProxyStaker(AccountId accountId, long amount) { * @param proxyStaker the protobuf * @return the new proxy staker object */ - static ProxyStaker fromProtobuf(com.hiero.sdk.proto.ProxyStaker proxyStaker) { + static ProxyStaker fromProtobuf(org.hiero.sdk.proto.ProxyStaker proxyStaker) { return new ProxyStaker(AccountId.fromProtobuf(proxyStaker.getAccountID()), proxyStaker.getAmount()); } diff --git a/sdk/src/main/java/com/hiero/sdk/PublicKey.java b/sdk/src/main/java/org/hiero/sdk/PublicKey.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/PublicKey.java rename to sdk/src/main/java/org/hiero/sdk/PublicKey.java index 938146346f..efefae8db8 100644 --- a/sdk/src/main/java/com/hiero/sdk/PublicKey.java +++ b/sdk/src/main/java/org/hiero/sdk/PublicKey.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SignaturePair; +import org.hiero.sdk.proto.SignaturePair; import javax.annotation.Nonnegative; import javax.annotation.Nullable; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; @@ -133,7 +133,7 @@ private static PublicKey fromSubjectKeyInfo(SubjectPublicKeyInfo subjectPublicKe static PublicKey fromAliasBytes(ByteString aliasBytes) { if (!aliasBytes.isEmpty()) { try { - var key = Key.fromProtobufKey(com.hiero.sdk.proto.Key.parseFrom(aliasBytes)); + var key = Key.fromProtobufKey(org.hiero.sdk.proto.Key.parseFrom(aliasBytes)); return (key instanceof PublicKey) ? ((PublicKey) key) : null; } catch (InvalidProtocolBufferException ignored) { } diff --git a/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java b/sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java rename to sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java index 1133c5d3df..c1fc712229 100644 --- a/sdk/src/main/java/com/hiero/sdk/PublicKeyECDSA.java +++ b/sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.Crypto.calcKeccak256; +import static org.hiero.sdk.Crypto.calcKeccak256; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.SignaturePair; +import org.hiero.sdk.proto.SignaturePair; import java.io.IOException; import java.math.BigInteger; import java.util.Arrays; @@ -82,8 +82,8 @@ public boolean verify(byte[] message, byte[] signature) { } @Override - com.hiero.sdk.proto.Key toProtobufKey() { - return com.hiero.sdk.proto.Key.newBuilder() + org.hiero.sdk.proto.Key toProtobufKey() { + return org.hiero.sdk.proto.Key.newBuilder() .setECDSASecp256K1(ByteString.copyFrom(keyData)) .build(); } diff --git a/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java b/sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java rename to sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java index 6a320a66a6..32e4067cf7 100644 --- a/sdk/src/main/java/com/hiero/sdk/PublicKeyED25519.java +++ b/sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.SignaturePair; +import org.hiero.sdk.proto.SignaturePair; import java.io.IOException; import java.util.Arrays; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; @@ -67,8 +67,8 @@ public boolean verify(byte[] message, byte[] signature) { } @Override - com.hiero.sdk.proto.Key toProtobufKey() { - return com.hiero.sdk.proto.Key.newBuilder() + org.hiero.sdk.proto.Key toProtobufKey() { + return org.hiero.sdk.proto.Key.newBuilder() .setEd25519(ByteString.copyFrom(keyData)) .build(); } diff --git a/sdk/src/main/java/com/hiero/sdk/Query.java b/sdk/src/main/java/org/hiero/sdk/Query.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/Query.java rename to sdk/src/main/java/org/hiero/sdk/Query.java index 66355fe9c4..8b26e40aa1 100644 --- a/sdk/src/main/java/com/hiero/sdk/Query.java +++ b/sdk/src/main/java/org/hiero/sdk/Query.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.ResponseType; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.ResponseType; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -28,8 +28,8 @@ * @param The output type of the query. * @param The type of the query itself. Used to enable chaining. */ -public abstract class Query> extends Executable { - private final com.hiero.sdk.proto.Query.Builder builder; +public abstract class Query> extends Executable { + private final org.hiero.sdk.proto.Query.Builder builder; private final QueryHeader.Builder headerBuilder; @@ -61,7 +61,7 @@ public abstract class Query> extends Executable { void validateChecksums(Client client) throws BadEntityIdException {} @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { headerBuilder.setResponseType(ResponseType.COST_ANSWER); // COST_ANSWER requires a payment to pass validation but doesn't actually process it @@ -546,17 +546,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return Query.this.mapRequestHeader(request); } @Override - Hbar mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + Hbar mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return Hbar.fromTinybars(mapResponseHeader(response).getCost()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return Query.this.getMethodDescriptor(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java b/sdk/src/main/java/org/hiero/sdk/ReceiptStatusException.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java rename to sdk/src/main/java/org/hiero/sdk/ReceiptStatusException.java index 6f7771fe76..5def0e1a6d 100644 --- a/sdk/src/main/java/com/hiero/sdk/ReceiptStatusException.java +++ b/sdk/src/main/java/org/hiero/sdk/ReceiptStatusException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/RequestType.java b/sdk/src/main/java/org/hiero/sdk/RequestType.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/RequestType.java rename to sdk/src/main/java/org/hiero/sdk/RequestType.java index 6c83157a31..62f078855e 100644 --- a/sdk/src/main/java/com/hiero/sdk/RequestType.java +++ b/sdk/src/main/java/org/hiero/sdk/RequestType.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.HederaFunctionality; +import org.hiero.sdk.proto.HederaFunctionality; /** * Enum for the request types. diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java index c17a1827d2..b3b17bf294 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.ScheduleCreateTransactionBody; -import com.hiero.sdk.proto.ScheduleServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ScheduleCreateTransactionBody; +import org.hiero.sdk.proto.ScheduleServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.util.LinkedHashMap; @@ -50,7 +50,7 @@ public ScheduleCreateTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ ScheduleCreateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -214,7 +214,7 @@ public ScheduleCreateTransaction setScheduleMemo(String memo) { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.ScheduleCreateTransactionBody builder } + * @return {@link org.hiero.sdk.proto.ScheduleCreateTransactionBody builder } */ ScheduleCreateTransactionBody.Builder build() { var builder = ScheduleCreateTransactionBody.newBuilder(); @@ -262,7 +262,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ScheduleServiceGrpc.getCreateScheduleMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java similarity index 85% rename from sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java index 330b2e684a..6487fcbd5a 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.ScheduleDeleteTransactionBody; -import com.hiero.sdk.proto.ScheduleServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ScheduleDeleteTransactionBody; +import org.hiero.sdk.proto.ScheduleServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -37,7 +37,7 @@ public ScheduleDeleteTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ ScheduleDeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -48,7 +48,7 @@ public ScheduleDeleteTransaction() { * * @param txBody protobuf TransactionBody */ - ScheduleDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + ScheduleDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -89,7 +89,7 @@ void initFromTransactionBody() { /** * Build the correct transaction body. * - * @return {@link com.hiero.sdk.proto.ScheduleDeleteTransactionBody builder } + * @return {@link org.hiero.sdk.proto.ScheduleDeleteTransactionBody builder } */ ScheduleDeleteTransactionBody.Builder build() { var builder = ScheduleDeleteTransactionBody.newBuilder(); @@ -108,7 +108,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ScheduleServiceGrpc.getDeleteScheduleMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleId.java b/sdk/src/main/java/org/hiero/sdk/ScheduleId.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/ScheduleId.java rename to sdk/src/main/java/org/hiero/sdk/ScheduleId.java index 76473dba84..117b130bc0 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleId.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleId.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ScheduleID; +import org.hiero.sdk.proto.ScheduleID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java b/sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java rename to sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java index 0a236f33f8..e216977a61 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import java.time.Instant; import javax.annotation.Nullable; @@ -144,7 +144,7 @@ public final class ScheduleInfo { * @param info the protobuf * @return the new schedule info object */ - static ScheduleInfo fromProtobuf(com.hiero.sdk.proto.ScheduleInfo info) { + static ScheduleInfo fromProtobuf(org.hiero.sdk.proto.ScheduleInfo info) { var scheduleId = ScheduleId.fromProtobuf(info.getScheduleID()); var creatorAccountId = AccountId.fromProtobuf(info.getCreatorAccountID()); var payerAccountId = AccountId.fromProtobuf(info.getPayerAccountID()); @@ -177,7 +177,7 @@ static ScheduleInfo fromProtobuf(com.hiero.sdk.proto.ScheduleInfo info) { */ public static ScheduleInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { return fromProtobuf( - com.hiero.sdk.proto.ScheduleInfo.parseFrom(bytes).toBuilder().build()); + org.hiero.sdk.proto.ScheduleInfo.parseFrom(bytes).toBuilder().build()); } /** @@ -185,8 +185,8 @@ public static ScheduleInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferE * * @return the protobuf representation */ - com.hiero.sdk.proto.ScheduleInfo toProtobuf() { - var info = com.hiero.sdk.proto.ScheduleInfo.newBuilder(); + org.hiero.sdk.proto.ScheduleInfo toProtobuf() { + var info = org.hiero.sdk.proto.ScheduleInfo.newBuilder(); if (adminKey != null) { info.setAdminKey(adminKey.toProtobufKey()); diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java similarity index 84% rename from sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java index 9d684eb48b..28fb3909f2 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Query; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.ScheduleGetInfoQuery; -import com.hiero.sdk.proto.ScheduleServiceGrpc; +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.ScheduleGetInfoQuery; +import org.hiero.sdk.proto.ScheduleServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -18,7 +18,7 @@ * * See Hedera Documentation */ -public class ScheduleInfoQuery extends com.hiero.sdk.Query { +public class ScheduleInfoQuery extends org.hiero.sdk.Query { @Nullable private ScheduleId scheduleId = null; @@ -57,7 +57,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ScheduleGetInfoQuery.newBuilder(); if (scheduleId != null) { builder.setScheduleID(scheduleId.toProtobuf()); @@ -72,7 +72,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getScheduleGetInfo().getHeader(); } diff --git a/sdk/src/main/java/com/hiero/sdk/ScheduleSignTransaction.java b/sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java similarity index 89% rename from sdk/src/main/java/com/hiero/sdk/ScheduleSignTransaction.java rename to sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java index 530aa27122..b50e3f704c 100644 --- a/sdk/src/main/java/com/hiero/sdk/ScheduleSignTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.ScheduleServiceGrpc; -import com.hiero.sdk.proto.ScheduleSignTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ScheduleServiceGrpc; +import org.hiero.sdk.proto.ScheduleSignTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -44,7 +44,7 @@ public ScheduleSignTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - ScheduleSignTransaction(LinkedHashMap> txs) + ScheduleSignTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -89,7 +89,7 @@ public ScheduleSignTransaction clearScheduleId() { * Build the correct transaction body. * * @return {@link - * com.hiero.sdk.proto.ScheduleSignTransactionBody + * org.hiero.sdk.proto.ScheduleSignTransactionBody * builder } */ ScheduleSignTransactionBody.Builder build() { @@ -119,7 +119,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ScheduleServiceGrpc.getSignScheduleMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java b/sdk/src/main/java/org/hiero/sdk/SemanticVersion.java similarity index 89% rename from sdk/src/main/java/com/hiero/sdk/SemanticVersion.java rename to sdk/src/main/java/org/hiero/sdk/SemanticVersion.java index 7d2c5b47af..eeacb7e9cd 100644 --- a/sdk/src/main/java/com/hiero/sdk/SemanticVersion.java +++ b/sdk/src/main/java/org/hiero/sdk/SemanticVersion.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; @@ -44,7 +44,7 @@ public class SemanticVersion { * @param version the protobuf * @return the new semantic version */ - protected static SemanticVersion fromProtobuf(com.hiero.sdk.proto.SemanticVersion version) { + protected static SemanticVersion fromProtobuf(org.hiero.sdk.proto.SemanticVersion version) { return new SemanticVersion(version.getMajor(), version.getMinor(), version.getPatch()); } @@ -56,7 +56,7 @@ protected static SemanticVersion fromProtobuf(com.hiero.sdk.proto.SemanticVersio * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static SemanticVersion fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.SemanticVersion.parseFrom(bytes)); + return fromProtobuf(org.hiero.sdk.proto.SemanticVersion.parseFrom(bytes)); } /** @@ -64,8 +64,8 @@ public static SemanticVersion fromBytes(byte[] bytes) throws InvalidProtocolBuff * * @return the protobuf representation */ - protected com.hiero.sdk.proto.SemanticVersion toProtobuf() { - return com.hiero.sdk.proto.SemanticVersion.newBuilder() + protected org.hiero.sdk.proto.SemanticVersion toProtobuf() { + return org.hiero.sdk.proto.SemanticVersion.newBuilder() .setMajor(major) .setMinor(minor) .setPatch(patch) diff --git a/sdk/src/main/java/com/hiero/sdk/StakingInfo.java b/sdk/src/main/java/org/hiero/sdk/StakingInfo.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/StakingInfo.java rename to sdk/src/main/java/org/hiero/sdk/StakingInfo.java index dee352347c..01db174895 100644 --- a/sdk/src/main/java/com/hiero/sdk/StakingInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/StakingInfo.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -66,7 +66,7 @@ public StakingInfo( this.stakedNodeId = stakedNodeId; } - static StakingInfo fromProtobuf(com.hiero.sdk.proto.StakingInfo info) { + static StakingInfo fromProtobuf(org.hiero.sdk.proto.StakingInfo info) { return new StakingInfo( info.getDeclineReward(), InstantConverter.fromProtobuf(info.getStakePeriodStart()), @@ -84,11 +84,11 @@ static StakingInfo fromProtobuf(com.hiero.sdk.proto.StakingInfo info) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static StakingInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.StakingInfo.parseFrom(bytes)); + return fromProtobuf(org.hiero.sdk.proto.StakingInfo.parseFrom(bytes)); } - com.hiero.sdk.proto.StakingInfo toProtobuf() { - var builder = com.hiero.sdk.proto.StakingInfo.newBuilder() + org.hiero.sdk.proto.StakingInfo toProtobuf() { + var builder = org.hiero.sdk.proto.StakingInfo.newBuilder() .setDeclineReward(declineStakingReward) .setStakePeriodStart(InstantConverter.toProtobuf(stakePeriodStart)) .setPendingReward(pendingReward.toTinybars()) diff --git a/sdk/src/main/java/com/hiero/sdk/Status.java b/sdk/src/main/java/org/hiero/sdk/Status.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/Status.java rename to sdk/src/main/java/org/hiero/sdk/Status.java index 7978e2cccd..502989f4b9 100644 --- a/sdk/src/main/java/com/hiero/sdk/Status.java +++ b/sdk/src/main/java/org/hiero/sdk/Status.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.ResponseCodeEnum; import java.util.Objects; /** diff --git a/sdk/src/main/java/com/hiero/sdk/StorageChange.java b/sdk/src/main/java/org/hiero/sdk/StorageChange.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/StorageChange.java rename to sdk/src/main/java/org/hiero/sdk/StorageChange.java index bad930b3fa..291b73e93d 100644 --- a/sdk/src/main/java/com/hiero/sdk/StorageChange.java +++ b/sdk/src/main/java/org/hiero/sdk/StorageChange.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.math.BigInteger; import javax.annotation.Nullable; @@ -50,7 +50,7 @@ public class StorageChange { // * @param storageChangeProto the protobuf // * @return the new storage charge object // */ - // static StorageChange fromProtobuf(com.hiero.sdk.proto.StorageChange storageChangeProto) { + // static StorageChange fromProtobuf(org.hiero.sdk.proto.StorageChange storageChangeProto) { // return new StorageChange( // new BigInteger(storageChangeProto.getSlot().toByteArray()), // new BigInteger(storageChangeProto.getValueRead().toByteArray()), @@ -70,7 +70,7 @@ public class StorageChange { // * @throws InvalidProtocolBufferException when there is an issue with the protobuf // */ // public static StorageChange fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - // return fromProtobuf(com.hiero.sdk.proto.StorageChange.parseFrom(bytes)); + // return fromProtobuf(org.hiero.sdk.proto.StorageChange.parseFrom(bytes)); // } // // /** @@ -78,8 +78,8 @@ public class StorageChange { // * // * @return the byte array representation // */ - // com.hiero.sdk.proto.StorageChange toProtobuf() { - // var builder = com.hiero.sdk.proto.StorageChange.newBuilder() + // org.hiero.sdk.proto.StorageChange toProtobuf() { + // var builder = org.hiero.sdk.proto.StorageChange.newBuilder() // .setSlot(ByteString.copyFrom(slot.toByteArray())) // .setValueRead(ByteString.copyFrom(valueRead.toByteArray())); // if (valueWritten != null) { diff --git a/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java b/sdk/src/main/java/org/hiero/sdk/SubscriptionHandle.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java rename to sdk/src/main/java/org/hiero/sdk/SubscriptionHandle.java index a41905dd3d..51b4f9b120 100644 --- a/sdk/src/main/java/com/hiero/sdk/SubscriptionHandle.java +++ b/sdk/src/main/java/org/hiero/sdk/SubscriptionHandle.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java index 6250f3a076..379bddc4db 100644 --- a/sdk/src/main/java/com/hiero/sdk/SystemDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.SystemDeleteTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.SystemDeleteTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.util.LinkedHashMap; @@ -48,7 +48,7 @@ public SystemDeleteTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - SystemDeleteTransaction(LinkedHashMap> txs) + SystemDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -59,7 +59,7 @@ public SystemDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - SystemDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + SystemDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -145,7 +145,7 @@ public SystemDeleteTransaction setExpirationTime(Instant expirationTime) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.SystemDeleteTransactionBody} + * @return {@link org.hiero.sdk.proto.SystemDeleteTransactionBody} */ SystemDeleteTransactionBody.Builder build() { var builder = SystemDeleteTransactionBody.newBuilder(); @@ -200,7 +200,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { if (fileId != null) { return FileServiceGrpc.getSystemDeleteMethod(); } else { diff --git a/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java similarity index 89% rename from sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java index ba2978bbff..42ad91c3a5 100644 --- a/sdk/src/main/java/com/hiero/sdk/SystemUndeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.SystemUndeleteTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.SystemUndeleteTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -39,7 +39,7 @@ public SystemUndeleteTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ SystemUndeleteTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public SystemUndeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - SystemUndeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + SystemUndeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -121,7 +121,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.SystemUndeleteTransactionBody} + * @return {@link org.hiero.sdk.proto.SystemUndeleteTransactionBody} */ SystemUndeleteTransactionBody.Builder build() { var builder = SystemUndeleteTransactionBody.newBuilder(); @@ -157,7 +157,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { if (fileId != null) { return FileServiceGrpc.getSystemUndeleteMethod(); } else { diff --git a/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java b/sdk/src/main/java/org/hiero/sdk/ThreadLocalSecureRandom.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java rename to sdk/src/main/java/org/hiero/sdk/ThreadLocalSecureRandom.java index 86b78943d7..0acc94dbfb 100644 --- a/sdk/src/main/java/com/hiero/sdk/ThreadLocalSecureRandom.java +++ b/sdk/src/main/java/org/hiero/sdk/ThreadLocalSecureRandom.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.security.SecureRandom; diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java similarity index 86% rename from sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java index 816ff16054..a14f49338f 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAirdropTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenAirdropTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -32,7 +32,7 @@ public TokenAirdropTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenAirdropTransaction(LinkedHashMap> txs) + TokenAirdropTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -43,7 +43,7 @@ public TokenAirdropTransaction() { * * @param txBody protobuf TransactionBody */ - TokenAirdropTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenAirdropTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -52,7 +52,7 @@ public TokenAirdropTransaction() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenAirdropTransactionBody} + * org.hiero.sdk.proto.TokenAirdropTransactionBody} */ TokenAirdropTransactionBody.Builder build() { var transfers = sortTransfersAndBuild(); @@ -66,7 +66,7 @@ TokenAirdropTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getAirdropTokensMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java b/sdk/src/main/java/org/hiero/sdk/TokenAllowance.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/TokenAllowance.java rename to sdk/src/main/java/org/hiero/sdk/TokenAllowance.java index 41d5e41a58..ed812b4be6 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAllowance.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAllowance.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.GrantedTokenAllowance; +import org.hiero.sdk.proto.GrantedTokenAllowance; import java.util.Objects; import javax.annotation.Nullable; @@ -58,7 +58,7 @@ public class TokenAllowance { * @param allowanceProto the protobuf * @return the new token allowance */ - static TokenAllowance fromProtobuf(com.hiero.sdk.proto.TokenAllowance allowanceProto) { + static TokenAllowance fromProtobuf(org.hiero.sdk.proto.TokenAllowance allowanceProto) { return new TokenAllowance( allowanceProto.hasTokenId() ? TokenId.fromProtobuf(allowanceProto.getTokenId()) : null, allowanceProto.hasOwner() ? AccountId.fromProtobuf(allowanceProto.getOwner()) : null, @@ -88,7 +88,7 @@ static TokenAllowance fromProtobuf(GrantedTokenAllowance allowanceProto) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenAllowance fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TokenAllowance.parseFrom(Objects.requireNonNull(bytes))); + return fromProtobuf(org.hiero.sdk.proto.TokenAllowance.parseFrom(Objects.requireNonNull(bytes))); } /** @@ -114,8 +114,8 @@ void validateChecksums(Client client) throws BadEntityIdException { * * @return the protobuf representation */ - com.hiero.sdk.proto.TokenAllowance toProtobuf() { - var builder = com.hiero.sdk.proto.TokenAllowance.newBuilder().setAmount(amount); + org.hiero.sdk.proto.TokenAllowance toProtobuf() { + var builder = org.hiero.sdk.proto.TokenAllowance.newBuilder().setAmount(amount); if (tokenId != null) { builder.setTokenId(tokenId.toProtobuf()); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java similarity index 88% rename from sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java index 9c2bea98bb..312a6b1412 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAssociateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenAssociateTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAssociateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -38,7 +38,7 @@ public TokenAssociateTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenAssociateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -49,7 +49,7 @@ public TokenAssociateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenAssociateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenAssociateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -102,7 +102,7 @@ public TokenAssociateTransaction setTokenIds(List tokens) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenAssociateTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenAssociateTransactionBody} */ TokenAssociateTransactionBody.Builder build() { var builder = TokenAssociateTransactionBody.newBuilder(); @@ -148,7 +148,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getAssociateTokensMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java b/sdk/src/main/java/org/hiero/sdk/TokenAssociation.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/TokenAssociation.java rename to sdk/src/main/java/org/hiero/sdk/TokenAssociation.java index ea231bfff9..2f986b081c 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenAssociation.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAssociation.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -43,7 +43,7 @@ public class TokenAssociation { * @param tokenAssociation the protobuf * @return the new token association */ - static TokenAssociation fromProtobuf(com.hiero.sdk.proto.TokenAssociation tokenAssociation) { + static TokenAssociation fromProtobuf(org.hiero.sdk.proto.TokenAssociation tokenAssociation) { return new TokenAssociation( tokenAssociation.hasTokenId() ? TokenId.fromProtobuf(tokenAssociation.getTokenId()) @@ -61,7 +61,7 @@ static TokenAssociation fromProtobuf(com.hiero.sdk.proto.TokenAssociation tokenA * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenAssociation fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TokenAssociation.parseFrom(bytes)); + return fromProtobuf(org.hiero.sdk.proto.TokenAssociation.parseFrom(bytes)); } /** @@ -69,8 +69,8 @@ public static TokenAssociation fromBytes(byte[] bytes) throws InvalidProtocolBuf * * @return the protobuf representation */ - com.hiero.sdk.proto.TokenAssociation toProtobuf() { - return com.hiero.sdk.proto.TokenAssociation.newBuilder() + org.hiero.sdk.proto.TokenAssociation toProtobuf() { + return org.hiero.sdk.proto.TokenAssociation.newBuilder() .setTokenId(tokenId.toProtobuf()) .setAccountId(accountId.toProtobuf()) .build(); diff --git a/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java index e07152e3df..ce10feda60 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenBurnTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenBurnTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenBurnTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -23,7 +23,7 @@ * * See Hedera Documentation */ -public class TokenBurnTransaction extends com.hiero.sdk.Transaction { +public class TokenBurnTransaction extends org.hiero.sdk.Transaction { /** * The ID of the token to burn supply */ @@ -50,7 +50,7 @@ public TokenBurnTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenBurnTransaction(LinkedHashMap> txs) + TokenBurnTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -61,7 +61,7 @@ public TokenBurnTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenBurnTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenBurnTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -155,7 +155,7 @@ public TokenBurnTransaction addSerial(@Nonnegative long serial) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenBurnTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenBurnTransactionBody} */ TokenBurnTransactionBody.Builder build() { var builder = TokenBurnTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java similarity index 80% rename from sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java index 593238ccc4..11240435bd 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenCancelAirdropTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenCancelAirdropTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody.Builder; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenCancelAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody.Builder; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -26,7 +26,7 @@ public TokenCancelAirdropTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenCancelAirdropTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -37,7 +37,7 @@ public TokenCancelAirdropTransaction() { * * @param txBody protobuf TransactionBody */ - TokenCancelAirdropTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenCancelAirdropTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -45,7 +45,7 @@ public TokenCancelAirdropTransaction() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenCancelAirdropTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenCancelAirdropTransactionBody} */ TokenCancelAirdropTransactionBody.Builder build() { var builder = TokenCancelAirdropTransactionBody.newBuilder(); @@ -68,7 +68,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getCancelAirdropMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java similarity index 80% rename from sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java index f775bbc33b..8ff13d41d1 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenClaimAirdropTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenClaimAirdropTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody.Builder; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenClaimAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody.Builder; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; @@ -26,7 +26,7 @@ public TokenClaimAirdropTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenClaimAirdropTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -37,7 +37,7 @@ public TokenClaimAirdropTransaction() { * * @param txBody protobuf TransactionBody */ - TokenClaimAirdropTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenClaimAirdropTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -45,7 +45,7 @@ public TokenClaimAirdropTransaction() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenClaimAirdropTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenClaimAirdropTransactionBody} */ TokenClaimAirdropTransactionBody.Builder build() { var builder = TokenClaimAirdropTransactionBody.newBuilder(); @@ -68,7 +68,7 @@ void initFromTransactionBody() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getClaimAirdropMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java index d022b225d9..3e33a03479 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenCreateTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenCreateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -192,7 +192,7 @@ public TokenCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenCreateTransaction(LinkedHashMap> txs) + TokenCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -203,7 +203,7 @@ public TokenCreateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenCreateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -749,7 +749,7 @@ public TokenCreateTransaction freezeWith(@Nullable Client client) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenCreateTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenCreateTransactionBody} */ TokenCreateTransactionBody.Builder build() { var builder = TokenCreateTransactionBody.newBuilder(); @@ -885,7 +885,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getCreateTokenMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java similarity index 85% rename from sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java index 0b4ceb61dd..7abf771607 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenDeleteTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDeleteTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -23,7 +23,7 @@ * * See Hedera Documentation */ -public class TokenDeleteTransaction extends com.hiero.sdk.Transaction { +public class TokenDeleteTransaction extends org.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @@ -39,7 +39,7 @@ public TokenDeleteTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenDeleteTransaction(LinkedHashMap> txs) + TokenDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public TokenDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -92,7 +92,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenDeleteTransactionBody} + * org.hiero.sdk.proto.TokenDeleteTransactionBody} */ TokenDeleteTransactionBody.Builder build() { var builder = TokenDeleteTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java similarity index 88% rename from sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java index 6800b9ad5b..ee1693b1fb 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenDissociateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenDissociateTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDissociateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -23,7 +23,7 @@ * * See Hedera Documentation */ -public class TokenDissociateTransaction extends com.hiero.sdk.Transaction { +public class TokenDissociateTransaction extends org.hiero.sdk.Transaction { @Nullable private AccountId accountId = null; @@ -44,7 +44,7 @@ public TokenDissociateTransaction() { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenDissociateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -55,7 +55,7 @@ public TokenDissociateTransaction() { * * @param txBody protobuf TransactionBody */ - TokenDissociateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenDissociateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -122,7 +122,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenDissociateTransactionBody} + * org.hiero.sdk.proto.TokenDissociateTransactionBody} */ TokenDissociateTransactionBody.Builder build() { var builder = TokenDissociateTransactionBody.newBuilder(); @@ -153,7 +153,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getDissociateTokensMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java similarity index 89% rename from sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java index aaeea4bfd4..a2f0a9d4df 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenFeeScheduleUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -43,7 +43,7 @@ public TokenFeeScheduleUpdateTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenFeeScheduleUpdateTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -54,7 +54,7 @@ public TokenFeeScheduleUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenFeeScheduleUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenFeeScheduleUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -122,7 +122,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody} + * org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody} */ TokenFeeScheduleUpdateTransactionBody.Builder build() { var builder = TokenFeeScheduleUpdateTransactionBody.newBuilder(); @@ -150,7 +150,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUpdateTokenFeeScheduleMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java similarity index 86% rename from sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java index 1519b6b740..aee1b8b6fc 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenFreezeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenFreezeAccountTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFreezeAccountTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -19,7 +19,7 @@ * * See Hedera Documentation */ -public class TokenFreezeTransaction extends com.hiero.sdk.Transaction { +public class TokenFreezeTransaction extends org.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @@ -38,7 +38,7 @@ public TokenFreezeTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenFreezeTransaction(LinkedHashMap> txs) + TokenFreezeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -49,7 +49,7 @@ public TokenFreezeTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenFreezeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenFreezeTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -118,7 +118,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenFreezeAccountTransactionBody} + * org.hiero.sdk.proto.TokenFreezeAccountTransactionBody} */ TokenFreezeAccountTransactionBody.Builder build() { var builder = TokenFreezeAccountTransactionBody.newBuilder(); @@ -145,7 +145,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java similarity index 87% rename from sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java index a00502b574..24d9bfb0d1 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenGrantKycTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenGrantKycTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenGrantKycTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -19,7 +19,7 @@ * * See Hedera Documentation */ -public class TokenGrantKycTransaction extends com.hiero.sdk.Transaction { +public class TokenGrantKycTransaction extends org.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @@ -39,7 +39,7 @@ public TokenGrantKycTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenGrantKycTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public TokenGrantKycTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenGrantKycTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenGrantKycTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -119,7 +119,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenGrantKycTransactionBody} + * org.hiero.sdk.proto.TokenGrantKycTransactionBody} */ TokenGrantKycTransactionBody.Builder build() { var builder = TokenGrantKycTransactionBody.newBuilder(); @@ -146,7 +146,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenId.java b/sdk/src/main/java/org/hiero/sdk/TokenId.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/TokenId.java rename to sdk/src/main/java/org/hiero/sdk/TokenId.java index 162b8878c3..dc906dbf15 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenId.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenId.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.TokenID; +import org.hiero.sdk.proto.TokenID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/TokenInfo.java b/sdk/src/main/java/org/hiero/sdk/TokenInfo.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/TokenInfo.java rename to sdk/src/main/java/org/hiero/sdk/TokenInfo.java index 0aa5f8be41..bb42bd133b 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenInfo.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.TokenFreezeStatus; -import com.hiero.sdk.proto.TokenGetInfoResponse; -import com.hiero.sdk.proto.TokenKycStatus; -import com.hiero.sdk.proto.TokenPauseStatus; +import org.hiero.sdk.proto.TokenFreezeStatus; +import org.hiero.sdk.proto.TokenGetInfoResponse; +import org.hiero.sdk.proto.TokenKycStatus; +import org.hiero.sdk.proto.TokenPauseStatus; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; @@ -326,7 +326,7 @@ public static TokenInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferExce * @param info the protobuf * @return the list of custom fee's */ - private static List customFeesFromProto(com.hiero.sdk.proto.TokenInfo info) { + private static List customFeesFromProto(org.hiero.sdk.proto.TokenInfo info) { var returnCustomFees = new ArrayList(info.getCustomFeesCount()); for (var feeProto : info.getCustomFeesList()) { returnCustomFees.add(CustomFee.fromProtobuf(feeProto)); @@ -376,7 +376,7 @@ static TokenPauseStatus pauseStatusToProtobuf(@Nullable Boolean pauseStatus) { * @return the protobuf representation */ TokenGetInfoResponse toProtobuf() { - var tokenInfoBuilder = com.hiero.sdk.proto.TokenInfo.newBuilder() + var tokenInfoBuilder = org.hiero.sdk.proto.TokenInfo.newBuilder() .setTokenId(tokenId.toProtobuf()) .setName(name) .setSymbol(symbol) diff --git a/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java similarity index 83% rename from sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java index 33ad2a1938..4c85feb7c7 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Query; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.TokenGetInfoQuery; -import com.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TokenGetInfoQuery; +import org.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -15,7 +15,7 @@ /** * Initializes the TokenInfoQuery object. */ -public class TokenInfoQuery extends com.hiero.sdk.Query { +public class TokenInfoQuery extends org.hiero.sdk.Query { @Nullable TokenId tokenId = null; @@ -54,7 +54,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TokenGetInfoQuery.newBuilder(); if (tokenId != null) { builder.setToken(tokenId.toProtobuf()); @@ -69,7 +69,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getTokenGetInfo().getHeader(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenKeyValidation.java b/sdk/src/main/java/org/hiero/sdk/TokenKeyValidation.java similarity index 70% rename from sdk/src/main/java/com/hiero/sdk/TokenKeyValidation.java rename to sdk/src/main/java/org/hiero/sdk/TokenKeyValidation.java index 9941ef9eb1..5e2bd6d68f 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenKeyValidation.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenKeyValidation.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Types of validation strategies for token keys. @@ -9,25 +9,25 @@ public enum TokenKeyValidation { /** * Currently the default behaviour. It will perform all token key validations. */ - FULL_VALIDATION(com.hiero.sdk.proto.TokenKeyValidation.FULL_VALIDATION), + FULL_VALIDATION(org.hiero.sdk.proto.TokenKeyValidation.FULL_VALIDATION), /** * Perform no validations at all for all passed token keys. */ - NO_VALIDATION(com.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION); + NO_VALIDATION(org.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION); - final com.hiero.sdk.proto.TokenKeyValidation code; + final org.hiero.sdk.proto.TokenKeyValidation code; /** * Constructor. * * @param code the token key validation */ - TokenKeyValidation(com.hiero.sdk.proto.TokenKeyValidation code) { + TokenKeyValidation(org.hiero.sdk.proto.TokenKeyValidation code) { this.code = code; } - static TokenKeyValidation valueOf(com.hiero.sdk.proto.TokenKeyValidation code) { + static TokenKeyValidation valueOf(org.hiero.sdk.proto.TokenKeyValidation code) { return switch (code) { case FULL_VALIDATION -> FULL_VALIDATION; case NO_VALIDATION -> NO_VALIDATION; @@ -43,7 +43,7 @@ public String toString() { }; } - public com.hiero.sdk.proto.TokenKeyValidation toProtobuf() { + public org.hiero.sdk.proto.TokenKeyValidation toProtobuf() { return this.code; } } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenMintTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/TokenMintTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java index 62ec55fccd..cd09423abb 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenMintTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenMintTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenMintTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -25,7 +25,7 @@ * * See Hedera Documentation */ -public class TokenMintTransaction extends com.hiero.sdk.Transaction { +public class TokenMintTransaction extends org.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; /** @@ -62,7 +62,7 @@ public TokenMintTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenMintTransaction(LinkedHashMap> txs) + TokenMintTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -73,7 +73,7 @@ public TokenMintTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenMintTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenMintTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -174,7 +174,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenMintTransactionBody} + * org.hiero.sdk.proto.TokenMintTransactionBody} */ TokenMintTransactionBody.Builder build() { var builder = TokenMintTransactionBody.newBuilder(); diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java b/sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java rename to sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java index 9d85a648a6..83ce7efbc7 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftAllowance.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.BoolValue; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.NftAllowance; -import com.hiero.sdk.proto.NftRemoveAllowance; +import org.hiero.sdk.proto.NftAllowance; +import org.hiero.sdk.proto.NftRemoveAllowance; import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java b/sdk/src/main/java/org/hiero/sdk/TokenNftInfo.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java rename to sdk/src/main/java/org/hiero/sdk/TokenNftInfo.java index ebea6ebc2f..70d0ecf350 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftInfo.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; @@ -76,7 +76,7 @@ public class TokenNftInfo { * @param info the protobuf * @return the new token nft info */ - static TokenNftInfo fromProtobuf(com.hiero.sdk.proto.TokenNftInfo info) { + static TokenNftInfo fromProtobuf(org.hiero.sdk.proto.TokenNftInfo info) { return new TokenNftInfo( NftId.fromProtobuf(info.getNftID()), AccountId.fromProtobuf(info.getAccountID()), @@ -94,7 +94,7 @@ static TokenNftInfo fromProtobuf(com.hiero.sdk.proto.TokenNftInfo info) { * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenNftInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TokenNftInfo.parseFrom(bytes)); + return fromProtobuf(org.hiero.sdk.proto.TokenNftInfo.parseFrom(bytes)); } /** @@ -102,8 +102,8 @@ public static TokenNftInfo fromBytes(byte[] bytes) throws InvalidProtocolBufferE * * @return the protobuf representation */ - com.hiero.sdk.proto.TokenNftInfo toProtobuf() { - var builder = com.hiero.sdk.proto.TokenNftInfo.newBuilder() + org.hiero.sdk.proto.TokenNftInfo toProtobuf() { + var builder = org.hiero.sdk.proto.TokenNftInfo.newBuilder() .setNftID(nftId.toProtobuf()) .setAccountID(accountId.toProtobuf()) .setCreationTime(InstantConverter.toProtobuf(creationTime)) diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java index 26d6b072b3..0f49b3f3ff 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; - -import com.hiero.sdk.proto.Query; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.TokenGetNftInfoQuery; -import com.hiero.sdk.proto.TokenServiceGrpc; +package org.hiero.sdk; + +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TokenGetNftInfoQuery; +import org.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Collections; import java.util.List; @@ -22,7 +22,7 @@ * * See Hedera Documentation */ -public class TokenNftInfoQuery extends com.hiero.sdk.Query, TokenNftInfoQuery> { +public class TokenNftInfoQuery extends org.hiero.sdk.Query, TokenNftInfoQuery> { /** * The ID of the non-fungible token in x.y.z format. */ @@ -196,7 +196,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TokenGetNftInfoQuery.newBuilder(); if (nftId != null) { builder.setNftID(nftId.toProtobuf()); @@ -210,12 +210,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getTokenGetInfo().getHeader(); } @Override - List mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + List mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return Collections.singletonList( TokenNftInfo.fromProtobuf(response.getTokenGetNftInfo().getNft())); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java b/sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java rename to sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java index b57b9aab08..c00a3912b2 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenNftTransfer.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.NftTransfer; -import com.hiero.sdk.proto.TokenID; -import com.hiero.sdk.proto.TokenTransferList; +import org.hiero.sdk.proto.NftTransfer; +import org.hiero.sdk.proto.TokenID; +import org.hiero.sdk.proto.TokenTransferList; import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java similarity index 85% rename from sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java index a207a9e7ff..a63d949fde 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenPauseTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenPauseTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenPauseTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -38,7 +38,7 @@ public TokenPauseTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenPauseTransaction(LinkedHashMap> txs) + TokenPauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -49,7 +49,7 @@ public TokenPauseTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenPauseTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenPauseTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -88,7 +88,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenPauseTransactionBody} + * org.hiero.sdk.proto.TokenPauseTransactionBody} */ TokenPauseTransactionBody.Builder build() { var builder = TokenPauseTransactionBody.newBuilder(); @@ -100,7 +100,7 @@ TokenPauseTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getPauseTokenMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java b/sdk/src/main/java/org/hiero/sdk/TokenRejectFlow.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java rename to sdk/src/main/java/org/hiero/sdk/TokenRejectFlow.java index 5e9e7a4744..8259ec82fd 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRejectFlow.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRejectFlow.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import java.time.Duration; import java.util.ArrayList; diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java index 9a9843eebe..cac8c216f7 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRejectTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenReference; -import com.hiero.sdk.proto.TokenRejectTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenReference; +import org.hiero.sdk.proto.TokenRejectTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -49,7 +49,7 @@ public TokenRejectTransaction() {} * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenRejectTransaction(LinkedHashMap> txs) + TokenRejectTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -60,7 +60,7 @@ public TokenRejectTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenRejectTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenRejectTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -151,7 +151,7 @@ public TokenRejectTransaction addNftId(NftId nftId) { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenRejectTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenRejectTransactionBody} */ TokenRejectTransactionBody.Builder build() { var builder = TokenRejectTransactionBody.newBuilder(); @@ -210,7 +210,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getRejectTokenMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java b/sdk/src/main/java/org/hiero/sdk/TokenRelationship.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/TokenRelationship.java rename to sdk/src/main/java/org/hiero/sdk/TokenRelationship.java index fa33af8641..d03bded4fe 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRelationship.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRelationship.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.TokenFreezeStatus; -import com.hiero.sdk.proto.TokenKycStatus; +import org.hiero.sdk.proto.TokenFreezeStatus; +import org.hiero.sdk.proto.TokenKycStatus; import javax.annotation.Nullable; /** @@ -99,7 +99,7 @@ static Boolean kycStatusFromProtobuf(TokenKycStatus kycStatus) { * @param tokenRelationship the protobuf * @return the new token relationship */ - static TokenRelationship fromProtobuf(com.hiero.sdk.proto.TokenRelationship tokenRelationship) { + static TokenRelationship fromProtobuf(org.hiero.sdk.proto.TokenRelationship tokenRelationship) { return new TokenRelationship( TokenId.fromProtobuf(tokenRelationship.getTokenId()), tokenRelationship.getSymbol(), @@ -118,7 +118,7 @@ static TokenRelationship fromProtobuf(com.hiero.sdk.proto.TokenRelationship toke * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TokenRelationship fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TokenRelationship.parseFrom(bytes).toBuilder() + return fromProtobuf(org.hiero.sdk.proto.TokenRelationship.parseFrom(bytes).toBuilder() .build()); } @@ -151,8 +151,8 @@ static TokenKycStatus kycStatusToProtobuf(@Nullable Boolean kycStatus) { * * @return the protobuf representation */ - com.hiero.sdk.proto.TokenRelationship toProtobuf() { - return com.hiero.sdk.proto.TokenRelationship.newBuilder() + org.hiero.sdk.proto.TokenRelationship toProtobuf() { + return org.hiero.sdk.proto.TokenRelationship.newBuilder() .setTokenId(tokenId.toProtobuf()) .setSymbol(symbol) .setBalance(balance) diff --git a/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java similarity index 87% rename from sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java index 830b625ed5..bcce4e789a 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenRevokeKycTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenRevokeKycTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenRevokeKycTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -20,7 +20,7 @@ * * See Hedera Documentation */ -public class TokenRevokeKycTransaction extends com.hiero.sdk.Transaction { +public class TokenRevokeKycTransaction extends org.hiero.sdk.Transaction { /** * The token ID that is associated with the account to remove the KYC flag for */ @@ -45,7 +45,7 @@ public TokenRevokeKycTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenRevokeKycTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -56,7 +56,7 @@ public TokenRevokeKycTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenRevokeKycTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenRevokeKycTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -122,7 +122,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenRevokeKycTransactionBody} + * org.hiero.sdk.proto.TokenRevokeKycTransactionBody} */ TokenRevokeKycTransactionBody.Builder build() { var builder = TokenRevokeKycTransactionBody.newBuilder(); @@ -149,7 +149,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java b/sdk/src/main/java/org/hiero/sdk/TokenSupplyType.java similarity index 76% rename from sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java rename to sdk/src/main/java/org/hiero/sdk/TokenSupplyType.java index ad7d7fe3d7..fc2a4f8578 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenSupplyType.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenSupplyType.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Possible Token Supply Types (IWA Compatibility). @@ -12,20 +12,20 @@ public enum TokenSupplyType { /** * Indicates that tokens of that type have an upper bound of Long.MAX_VALUE. */ - INFINITE(com.hiero.sdk.proto.TokenSupplyType.INFINITE), + INFINITE(org.hiero.sdk.proto.TokenSupplyType.INFINITE), /** * Indicates that tokens of that type have an upper bound of maxSupply, provided on token creation. */ - FINITE(com.hiero.sdk.proto.TokenSupplyType.FINITE); + FINITE(org.hiero.sdk.proto.TokenSupplyType.FINITE); - final com.hiero.sdk.proto.TokenSupplyType code; + final org.hiero.sdk.proto.TokenSupplyType code; /** * Constructor. * * @param code the token supply type */ - TokenSupplyType(com.hiero.sdk.proto.TokenSupplyType code) { + TokenSupplyType(org.hiero.sdk.proto.TokenSupplyType code) { this.code = code; } @@ -35,7 +35,7 @@ public enum TokenSupplyType { * @param code the token supply type in question * @return the token supply type */ - static TokenSupplyType valueOf(com.hiero.sdk.proto.TokenSupplyType code) { + static TokenSupplyType valueOf(org.hiero.sdk.proto.TokenSupplyType code) { return switch (code) { case INFINITE -> INFINITE; case FINITE -> FINITE; @@ -51,7 +51,7 @@ public String toString() { }; } - public com.hiero.sdk.proto.TokenSupplyType toProtobuf() { + public org.hiero.sdk.proto.TokenSupplyType toProtobuf() { return this.code; } } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java b/sdk/src/main/java/org/hiero/sdk/TokenTransfer.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/TokenTransfer.java rename to sdk/src/main/java/org/hiero/sdk/TokenTransfer.java index 99c571b1d2..331d9210c2 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenTransfer.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenTransfer.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.AccountAmount; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; @@ -59,7 +59,7 @@ public class TokenTransfer { * @param tokenTransferLists the protobuf * @return the list of token transfer records */ - static List fromProtobuf(List tokenTransferLists) { + static List fromProtobuf(List tokenTransferLists) { var transfers = new ArrayList(); for (var tokenTransferList : tokenTransferLists) { diff --git a/sdk/src/main/java/com/hiero/sdk/TokenTransferList.java b/sdk/src/main/java/org/hiero/sdk/TokenTransferList.java similarity index 87% rename from sdk/src/main/java/com/hiero/sdk/TokenTransferList.java rename to sdk/src/main/java/org/hiero/sdk/TokenTransferList.java index 71b8b9aa37..6ecbcf4795 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenTransferList.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenTransferList.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.UInt32Value; -import com.hiero.sdk.proto.AccountAmount; -import com.hiero.sdk.proto.NftTransfer; +import org.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.NftTransfer; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; @@ -34,7 +34,7 @@ class TokenTransferList { } } - com.hiero.sdk.proto.TokenTransferList toProtobuf() { + org.hiero.sdk.proto.TokenTransferList toProtobuf() { var transfers = new ArrayList(); var nftTransfers = new ArrayList(); @@ -46,7 +46,7 @@ com.hiero.sdk.proto.TokenTransferList toProtobuf() { nftTransfers.add(transfer.toProtobuf()); } - var builder = com.hiero.sdk.proto.TokenTransferList.newBuilder() + var builder = org.hiero.sdk.proto.TokenTransferList.newBuilder() .setToken(tokenId.toProtobuf()) .addAllTransfers(transfers) .addAllNftTransfers(nftTransfers); diff --git a/sdk/src/main/java/com/hiero/sdk/TokenType.java b/sdk/src/main/java/org/hiero/sdk/TokenType.java similarity index 82% rename from sdk/src/main/java/com/hiero/sdk/TokenType.java rename to sdk/src/main/java/org/hiero/sdk/TokenType.java index 135803374b..4f3a897ffd 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenType.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenType.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; /** * Possible Token Types (IWA Compatibility). @@ -16,21 +16,21 @@ public enum TokenType { * Interchangeable value with one another, where any quantity of them has the same value as another equal quantity if they are in the same class. * Share a single set of properties, not distinct from one another. Simply represented as a balance or quantity to a given Hedera account. */ - FUNGIBLE_COMMON(com.hiero.sdk.proto.TokenType.FUNGIBLE_COMMON), + FUNGIBLE_COMMON(org.hiero.sdk.proto.TokenType.FUNGIBLE_COMMON), /** * Unique, not interchangeable with other tokens of the same type as they typically have different values. * Individually traced and can carry unique properties (e.g. serial number). */ - NON_FUNGIBLE_UNIQUE(com.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE); + NON_FUNGIBLE_UNIQUE(org.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE); - final com.hiero.sdk.proto.TokenType code; + final org.hiero.sdk.proto.TokenType code; /** * Constructor. * * @param code the token type */ - TokenType(com.hiero.sdk.proto.TokenType code) { + TokenType(org.hiero.sdk.proto.TokenType code) { this.code = code; } @@ -40,7 +40,7 @@ public enum TokenType { * @param code the token type in question * @return the token type */ - static TokenType valueOf(com.hiero.sdk.proto.TokenType code) { + static TokenType valueOf(org.hiero.sdk.proto.TokenType code) { return switch (code) { case FUNGIBLE_COMMON -> FUNGIBLE_COMMON; case NON_FUNGIBLE_UNIQUE -> NON_FUNGIBLE_UNIQUE; @@ -56,7 +56,7 @@ public String toString() { }; } - public com.hiero.sdk.proto.TokenType toProtobuf() { + public org.hiero.sdk.proto.TokenType toProtobuf() { return this.code; } } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java similarity index 86% rename from sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java index 765f0e206e..807954f637 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUnfreezeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -19,7 +19,7 @@ * * See Hedera Documentation */ -public class TokenUnfreezeTransaction extends com.hiero.sdk.Transaction { +public class TokenUnfreezeTransaction extends org.hiero.sdk.Transaction { @Nullable private TokenId tokenId = null; @@ -39,7 +39,7 @@ public TokenUnfreezeTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenUnfreezeTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -50,7 +50,7 @@ public TokenUnfreezeTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenUnfreezeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenUnfreezeTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -119,7 +119,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@code @link - * com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody} + * org.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody} */ TokenUnfreezeAccountTransactionBody.Builder build() { var builder = TokenUnfreezeAccountTransactionBody.newBuilder(); @@ -146,7 +146,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getFreezeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java similarity index 85% rename from sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java index 939a39e49c..a4d0e0a1a3 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUnpauseTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TokenUnpauseTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenUnpauseTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -36,7 +36,7 @@ public TokenUnpauseTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUnpauseTransaction(LinkedHashMap> txs) + TokenUnpauseTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -47,7 +47,7 @@ public TokenUnpauseTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenUnpauseTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenUnpauseTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -89,7 +89,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenUnpauseTransactionBody} + * org.hiero.sdk.proto.TokenUnpauseTransactionBody} */ TokenUnpauseTransactionBody.Builder build() { var builder = TokenUnpauseTransactionBody.newBuilder(); @@ -101,7 +101,7 @@ TokenUnpauseTransactionBody.Builder build() { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUnpauseTokenMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java index 7566389a2a..da313609f9 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUpdateNftsTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TokenUpdateNftsTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenUpdateNftsTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -47,13 +47,13 @@ public TokenUpdateNftsTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TokenUpdateNftsTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); } - TokenUpdateNftsTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenUpdateNftsTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -154,7 +154,7 @@ void initFromTransactionBody() { /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.TokenUpdateNftsTransactionBody} + * @return {@link org.hiero.sdk.proto.TokenUpdateNftsTransactionBody} */ TokenUpdateNftsTransactionBody.Builder build() { var builder = TokenUpdateNftsTransactionBody.newBuilder(); @@ -182,7 +182,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUpdateNftsMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java index 7df4f765f0..5a1feb02c6 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TokenUpdateTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenUpdateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -161,7 +161,7 @@ public TokenUpdateTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenUpdateTransaction(LinkedHashMap> txs) + TokenUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -172,7 +172,7 @@ public TokenUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -668,7 +668,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenUpdateTransactionBody} + * org.hiero.sdk.proto.TokenUpdateTransactionBody} */ TokenUpdateTransactionBody.Builder build() { var builder = TokenUpdateTransactionBody.newBuilder(); @@ -744,7 +744,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getUpdateTokenMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java index 182da854ea..52cca6b5f8 100644 --- a/sdk/src/main/java/com/hiero/sdk/TokenWipeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TokenWipeAccountTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenWipeAccountTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -23,7 +23,7 @@ * * See Hedera Documentation */ -public class TokenWipeTransaction extends com.hiero.sdk.Transaction { +public class TokenWipeTransaction extends org.hiero.sdk.Transaction { /** * The ID of the token to wipe from the account */ @@ -60,7 +60,7 @@ public TokenWipeTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TokenWipeTransaction(LinkedHashMap> txs) + TokenWipeTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -71,7 +71,7 @@ public TokenWipeTransaction() {} * * @param txBody protobuf TransactionBody */ - TokenWipeTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TokenWipeTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -197,7 +197,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TokenWipeAccountTransactionBody} + * org.hiero.sdk.proto.TokenWipeAccountTransactionBody} */ TokenWipeAccountTransactionBody.Builder build() { var builder = TokenWipeAccountTransactionBody.newBuilder(); @@ -228,7 +228,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return TokenServiceGrpc.getWipeTokenAccountMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java similarity index 94% rename from sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java index 1fa5795da8..ed0c908183 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; -import com.hiero.sdk.proto.ConsensusServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.LinkedHashMap; @@ -88,7 +88,7 @@ public TopicCreateTransaction() { * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicCreateTransaction(LinkedHashMap> txs) + TopicCreateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -99,7 +99,7 @@ public TopicCreateTransaction() { * * @param txBody protobuf TransactionBody */ - TopicCreateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TopicCreateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -264,7 +264,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody} + * org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody} */ ConsensusCreateTopicTransactionBody.Builder build() { var builder = ConsensusCreateTopicTransactionBody.newBuilder(); @@ -293,7 +293,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getCreateTopicMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java similarity index 85% rename from sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java index 9ee23019d7..ac8b4a8228 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; -import com.hiero.sdk.proto.ConsensusServiceGrpc; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -36,7 +36,7 @@ public TopicDeleteTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicDeleteTransaction(LinkedHashMap> txs) + TopicDeleteTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -47,7 +47,7 @@ public TopicDeleteTransaction() {} * * @param txBody protobuf TransactionBody */ - TopicDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TopicDeleteTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -89,7 +89,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody} + * org.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody} */ ConsensusDeleteTopicTransactionBody.Builder build() { var builder = ConsensusDeleteTopicTransactionBody.newBuilder(); @@ -108,7 +108,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getDeleteTopicMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicId.java b/sdk/src/main/java/org/hiero/sdk/TopicId.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/TopicId.java rename to sdk/src/main/java/org/hiero/sdk/TopicId.java index b3fcec1761..6665bc032e 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicId.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicId.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.TopicID; +import org.hiero.sdk.proto.TopicID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/TopicInfo.java b/sdk/src/main/java/org/hiero/sdk/TopicInfo.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/TopicInfo.java rename to sdk/src/main/java/org/hiero/sdk/TopicInfo.java index 7dbe271a8d..34f8232fac 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicInfo.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ConsensusGetTopicInfoResponse; -import com.hiero.sdk.proto.ConsensusTopicInfo; +import org.hiero.sdk.proto.ConsensusGetTopicInfoResponse; +import org.hiero.sdk.proto.ConsensusTopicInfo; import java.time.Duration; import java.time.Instant; import javax.annotation.Nullable; diff --git a/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java similarity index 77% rename from sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java rename to sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java index acdc95df52..49108865c4 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.ConsensusGetTopicInfoQuery; -import com.hiero.sdk.proto.ConsensusServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.ConsensusGetTopicInfoQuery; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.Objects; import javax.annotation.Nullable; @@ -54,7 +54,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = ConsensusGetTopicInfoQuery.newBuilder(); if (topicId != null) { builder.setTopicID(topicId.toProtobuf()); @@ -69,17 +69,17 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getConsensusGetTopicInfo().getHeader(); } @Override - TopicInfo mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + TopicInfo mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { return TopicInfo.fromProtobuf(response.getConsensusGetTopicInfo()); } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getGetTopicInfoMethod(); } } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessage.java b/sdk/src/main/java/org/hiero/sdk/TopicMessage.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/TopicMessage.java rename to sdk/src/main/java/org/hiero/sdk/TopicMessage.java index 797481ce2c..004bfc0eb6 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessage.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessage.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.Instant; diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java b/sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java rename to sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java index 090ce65a2f..e1f4771223 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessageChunk.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; /** diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java b/sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java rename to sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java index 9860add697..2d876963a5 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessageQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TransactionID; -import com.hiero.sdk.proto.mirror.ConsensusServiceGrpc; -import com.hiero.sdk.proto.mirror.ConsensusTopicQuery; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.mirror.ConsensusServiceGrpc; +import org.hiero.sdk.proto.mirror.ConsensusTopicQuery; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Status; diff --git a/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java index ccdc000fa5..fad962780b 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicMessageSubmitTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ConsensusMessageChunkInfo; -import com.hiero.sdk.proto.ConsensusServiceGrpc; -import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionID; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ConsensusMessageChunkInfo; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.LinkedHashMap; import java.util.Objects; @@ -43,7 +43,7 @@ public TopicMessageSubmitTransaction() {} * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ TopicMessageSubmitTransaction( - LinkedHashMap> txs) + LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -54,7 +54,7 @@ public TopicMessageSubmitTransaction() {} * * @param txBody protobuf TransactionBody */ - TopicMessageSubmitTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TopicMessageSubmitTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -152,7 +152,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody} + * org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody} */ ConsensusSubmitMessageTransactionBody.Builder build() { var builder = ConsensusSubmitMessageTransactionBody.newBuilder(); @@ -172,7 +172,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getSubmitMessageMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java index a84e039526..b0bc71fccb 100644 --- a/sdk/src/main/java/com/hiero/sdk/TopicUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.ConsensusServiceGrpc; -import com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -77,7 +77,7 @@ public TopicUpdateTransaction() {} * records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TopicUpdateTransaction(LinkedHashMap> txs) + TopicUpdateTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -88,7 +88,7 @@ public TopicUpdateTransaction() {} * * @param txBody protobuf TransactionBody */ - TopicUpdateTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TopicUpdateTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -342,7 +342,7 @@ void initFromTransactionBody() { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody} + * org.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody} */ ConsensusUpdateTopicTransactionBody.Builder build() { var builder = ConsensusUpdateTopicTransactionBody.newBuilder(); @@ -382,7 +382,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return ConsensusServiceGrpc.getUpdateTopicMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/Transaction.java b/sdk/src/main/java/org/hiero/sdk/Transaction.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/Transaction.java rename to sdk/src/main/java/org/hiero/sdk/Transaction.java index 8a444a1501..7b2850a7ef 100644 --- a/sdk/src/main/java/com/hiero/sdk/Transaction.java +++ b/sdk/src/main/java/org/hiero/sdk/Transaction.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SignatureMap; -import com.hiero.sdk.proto.SignaturePair; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionList; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SignatureMap; +import org.hiero.sdk.proto.SignaturePair; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionList; import java.lang.reflect.Modifier; import java.time.Duration; import java.time.Instant; @@ -34,7 +34,7 @@ */ public abstract class Transaction> extends Executable< - T, com.hiero.sdk.proto.Transaction, com.hiero.sdk.proto.TransactionResponse, TransactionResponse> { + T, org.hiero.sdk.proto.Transaction, org.hiero.sdk.proto.TransactionResponse, TransactionResponse> { /** * Default auto renew duration for accounts, contracts, topics, and files (entities) @@ -75,14 +75,14 @@ public abstract class Transaction> * except pointing to different nodes. When retrying a transaction after a network error or retry-able status * response, we try a different transaction and thus a different node. */ - protected List outerTransactions = Collections.emptyList(); + protected List outerTransactions = Collections.emptyList(); /** * An SDK [Transaction] is composed of multiple, raw protobuf transactions. These should be functionally identical, * except pointing to different nodes. When retrying a transaction after a network error or retry-able status * response, we try a different transaction and thus a different node. */ - protected List innerSignedTransactions = Collections.emptyList(); + protected List innerSignedTransactions = Collections.emptyList(); /** * A set of signatures corresponding to every unique public key used to sign the transaction. @@ -140,7 +140,7 @@ public abstract class Transaction> * * @param txBody protobuf TransactionBody */ - Transaction(com.hiero.sdk.proto.TransactionBody txBody) { + Transaction(org.hiero.sdk.proto.TransactionBody txBody) { setTransactionValidDuration(DEFAULT_TRANSACTION_VALID_DURATION); setMaxTransactionFee(Hbar.fromTinybars(txBody.getTransactionFee())); setTransactionMemo(txBody.getMemo()); @@ -156,9 +156,9 @@ public abstract class Transaction> * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - Transaction(LinkedHashMap> txs) + Transaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { - LinkedHashMap transactionMap = + LinkedHashMap transactionMap = txs.values().iterator().next(); if (!transactionMap.isEmpty() && transactionMap.keySet().iterator().next().equals(DUMMY_ACCOUNT_ID)) { @@ -241,13 +241,13 @@ public abstract class Transaction> * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - var txs = new LinkedHashMap>(); + var txs = new LinkedHashMap>(); TransactionBody.DataCase dataCase = TransactionBody.DataCase.DATA_NOT_SET; var list = TransactionList.parseFrom(bytes); if (list.getTransactionListList().isEmpty()) { - var transaction = com.hiero.sdk.proto.Transaction.parseFrom(bytes).toBuilder(); + var transaction = org.hiero.sdk.proto.Transaction.parseFrom(bytes).toBuilder(); TransactionBody txBody; if (transaction.getSignedTransactionBytes().isEmpty()) { @@ -274,7 +274,7 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe ? TransactionId.fromProtobuf(txBody.getTransactionID()) : DUMMY_TRANSACTION_ID; - var linked = new LinkedHashMap(); + var linked = new LinkedHashMap(); linked.put(account, transaction.build()); txs.put(transactionId, linked); } else { @@ -295,7 +295,7 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe var linked = txs.containsKey(transactionId) ? Objects.requireNonNull(txs.get(transactionId)) - : new LinkedHashMap(); + : new LinkedHashMap(); linked.put(account, transaction); @@ -364,7 +364,7 @@ public static Transaction fromBytes(byte[] bytes) throws InvalidProtocolBuffe * @param scheduled the scheduled transaction * @return the new transaction */ - public static Transaction fromScheduledTransaction(com.hiero.sdk.proto.SchedulableTransactionBody scheduled) { + public static Transaction fromScheduledTransaction(org.hiero.sdk.proto.SchedulableTransactionBody scheduled) { var body = TransactionBody.newBuilder() .setMemo(scheduled.getMemo()) .setTransactionFee(scheduled.getTransactionFee()); @@ -759,7 +759,7 @@ public byte[] toBytes() { .setBodyBytes(bodyBuilder.build().toByteString()) .build(); - var transaction = com.hiero.sdk.proto.Transaction.newBuilder() + var transaction = org.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(signedTransaction.toByteString()) .build(); @@ -1247,7 +1247,7 @@ void buildTransaction(int index) { outerTransactions.set( index, - com.hiero.sdk.proto.Transaction.newBuilder() + org.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(innerSignedTransactions .get(index) .setSigMap(sigPairLists.get(index)) @@ -1292,7 +1292,7 @@ void signTransaction(int index) { abstract void onScheduled(SchedulableTransactionBody.Builder scheduled); @Override - final com.hiero.sdk.proto.Transaction makeRequest() { + final org.hiero.sdk.proto.Transaction makeRequest() { var index = nodeAccountIds.getIndex() + (transactionIds.getIndex() * nodeAccountIds.size()); buildTransaction(index); @@ -1302,9 +1302,9 @@ final com.hiero.sdk.proto.Transaction makeRequest() { @Override TransactionResponse mapResponse( - com.hiero.sdk.proto.TransactionResponse transactionResponse, + org.hiero.sdk.proto.TransactionResponse transactionResponse, AccountId nodeId, - com.hiero.sdk.proto.Transaction request) { + org.hiero.sdk.proto.Transaction request) { var transactionId = Objects.requireNonNull(getTransactionIdInternal()); var hash = hash(request.getSignedTransactionBytes().toByteArray()); transactionIds.advance(); @@ -1312,7 +1312,7 @@ TransactionResponse mapResponse( } @Override - final Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse transactionResponse) { + final Status mapResponseStatus(org.hiero.sdk.proto.TransactionResponse transactionResponse) { return Status.valueOf(transactionResponse.getNodeTransactionPrecheckCode()); } @@ -1354,7 +1354,7 @@ CompletableFuture onExecuteAsync(Client client) { } @Override - ExecutionState getExecutionState(Status status, com.hiero.sdk.proto.TransactionResponse response) { + ExecutionState getExecutionState(Status status, org.hiero.sdk.proto.TransactionResponse response) { if (status == Status.TRANSACTION_EXPIRED) { if ((regenerateTransactionId != null && !regenerateTransactionId) || transactionIds.isLocked()) { return ExecutionState.REQUEST_ERROR; diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java b/sdk/src/main/java/org/hiero/sdk/TransactionFeeSchedule.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java rename to sdk/src/main/java/org/hiero/sdk/TransactionFeeSchedule.java index 4f281480c2..e62d1fc76d 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionFeeSchedule.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionFeeSchedule.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; @@ -37,7 +37,7 @@ public TransactionFeeSchedule() { * @param transactionFeeSchedule the protobuf * @return the new transaction fee schedule */ - static TransactionFeeSchedule fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule transactionFeeSchedule) { + static TransactionFeeSchedule fromProtobuf(org.hiero.sdk.proto.TransactionFeeSchedule transactionFeeSchedule) { var returnFeeSchedule = new TransactionFeeSchedule() .setRequestType(RequestType.valueOf(transactionFeeSchedule.getHederaFunctionality())) .setFeeData( @@ -58,7 +58,7 @@ static TransactionFeeSchedule fromProtobuf(com.hiero.sdk.proto.TransactionFeeSch * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionFeeSchedule fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TransactionFeeSchedule.parseFrom(bytes).toBuilder() + return fromProtobuf(org.hiero.sdk.proto.TransactionFeeSchedule.parseFrom(bytes).toBuilder() .build()); } @@ -129,11 +129,11 @@ public TransactionFeeSchedule addFee(FeeData fee) { * Build the transaction body. * * @return {@link - * com.hiero.sdk.proto.TransactionFeeSchedule} + * org.hiero.sdk.proto.TransactionFeeSchedule} */ - com.hiero.sdk.proto.TransactionFeeSchedule toProtobuf() { + org.hiero.sdk.proto.TransactionFeeSchedule toProtobuf() { var returnBuilder = - com.hiero.sdk.proto.TransactionFeeSchedule.newBuilder().setHederaFunctionality(getRequestType().code); + org.hiero.sdk.proto.TransactionFeeSchedule.newBuilder().setHederaFunctionality(getRequestType().code); if (feeData != null) { returnBuilder.setFeeData(feeData.toProtobuf()); } diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionId.java b/sdk/src/main/java/org/hiero/sdk/TransactionId.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/TransactionId.java rename to sdk/src/main/java/org/hiero/sdk/TransactionId.java index 0dc4660032..5c3de01878 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionId.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionId.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static java.util.concurrent.CompletableFuture.completedFuture; import static java.util.concurrent.CompletableFuture.failedFuture; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.TransactionID; import java.time.Duration; import java.time.Instant; import java.util.Objects; @@ -83,7 +83,7 @@ public static TransactionId withValidStart(AccountId accountId, Instant validSta * that will be charged the transaction fees for the transaction. * * @param accountId the ID of the Hedera account that will be charge the transaction fees. - * @return {@link com.hiero.sdk.TransactionId} + * @return {@link org.hiero.sdk.TransactionId} */ public static TransactionId generate(AccountId accountId) { long currentTime; diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionReceipt.java b/sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/TransactionReceipt.java rename to sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java index 19b142ce3c..11a703ca6a 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionReceipt.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ExchangeRateSet; -import com.hiero.sdk.proto.TimestampSeconds; +import org.hiero.sdk.proto.ExchangeRateSet; +import org.hiero.sdk.proto.TimestampSeconds; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; @@ -170,7 +170,7 @@ public final class TransactionReceipt { * @return the new transaction receipt */ static TransactionReceipt fromProtobuf( - com.hiero.sdk.proto.TransactionReceipt transactionReceipt, + org.hiero.sdk.proto.TransactionReceipt transactionReceipt, List duplicates, List children, @Nullable TransactionId transactionId) { @@ -236,12 +236,12 @@ static TransactionReceipt fromProtobuf( * @param transactionReceipt the protobuf * @return the new transaction receipt */ - public static TransactionReceipt fromProtobuf(com.hiero.sdk.proto.TransactionReceipt transactionReceipt) { + public static TransactionReceipt fromProtobuf(org.hiero.sdk.proto.TransactionReceipt transactionReceipt) { return fromProtobuf(transactionReceipt, new ArrayList<>(), new ArrayList<>(), null); } static TransactionReceipt fromProtobuf( - com.hiero.sdk.proto.TransactionReceipt transactionReceipt, @Nullable TransactionId transactionId) { + org.hiero.sdk.proto.TransactionReceipt transactionReceipt, @Nullable TransactionId transactionId) { return fromProtobuf(transactionReceipt, new ArrayList<>(), new ArrayList<>(), transactionId); } @@ -253,7 +253,7 @@ static TransactionReceipt fromProtobuf( * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionReceipt fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TransactionReceipt.parseFrom(bytes).toBuilder() + return fromProtobuf(org.hiero.sdk.proto.TransactionReceipt.parseFrom(bytes).toBuilder() .build()); } @@ -276,11 +276,11 @@ public TransactionReceipt validateStatus(boolean shouldValidate) throws ReceiptS * * @return the protobuf representation */ - com.hiero.sdk.proto.TransactionReceipt toProtobuf() { - var transactionReceiptBuilder = com.hiero.sdk.proto.TransactionReceipt.newBuilder() + org.hiero.sdk.proto.TransactionReceipt toProtobuf() { + var transactionReceiptBuilder = org.hiero.sdk.proto.TransactionReceipt.newBuilder() .setStatus(status.code) .setExchangeRate(ExchangeRateSet.newBuilder() - .setCurrentRate(com.hiero.sdk.proto.ExchangeRate.newBuilder() + .setCurrentRate(org.hiero.sdk.proto.ExchangeRate.newBuilder() .setHbarEquiv(exchangeRate.hbars) .setCentEquiv(exchangeRate.cents) .setExpirationTime(TimestampSeconds.newBuilder() diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java b/sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java similarity index 91% rename from sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java rename to sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java index 17a5465cbb..2279463952 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionReceiptQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.TransactionGetReceiptQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TransactionGetReceiptQuery; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; @@ -114,7 +114,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TransactionGetReceiptQuery.newBuilder() .setIncludeChildReceipts(includeChildren) .setIncludeDuplicates(includeDuplicates); @@ -133,7 +133,7 @@ Status mapResponseStatus(Response response) { } @Override - TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + TransactionReceipt mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { var receiptResponse = response.getTransactionGetReceipt(); var duplicates = mapReceiptList(receiptResponse.getDuplicateTransactionReceiptsList()); var children = mapReceiptList(receiptResponse.getChildTransactionReceiptsList()); @@ -148,7 +148,7 @@ TransactionReceipt mapResponse(Response response, AccountId nodeId, com.hiero.sd * @return the list of transaction receipts */ private static List mapReceiptList( - List protoReceiptList) { + List protoReceiptList) { List outList = new ArrayList<>(protoReceiptList.size()); for (var protoReceipt : protoReceiptList) { outList.add(TransactionReceipt.fromProtobuf(protoReceipt)); @@ -157,7 +157,7 @@ private static List mapReceiptList( } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getTransactionGetReceipt().getHeader(); } @@ -167,7 +167,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetTransactionReceiptsMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java b/sdk/src/main/java/org/hiero/sdk/TransactionRecord.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/TransactionRecord.java rename to sdk/src/main/java/org/hiero/sdk/TransactionRecord.java index 8429d59556..ced18d4ca4 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionRecord.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionRecord.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AccountAmount; -import com.hiero.sdk.proto.NftTransfer; -import com.hiero.sdk.proto.TokenTransferList; -import com.hiero.sdk.proto.TransferList; +import org.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.NftTransfer; +import org.hiero.sdk.proto.TokenTransferList; +import org.hiero.sdk.proto.TransferList; import java.time.Instant; import java.util.ArrayList; import java.util.Collections; @@ -255,7 +255,7 @@ public final class TransactionRecord { * @return the new transaction record */ static TransactionRecord fromProtobuf( - com.hiero.sdk.proto.TransactionRecord transactionRecord, + org.hiero.sdk.proto.TransactionRecord transactionRecord, List children, List duplicates, @Nullable TransactionId transactionId) { @@ -351,7 +351,7 @@ static TransactionRecord fromProtobuf( * @param transactionRecord the protobuf * @return the new transaction record */ - static TransactionRecord fromProtobuf(com.hiero.sdk.proto.TransactionRecord transactionRecord) { + static TransactionRecord fromProtobuf(org.hiero.sdk.proto.TransactionRecord transactionRecord) { return fromProtobuf(transactionRecord, new ArrayList<>(), new ArrayList<>(), null); } @@ -363,7 +363,7 @@ static TransactionRecord fromProtobuf(com.hiero.sdk.proto.TransactionRecord tran * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ public static TransactionRecord fromBytes(byte[] bytes) throws InvalidProtocolBufferException { - return fromProtobuf(com.hiero.sdk.proto.TransactionRecord.parseFrom(bytes).toBuilder() + return fromProtobuf(org.hiero.sdk.proto.TransactionRecord.parseFrom(bytes).toBuilder() .build()); } @@ -384,13 +384,13 @@ public TransactionRecord validateReceiptStatus(boolean shouldValidate) throws Re * * @return the protobuf representation */ - com.hiero.sdk.proto.TransactionRecord toProtobuf() { + org.hiero.sdk.proto.TransactionRecord toProtobuf() { var transferList = TransferList.newBuilder(); for (Transfer transfer : transfers) { transferList.addAccountAmounts(transfer.toProtobuf()); } - var transactionRecord = com.hiero.sdk.proto.TransactionRecord.newBuilder() + var transactionRecord = org.hiero.sdk.proto.TransactionRecord.newBuilder() .setReceipt(receipt.toProtobuf()) .setTransactionHash(transactionHash) .setConsensusTimestamp(InstantConverter.toProtobuf(consensusTimestamp)) diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java b/sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java similarity index 92% rename from sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java rename to sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java index 13db046c9d..a6c202fef3 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionRecordQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.TransactionGetRecordQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TransactionGetRecordQuery; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; @@ -110,7 +110,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) { var builder = TransactionGetRecordQuery.newBuilder() .setIncludeChildRecords(includeChildren) .setIncludeDuplicates(includeDuplicates); @@ -127,12 +127,12 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return request.getTransactionGetRecord().getHeader(); } @Override - TransactionRecord mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) { + TransactionRecord mapResponse(Response response, AccountId nodeId, org.hiero.sdk.proto.Query request) { var recordResponse = response.getTransactionGetRecord(); List children = mapRecordList(recordResponse.getChildTransactionRecordsList()); List duplicates = mapRecordList(recordResponse.getDuplicateTransactionRecordsList()); @@ -140,7 +140,7 @@ TransactionRecord mapResponse(Response response, AccountId nodeId, com.hiero.sdk recordResponse.getTransactionRecord(), children, duplicates, transactionId); } - private List mapRecordList(List protoRecordList) { + private List mapRecordList(List protoRecordList) { List outList = new ArrayList<>(protoRecordList.size()); for (var protoRecord : protoRecordList) { outList.add(TransactionRecord.fromProtobuf(protoRecord)); @@ -149,7 +149,7 @@ private List mapRecordList(List getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getGetTxRecordByTxIDMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java b/sdk/src/main/java/org/hiero/sdk/TransactionResponse.java similarity index 98% rename from sdk/src/main/java/com/hiero/sdk/TransactionResponse.java rename to sdk/src/main/java/org/hiero/sdk/TransactionResponse.java index e451861a80..85396e8f7b 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransactionResponse.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionResponse.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import java.time.Duration; @@ -117,7 +117,7 @@ public TransactionReceipt getReceipt(Client client, Duration timeout) /** * Create receipt query from the {@link #transactionId} and {@link #transactionHash} * - * @return {@link com.hiero.sdk.TransactionReceiptQuery} + * @return {@link org.hiero.sdk.TransactionReceiptQuery} */ public TransactionReceiptQuery getReceiptQuery() { return new TransactionReceiptQuery() @@ -230,7 +230,7 @@ public TransactionRecord getRecord(Client client, Duration timeout) /** * Create record query from the {@link #transactionId} and {@link #transactionHash} * - * @return {@link com.hiero.sdk.TransactionRecordQuery} + * @return {@link org.hiero.sdk.TransactionRecordQuery} */ public TransactionRecordQuery getRecordQuery() { return new TransactionRecordQuery() diff --git a/sdk/src/main/java/com/hiero/sdk/Transfer.java b/sdk/src/main/java/org/hiero/sdk/Transfer.java similarity index 95% rename from sdk/src/main/java/com/hiero/sdk/Transfer.java rename to sdk/src/main/java/org/hiero/sdk/Transfer.java index 977a731b08..62e32693ce 100644 --- a/sdk/src/main/java/com/hiero/sdk/Transfer.java +++ b/sdk/src/main/java/org/hiero/sdk/Transfer.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; -import com.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.AccountAmount; /** * A transfer of Hbar that occurred within a transaction. diff --git a/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java b/sdk/src/main/java/org/hiero/sdk/TransferTransaction.java similarity index 93% rename from sdk/src/main/java/com/hiero/sdk/TransferTransaction.java rename to sdk/src/main/java/org/hiero/sdk/TransferTransaction.java index 75bf14b74e..a816251327 100644 --- a/sdk/src/main/java/com/hiero/sdk/TransferTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TransferTransaction.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AccountAmount; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.CryptoTransferTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; -import com.hiero.sdk.proto.TransferList; +import org.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.CryptoTransferTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.TransferList; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.Comparator; @@ -69,7 +69,7 @@ public TransferTransaction() { * @param txs Compound list of transaction id's list of (AccountId, Transaction) records * @throws InvalidProtocolBufferException when there is an issue with the protobuf */ - TransferTransaction(LinkedHashMap> txs) + TransferTransaction(LinkedHashMap> txs) throws InvalidProtocolBufferException { super(txs); initFromTransactionBody(); @@ -80,7 +80,7 @@ public TransferTransaction() { * * @param txBody protobuf TransactionBody */ - TransferTransaction(com.hiero.sdk.proto.TransactionBody txBody) { + TransferTransaction(org.hiero.sdk.proto.TransactionBody txBody) { super(txBody); initFromTransactionBody(); } @@ -171,7 +171,7 @@ public TransferTransaction setHbarTransferApproval(AccountId accountId, boolean /** * Build the transaction body. * - * @return {@link com.hiero.sdk.proto.CryptoTransferTransactionBody} + * @return {@link org.hiero.sdk.proto.CryptoTransferTransactionBody} */ CryptoTransferTransactionBody.Builder build() { var transfers = sortTransfersAndBuild(); @@ -202,7 +202,7 @@ void validateChecksums(Client client) throws BadEntityIdException { } @Override - MethodDescriptor getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return CryptoServiceGrpc.getCryptoTransferMethod(); } diff --git a/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java b/sdk/src/main/java/org/hiero/sdk/logger/LogLevel.java similarity index 90% rename from sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java rename to sdk/src/main/java/org/hiero/sdk/logger/LogLevel.java index 767149bf5b..1c0819050c 100644 --- a/sdk/src/main/java/com/hiero/sdk/logger/LogLevel.java +++ b/sdk/src/main/java/org/hiero/sdk/logger/LogLevel.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.logger; +package org.hiero.sdk.logger; public enum LogLevel { TRACE(0), diff --git a/sdk/src/main/java/com/hiero/sdk/logger/Logger.java b/sdk/src/main/java/org/hiero/sdk/logger/Logger.java similarity index 99% rename from sdk/src/main/java/com/hiero/sdk/logger/Logger.java rename to sdk/src/main/java/org/hiero/sdk/logger/Logger.java index 31bd28f9c2..3255625127 100644 --- a/sdk/src/main/java/com/hiero/sdk/logger/Logger.java +++ b/sdk/src/main/java/org/hiero/sdk/logger/Logger.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.logger; +package org.hiero.sdk.logger; import org.slf4j.LoggerFactory; diff --git a/sdk/src/main/java/com/hiero/sdk/package-info.java b/sdk/src/main/java/org/hiero/sdk/package-info.java similarity index 97% rename from sdk/src/main/java/com/hiero/sdk/package-info.java rename to sdk/src/main/java/org/hiero/sdk/package-info.java index 867a4c50eb..b7076599cb 100644 --- a/sdk/src/main/java/com/hiero/sdk/package-info.java +++ b/sdk/src/main/java/org/hiero/sdk/package-info.java @@ -19,6 +19,6 @@ * See Hedera Documentation */ @ParametersAreNonnullByDefault -package com.hiero.sdk; +package org.hiero.sdk; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java b/sdk/src/main/java/org/hiero/sdk/utils/Bip32Utils.java similarity index 96% rename from sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java rename to sdk/src/main/java/org/hiero/sdk/utils/Bip32Utils.java index df072171a9..626b37feff 100644 --- a/sdk/src/main/java/com/hiero/sdk/utils/Bip32Utils.java +++ b/sdk/src/main/java/org/hiero/sdk/utils/Bip32Utils.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.utils; +package org.hiero.sdk.utils; /** * Utility class for BIP32 functionalities diff --git a/sdk/src/main/proto/account.proto b/sdk/src/main/proto/account.proto index 84d180ac96..77ff83462f 100644 --- a/sdk/src/main/proto/account.proto +++ b/sdk/src/main/proto/account.proto @@ -25,7 +25,7 @@ package proto; import "common.proto"; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/account_pending_airdrop.proto b/sdk/src/main/proto/account_pending_airdrop.proto index 1dc83b0a50..b231dfc910 100644 --- a/sdk/src/main/proto/account_pending_airdrop.proto +++ b/sdk/src/main/proto/account_pending_airdrop.proto @@ -20,7 +20,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/address_book_service.proto b/sdk/src/main/proto/address_book_service.proto index 9833b7a4da..b84f1bb3e4 100644 --- a/sdk/src/main/proto/address_book_service.proto +++ b/sdk/src/main/proto/address_book_service.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/basic_types.proto b/sdk/src/main/proto/basic_types.proto index 4f367da90c..2fb7723e63 100644 --- a/sdk/src/main/proto/basic_types.proto +++ b/sdk/src/main/proto/basic_types.proto @@ -25,7 +25,7 @@ package proto; import "timestamp.proto"; import "google/protobuf/wrappers.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/block_info.proto b/sdk/src/main/proto/block_info.proto index 5276f0fd31..79482ecd1a 100644 --- a/sdk/src/main/proto/block_info.proto +++ b/sdk/src/main/proto/block_info.proto @@ -24,7 +24,7 @@ package proto; import "timestamp.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/block_stream_info.proto b/sdk/src/main/proto/block_stream_info.proto index 8d9a8c4bbf..57751a3ee2 100644 --- a/sdk/src/main/proto/block_stream_info.proto +++ b/sdk/src/main/proto/block_stream_info.proto @@ -33,7 +33,7 @@ package com.hedera.hapi.node.state.blockstream; import "timestamp.proto"; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/bytecode.proto b/sdk/src/main/proto/bytecode.proto index 4b44868b5c..ead12b2e2d 100644 --- a/sdk/src/main/proto/bytecode.proto +++ b/sdk/src/main/proto/bytecode.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/common.proto b/sdk/src/main/proto/common.proto index 32a61e8f42..5d82e17012 100644 --- a/sdk/src/main/proto/common.proto +++ b/sdk/src/main/proto/common.proto @@ -23,7 +23,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/congestion_level_starts.proto b/sdk/src/main/proto/congestion_level_starts.proto index 3ec209a896..7f0ce23799 100644 --- a/sdk/src/main/proto/congestion_level_starts.proto +++ b/sdk/src/main/proto/congestion_level_starts.proto @@ -24,7 +24,7 @@ package proto; import "timestamp.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_create_topic.proto b/sdk/src/main/proto/consensus_create_topic.proto index dc6b8b7ed6..00158b559e 100644 --- a/sdk/src/main/proto/consensus_create_topic.proto +++ b/sdk/src/main/proto/consensus_create_topic.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_delete_topic.proto b/sdk/src/main/proto/consensus_delete_topic.proto index 0d866c602c..b48c6b9aeb 100644 --- a/sdk/src/main/proto/consensus_delete_topic.proto +++ b/sdk/src/main/proto/consensus_delete_topic.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_get_topic_info.proto b/sdk/src/main/proto/consensus_get_topic_info.proto index 4a122e2ae5..93ca19f138 100644 --- a/sdk/src/main/proto/consensus_get_topic_info.proto +++ b/sdk/src/main/proto/consensus_get_topic_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_service.proto b/sdk/src/main/proto/consensus_service.proto index 066aca7fbc..27a1432404 100644 --- a/sdk/src/main/proto/consensus_service.proto +++ b/sdk/src/main/proto/consensus_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/consensus_submit_message.proto b/sdk/src/main/proto/consensus_submit_message.proto index cc90426713..abc408f1bc 100644 --- a/sdk/src/main/proto/consensus_submit_message.proto +++ b/sdk/src/main/proto/consensus_submit_message.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_topic_info.proto b/sdk/src/main/proto/consensus_topic_info.proto index 57210194cd..eaa0436e09 100644 --- a/sdk/src/main/proto/consensus_topic_info.proto +++ b/sdk/src/main/proto/consensus_topic_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/consensus_update_topic.proto b/sdk/src/main/proto/consensus_update_topic.proto index e2863a1ca4..3479b279bd 100644 --- a/sdk/src/main/proto/consensus_update_topic.proto +++ b/sdk/src/main/proto/consensus_update_topic.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_call.proto b/sdk/src/main/proto/contract_call.proto index 5295fae1e5..c70e5ccabc 100644 --- a/sdk/src/main/proto/contract_call.proto +++ b/sdk/src/main/proto/contract_call.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_call_local.proto b/sdk/src/main/proto/contract_call_local.proto index 0c08c4b394..94197cfe58 100644 --- a/sdk/src/main/proto/contract_call_local.proto +++ b/sdk/src/main/proto/contract_call_local.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_create.proto b/sdk/src/main/proto/contract_create.proto index a5ec140a78..fe55ab1e22 100644 --- a/sdk/src/main/proto/contract_create.proto +++ b/sdk/src/main/proto/contract_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_delete.proto b/sdk/src/main/proto/contract_delete.proto index 820fcd6c5e..1ad28dc4fb 100644 --- a/sdk/src/main/proto/contract_delete.proto +++ b/sdk/src/main/proto/contract_delete.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_get_bytecode.proto b/sdk/src/main/proto/contract_get_bytecode.proto index e6c83263ff..19bd364c0f 100644 --- a/sdk/src/main/proto/contract_get_bytecode.proto +++ b/sdk/src/main/proto/contract_get_bytecode.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_get_info.proto b/sdk/src/main/proto/contract_get_info.proto index 5b2a0044c5..7014f22184 100644 --- a/sdk/src/main/proto/contract_get_info.proto +++ b/sdk/src/main/proto/contract_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_get_records.proto b/sdk/src/main/proto/contract_get_records.proto index 8423c7e3ec..e9a9e0250a 100644 --- a/sdk/src/main/proto/contract_get_records.proto +++ b/sdk/src/main/proto/contract_get_records.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_types.proto b/sdk/src/main/proto/contract_types.proto index d07b3a4543..a938d149f2 100644 --- a/sdk/src/main/proto/contract_types.proto +++ b/sdk/src/main/proto/contract_types.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/contract_update.proto b/sdk/src/main/proto/contract_update.proto index a0981154bc..9284336957 100644 --- a/sdk/src/main/proto/contract_update.proto +++ b/sdk/src/main/proto/contract_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_add_live_hash.proto b/sdk/src/main/proto/crypto_add_live_hash.proto index c508a8724d..40f96c2cb5 100644 --- a/sdk/src/main/proto/crypto_add_live_hash.proto +++ b/sdk/src/main/proto/crypto_add_live_hash.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_approve_allowance.proto b/sdk/src/main/proto/crypto_approve_allowance.proto index 88b9f3433a..310740974d 100644 --- a/sdk/src/main/proto/crypto_approve_allowance.proto +++ b/sdk/src/main/proto/crypto_approve_allowance.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_create.proto b/sdk/src/main/proto/crypto_create.proto index 2514bde214..efcb9b4428 100644 --- a/sdk/src/main/proto/crypto_create.proto +++ b/sdk/src/main/proto/crypto_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_delete.proto b/sdk/src/main/proto/crypto_delete.proto index efd2619c80..a1a993e316 100644 --- a/sdk/src/main/proto/crypto_delete.proto +++ b/sdk/src/main/proto/crypto_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_delete_allowance.proto b/sdk/src/main/proto/crypto_delete_allowance.proto index a398989009..d75eb2dd99 100644 --- a/sdk/src/main/proto/crypto_delete_allowance.proto +++ b/sdk/src/main/proto/crypto_delete_allowance.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_delete_live_hash.proto b/sdk/src/main/proto/crypto_delete_live_hash.proto index 28ef28965b..e8d436c702 100644 --- a/sdk/src/main/proto/crypto_delete_live_hash.proto +++ b/sdk/src/main/proto/crypto_delete_live_hash.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_account_balance.proto b/sdk/src/main/proto/crypto_get_account_balance.proto index ffde341563..084148fa43 100644 --- a/sdk/src/main/proto/crypto_get_account_balance.proto +++ b/sdk/src/main/proto/crypto_get_account_balance.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_account_records.proto b/sdk/src/main/proto/crypto_get_account_records.proto index 889989d3a7..949fe2d434 100644 --- a/sdk/src/main/proto/crypto_get_account_records.proto +++ b/sdk/src/main/proto/crypto_get_account_records.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_info.proto b/sdk/src/main/proto/crypto_get_info.proto index d3c111e2c0..fb4e17104b 100644 --- a/sdk/src/main/proto/crypto_get_info.proto +++ b/sdk/src/main/proto/crypto_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_live_hash.proto b/sdk/src/main/proto/crypto_get_live_hash.proto index 98da20e637..a56042f766 100644 --- a/sdk/src/main/proto/crypto_get_live_hash.proto +++ b/sdk/src/main/proto/crypto_get_live_hash.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_get_stakers.proto b/sdk/src/main/proto/crypto_get_stakers.proto index 008f215e88..763a00a365 100644 --- a/sdk/src/main/proto/crypto_get_stakers.proto +++ b/sdk/src/main/proto/crypto_get_stakers.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_service.proto b/sdk/src/main/proto/crypto_service.proto index 0a0ede7761..295477437b 100644 --- a/sdk/src/main/proto/crypto_service.proto +++ b/sdk/src/main/proto/crypto_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/crypto_transfer.proto b/sdk/src/main/proto/crypto_transfer.proto index 47dc017825..f8a1896250 100644 --- a/sdk/src/main/proto/crypto_transfer.proto +++ b/sdk/src/main/proto/crypto_transfer.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/crypto_update.proto b/sdk/src/main/proto/crypto_update.proto index cdaf16e9c0..d234328226 100644 --- a/sdk/src/main/proto/crypto_update.proto +++ b/sdk/src/main/proto/crypto_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/custom_fees.proto b/sdk/src/main/proto/custom_fees.proto index bccb3d9529..6f49ebded7 100644 --- a/sdk/src/main/proto/custom_fees.proto +++ b/sdk/src/main/proto/custom_fees.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/duration.proto b/sdk/src/main/proto/duration.proto index 82bcf88367..1665380874 100644 --- a/sdk/src/main/proto/duration.proto +++ b/sdk/src/main/proto/duration.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/ethereum_transaction.proto b/sdk/src/main/proto/ethereum_transaction.proto index 7a2be5bc73..31065f7ae6 100644 --- a/sdk/src/main/proto/ethereum_transaction.proto +++ b/sdk/src/main/proto/ethereum_transaction.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/exchange_rate.proto b/sdk/src/main/proto/exchange_rate.proto index 0ed1957749..1d7c02b075 100644 --- a/sdk/src/main/proto/exchange_rate.proto +++ b/sdk/src/main/proto/exchange_rate.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file.proto b/sdk/src/main/proto/file.proto index edf11936df..4d7c61ef6c 100644 --- a/sdk/src/main/proto/file.proto +++ b/sdk/src/main/proto/file.proto @@ -24,7 +24,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_append.proto b/sdk/src/main/proto/file_append.proto index 6be74beb3b..60ff77560d 100644 --- a/sdk/src/main/proto/file_append.proto +++ b/sdk/src/main/proto/file_append.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_create.proto b/sdk/src/main/proto/file_create.proto index 490487020a..be6ed1eabe 100644 --- a/sdk/src/main/proto/file_create.proto +++ b/sdk/src/main/proto/file_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_delete.proto b/sdk/src/main/proto/file_delete.proto index ee9fc3a422..6f0ce2ef9e 100644 --- a/sdk/src/main/proto/file_delete.proto +++ b/sdk/src/main/proto/file_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_get_contents.proto b/sdk/src/main/proto/file_get_contents.proto index 06138d8f82..21b4badfd0 100644 --- a/sdk/src/main/proto/file_get_contents.proto +++ b/sdk/src/main/proto/file_get_contents.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_get_info.proto b/sdk/src/main/proto/file_get_info.proto index 6458fe4fbf..fbd197f997 100644 --- a/sdk/src/main/proto/file_get_info.proto +++ b/sdk/src/main/proto/file_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/file_service.proto b/sdk/src/main/proto/file_service.proto index febe0228cd..8fc9ab0ed1 100644 --- a/sdk/src/main/proto/file_service.proto +++ b/sdk/src/main/proto/file_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/file_update.proto b/sdk/src/main/proto/file_update.proto index 9ed5c50bbd..bad7043509 100644 --- a/sdk/src/main/proto/file_update.proto +++ b/sdk/src/main/proto/file_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/freeze.proto b/sdk/src/main/proto/freeze.proto index 31699dea42..e44ca78731 100644 --- a/sdk/src/main/proto/freeze.proto +++ b/sdk/src/main/proto/freeze.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/freeze_service.proto b/sdk/src/main/proto/freeze_service.proto index 988b31245d..f797711734 100644 --- a/sdk/src/main/proto/freeze_service.proto +++ b/sdk/src/main/proto/freeze_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "transaction_response.proto"; diff --git a/sdk/src/main/proto/freeze_type.proto b/sdk/src/main/proto/freeze_type.proto index 7931ec8630..d20807568f 100644 --- a/sdk/src/main/proto/freeze_type.proto +++ b/sdk/src/main/proto/freeze_type.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/get_account_details.proto b/sdk/src/main/proto/get_account_details.proto index 17db5948fe..b213c57b63 100644 --- a/sdk/src/main/proto/get_account_details.proto +++ b/sdk/src/main/proto/get_account_details.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/get_by_key.proto b/sdk/src/main/proto/get_by_key.proto index 2bb5ff2bd1..2c06233eda 100644 --- a/sdk/src/main/proto/get_by_key.proto +++ b/sdk/src/main/proto/get_by_key.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/get_by_solidity_id.proto b/sdk/src/main/proto/get_by_solidity_id.proto index fd26baea4f..6921fb5be3 100644 --- a/sdk/src/main/proto/get_by_solidity_id.proto +++ b/sdk/src/main/proto/get_by_solidity_id.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/ledger_id.proto b/sdk/src/main/proto/ledger_id.proto index 7ad72a6088..de11594d28 100644 --- a/sdk/src/main/proto/ledger_id.proto +++ b/sdk/src/main/proto/ledger_id.proto @@ -33,7 +33,7 @@ package com.hedera.hapi.node.state.roster; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/mirror/consensus_service.proto b/sdk/src/main/proto/mirror/consensus_service.proto index 217d324c12..a16bda881c 100644 --- a/sdk/src/main/proto/mirror/consensus_service.proto +++ b/sdk/src/main/proto/mirror/consensus_service.proto @@ -27,7 +27,7 @@ package com.hedera.mirror.api.proto; */ option java_multiple_files = true; -option java_package = "com.hiero.sdk.proto.mirror"; +option java_package = "org.hiero.sdk.proto.mirror"; import "basic_types.proto"; import "timestamp.proto"; diff --git a/sdk/src/main/proto/mirror/mirror_network_service.proto b/sdk/src/main/proto/mirror/mirror_network_service.proto index d2f8d3c299..f39b01db62 100644 --- a/sdk/src/main/proto/mirror/mirror_network_service.proto +++ b/sdk/src/main/proto/mirror/mirror_network_service.proto @@ -23,7 +23,7 @@ syntax = "proto3"; package com.hedera.mirror.api.proto; option java_multiple_files = true; // Required for the reactor-grpc generator to work correctly -option java_package = "com.hiero.sdk.proto.mirror"; +option java_package = "org.hiero.sdk.proto.mirror"; import "basic_types.proto"; import "timestamp.proto"; diff --git a/sdk/src/main/proto/network_get_execution_time.proto b/sdk/src/main/proto/network_get_execution_time.proto index 6093896208..5f360768f4 100644 --- a/sdk/src/main/proto/network_get_execution_time.proto +++ b/sdk/src/main/proto/network_get_execution_time.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/network_get_version_info.proto b/sdk/src/main/proto/network_get_version_info.proto index ca97df7361..f144b9dff4 100644 --- a/sdk/src/main/proto/network_get_version_info.proto +++ b/sdk/src/main/proto/network_get_version_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/network_service.proto b/sdk/src/main/proto/network_service.proto index 488e977468..786f8b0baa 100644 --- a/sdk/src/main/proto/network_service.proto +++ b/sdk/src/main/proto/network_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/network_staking_rewards.proto b/sdk/src/main/proto/network_staking_rewards.proto index 608c9f9c87..6cb73eb8c0 100644 --- a/sdk/src/main/proto/network_staking_rewards.proto +++ b/sdk/src/main/proto/network_staking_rewards.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/nft.proto b/sdk/src/main/proto/nft.proto index 2ecc59a043..9e28c647fb 100644 --- a/sdk/src/main/proto/nft.proto +++ b/sdk/src/main/proto/nft.proto @@ -25,7 +25,7 @@ package proto; import "timestamp.proto"; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node.proto b/sdk/src/main/proto/node.proto index 57ce0df896..161233eab5 100644 --- a/sdk/src/main/proto/node.proto +++ b/sdk/src/main/proto/node.proto @@ -20,7 +20,7 @@ package com.hedera.hapi.node.state.addressbook; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_create.proto b/sdk/src/main/proto/node_create.proto index 9fe24f7702..3080b7923a 100644 --- a/sdk/src/main/proto/node_create.proto +++ b/sdk/src/main/proto/node_create.proto @@ -18,7 +18,7 @@ package com.hedera.hapi.node.addressbook; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_delete.proto b/sdk/src/main/proto/node_delete.proto index c30a79629e..73280b8b5b 100644 --- a/sdk/src/main/proto/node_delete.proto +++ b/sdk/src/main/proto/node_delete.proto @@ -18,7 +18,7 @@ package com.hedera.hapi.node.addressbook; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_stake_update.proto b/sdk/src/main/proto/node_stake_update.proto index 51062220f1..c055e6d3d2 100644 --- a/sdk/src/main/proto/node_stake_update.proto +++ b/sdk/src/main/proto/node_stake_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/node_update.proto b/sdk/src/main/proto/node_update.proto index 0b20565625..201f42effc 100644 --- a/sdk/src/main/proto/node_update.proto +++ b/sdk/src/main/proto/node_update.proto @@ -18,7 +18,7 @@ package com.hedera.hapi.node.addressbook; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/primitives.proto b/sdk/src/main/proto/primitives.proto index 6c2fc73c58..614bdf80b5 100644 --- a/sdk/src/main/proto/primitives.proto +++ b/sdk/src/main/proto/primitives.proto @@ -24,7 +24,7 @@ package proto; * type instead. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/query.proto b/sdk/src/main/proto/query.proto index a7734d611c..0e10710288 100644 --- a/sdk/src/main/proto/query.proto +++ b/sdk/src/main/proto/query.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/query_header.proto b/sdk/src/main/proto/query_header.proto index 6f9061ced3..869ea74de9 100644 --- a/sdk/src/main/proto/query_header.proto +++ b/sdk/src/main/proto/query_header.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/recordcache.proto b/sdk/src/main/proto/recordcache.proto index c3cd55f489..affffb6265 100644 --- a/sdk/src/main/proto/recordcache.proto +++ b/sdk/src/main/proto/recordcache.proto @@ -34,7 +34,7 @@ import "basic_types.proto"; import "transaction_record.proto"; import "response_code.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/response.proto b/sdk/src/main/proto/response.proto index 42ccb7a4ba..7a74eaf149 100644 --- a/sdk/src/main/proto/response.proto +++ b/sdk/src/main/proto/response.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/response_code.proto b/sdk/src/main/proto/response_code.proto index 0d11f7ee34..77ba49d99c 100644 --- a/sdk/src/main/proto/response_code.proto +++ b/sdk/src/main/proto/response_code.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/response_header.proto b/sdk/src/main/proto/response_header.proto index 03b5909707..acb20ed211 100644 --- a/sdk/src/main/proto/response_header.proto +++ b/sdk/src/main/proto/response_header.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/roster.proto b/sdk/src/main/proto/roster.proto index 5249b54e49..587c9d18fa 100644 --- a/sdk/src/main/proto/roster.proto +++ b/sdk/src/main/proto/roster.proto @@ -20,7 +20,7 @@ package com.hedera.hapi.node.state.roster; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/roster_state.proto b/sdk/src/main/proto/roster_state.proto index 00ec76dacc..bb63f949ae 100644 --- a/sdk/src/main/proto/roster_state.proto +++ b/sdk/src/main/proto/roster_state.proto @@ -20,7 +20,7 @@ package com.hedera.hapi.node.state.roster; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/running_hashes.proto b/sdk/src/main/proto/running_hashes.proto index 331104c613..2e5989b10c 100644 --- a/sdk/src/main/proto/running_hashes.proto +++ b/sdk/src/main/proto/running_hashes.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedulable_transaction_body.proto b/sdk/src/main/proto/schedulable_transaction_body.proto index 9e665a07ef..c2d38b2e27 100644 --- a/sdk/src/main/proto/schedulable_transaction_body.proto +++ b/sdk/src/main/proto/schedulable_transaction_body.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule.proto b/sdk/src/main/proto/schedule.proto index d69f79f1d1..39dea43c11 100644 --- a/sdk/src/main/proto/schedule.proto +++ b/sdk/src/main/proto/schedule.proto @@ -27,7 +27,7 @@ import "timestamp.proto"; import "schedulable_transaction_body.proto"; import "transaction_body.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule_create.proto b/sdk/src/main/proto/schedule_create.proto index 87884104e5..3dfcfb541b 100644 --- a/sdk/src/main/proto/schedule_create.proto +++ b/sdk/src/main/proto/schedule_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule_delete.proto b/sdk/src/main/proto/schedule_delete.proto index ef3524e125..ebd39943f7 100644 --- a/sdk/src/main/proto/schedule_delete.proto +++ b/sdk/src/main/proto/schedule_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule_get_info.proto b/sdk/src/main/proto/schedule_get_info.proto index b6db558bf3..9964a15861 100644 --- a/sdk/src/main/proto/schedule_get_info.proto +++ b/sdk/src/main/proto/schedule_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/schedule_service.proto b/sdk/src/main/proto/schedule_service.proto index cc9d8eb4c0..15a2f29e83 100644 --- a/sdk/src/main/proto/schedule_service.proto +++ b/sdk/src/main/proto/schedule_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/schedule_sign.proto b/sdk/src/main/proto/schedule_sign.proto index ccc1076530..f5d78b9248 100644 --- a/sdk/src/main/proto/schedule_sign.proto +++ b/sdk/src/main/proto/schedule_sign.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/smart_contract_service.proto b/sdk/src/main/proto/smart_contract_service.proto index a4f8762166..2c7199a92d 100644 --- a/sdk/src/main/proto/smart_contract_service.proto +++ b/sdk/src/main/proto/smart_contract_service.proto @@ -21,7 +21,7 @@ package proto; * limitations under the License. * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "transaction_response.proto"; diff --git a/sdk/src/main/proto/staking_node_info.proto b/sdk/src/main/proto/staking_node_info.proto index 35daae8b09..6de150a697 100644 --- a/sdk/src/main/proto/staking_node_info.proto +++ b/sdk/src/main/proto/staking_node_info.proto @@ -25,7 +25,7 @@ package proto; import "common.proto"; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/storage_slot.proto b/sdk/src/main/proto/storage_slot.proto index 2a360674d7..6a2ffd8d59 100644 --- a/sdk/src/main/proto/storage_slot.proto +++ b/sdk/src/main/proto/storage_slot.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/system_delete.proto b/sdk/src/main/proto/system_delete.proto index a1cbe1605a..12df065d9b 100644 --- a/sdk/src/main/proto/system_delete.proto +++ b/sdk/src/main/proto/system_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/system_undelete.proto b/sdk/src/main/proto/system_undelete.proto index c4ea24e778..d8c6d827f6 100644 --- a/sdk/src/main/proto/system_undelete.proto +++ b/sdk/src/main/proto/system_undelete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/throttle_definitions.proto b/sdk/src/main/proto/throttle_definitions.proto index 2917919120..1a345a6bbf 100644 --- a/sdk/src/main/proto/throttle_definitions.proto +++ b/sdk/src/main/proto/throttle_definitions.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/throttle_usage_snapshots.proto b/sdk/src/main/proto/throttle_usage_snapshots.proto index 71187dd74d..5d97bdc2f9 100644 --- a/sdk/src/main/proto/throttle_usage_snapshots.proto +++ b/sdk/src/main/proto/throttle_usage_snapshots.proto @@ -24,7 +24,7 @@ package proto; import "timestamp.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/timestamp.proto b/sdk/src/main/proto/timestamp.proto index 7e612b8cdc..b2370c79ec 100644 --- a/sdk/src/main/proto/timestamp.proto +++ b/sdk/src/main/proto/timestamp.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token.proto b/sdk/src/main/proto/token.proto index f3cc2fe757..9a22ef9c9f 100644 --- a/sdk/src/main/proto/token.proto +++ b/sdk/src/main/proto/token.proto @@ -25,7 +25,7 @@ package proto; import "basic_types.proto"; import "custom_fees.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_airdrop.proto b/sdk/src/main/proto/token_airdrop.proto index 88a2851634..83f56b335d 100644 --- a/sdk/src/main/proto/token_airdrop.proto +++ b/sdk/src/main/proto/token_airdrop.proto @@ -30,7 +30,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_associate.proto b/sdk/src/main/proto/token_associate.proto index ae763bb4e2..f310263667 100644 --- a/sdk/src/main/proto/token_associate.proto +++ b/sdk/src/main/proto/token_associate.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_burn.proto b/sdk/src/main/proto/token_burn.proto index 7c0f1c0dc6..1ef5e098ba 100644 --- a/sdk/src/main/proto/token_burn.proto +++ b/sdk/src/main/proto/token_burn.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_cancel_airdrop.proto b/sdk/src/main/proto/token_cancel_airdrop.proto index 34bbb319f9..d7f90d342b 100644 --- a/sdk/src/main/proto/token_cancel_airdrop.proto +++ b/sdk/src/main/proto/token_cancel_airdrop.proto @@ -28,7 +28,7 @@ package proto; * */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_claim_airdrop.proto b/sdk/src/main/proto/token_claim_airdrop.proto index e331b66621..c5d4157f2a 100644 --- a/sdk/src/main/proto/token_claim_airdrop.proto +++ b/sdk/src/main/proto/token_claim_airdrop.proto @@ -28,7 +28,7 @@ package proto; * */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_create.proto b/sdk/src/main/proto/token_create.proto index 47f97f9cad..7e41f8a50f 100644 --- a/sdk/src/main/proto/token_create.proto +++ b/sdk/src/main/proto/token_create.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_delete.proto b/sdk/src/main/proto/token_delete.proto index 2bf5c3ae58..ba8b71de5b 100644 --- a/sdk/src/main/proto/token_delete.proto +++ b/sdk/src/main/proto/token_delete.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_dissociate.proto b/sdk/src/main/proto/token_dissociate.proto index f10359f4c5..aa7d2905e2 100644 --- a/sdk/src/main/proto/token_dissociate.proto +++ b/sdk/src/main/proto/token_dissociate.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_fee_schedule_update.proto b/sdk/src/main/proto/token_fee_schedule_update.proto index 71d6e42883..1de22349fc 100644 --- a/sdk/src/main/proto/token_fee_schedule_update.proto +++ b/sdk/src/main/proto/token_fee_schedule_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_freeze_account.proto b/sdk/src/main/proto/token_freeze_account.proto index 47afe04dcb..0ba5ef1cd8 100644 --- a/sdk/src/main/proto/token_freeze_account.proto +++ b/sdk/src/main/proto/token_freeze_account.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_get_account_nft_infos.proto b/sdk/src/main/proto/token_get_account_nft_infos.proto index 6131985589..7e5bbc4b5f 100644 --- a/sdk/src/main/proto/token_get_account_nft_infos.proto +++ b/sdk/src/main/proto/token_get_account_nft_infos.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_get_info.proto b/sdk/src/main/proto/token_get_info.proto index d867ab6ab8..14b5c7ab11 100644 --- a/sdk/src/main/proto/token_get_info.proto +++ b/sdk/src/main/proto/token_get_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_get_nft_info.proto b/sdk/src/main/proto/token_get_nft_info.proto index 6daa850485..b82a69fbb4 100644 --- a/sdk/src/main/proto/token_get_nft_info.proto +++ b/sdk/src/main/proto/token_get_nft_info.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_get_nft_infos.proto b/sdk/src/main/proto/token_get_nft_infos.proto index 09e3df18f1..979c6eee1d 100644 --- a/sdk/src/main/proto/token_get_nft_infos.proto +++ b/sdk/src/main/proto/token_get_nft_infos.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_grant_kyc.proto b/sdk/src/main/proto/token_grant_kyc.proto index b82410f3f3..73f786e33a 100644 --- a/sdk/src/main/proto/token_grant_kyc.proto +++ b/sdk/src/main/proto/token_grant_kyc.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_mint.proto b/sdk/src/main/proto/token_mint.proto index 0dd38f7057..e899bca749 100644 --- a/sdk/src/main/proto/token_mint.proto +++ b/sdk/src/main/proto/token_mint.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_pause.proto b/sdk/src/main/proto/token_pause.proto index 905a9c4b12..b275d47145 100644 --- a/sdk/src/main/proto/token_pause.proto +++ b/sdk/src/main/proto/token_pause.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_reject.proto b/sdk/src/main/proto/token_reject.proto index 246467ce24..0be0640452 100644 --- a/sdk/src/main/proto/token_reject.proto +++ b/sdk/src/main/proto/token_reject.proto @@ -32,7 +32,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_relation.proto b/sdk/src/main/proto/token_relation.proto index cc37239877..4462b5328d 100644 --- a/sdk/src/main/proto/token_relation.proto +++ b/sdk/src/main/proto/token_relation.proto @@ -24,7 +24,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; /** diff --git a/sdk/src/main/proto/token_revoke_kyc.proto b/sdk/src/main/proto/token_revoke_kyc.proto index b207c0e6b0..dfd489411e 100644 --- a/sdk/src/main/proto/token_revoke_kyc.proto +++ b/sdk/src/main/proto/token_revoke_kyc.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; option java_multiple_files = true; // <<>> This comment is special code for setting PBJ Compiler java package diff --git a/sdk/src/main/proto/token_service.proto b/sdk/src/main/proto/token_service.proto index a1177ce99e..d6547d3458 100644 --- a/sdk/src/main/proto/token_service.proto +++ b/sdk/src/main/proto/token_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "query.proto"; diff --git a/sdk/src/main/proto/token_unfreeze_account.proto b/sdk/src/main/proto/token_unfreeze_account.proto index e0cd170c4a..216a84f440 100644 --- a/sdk/src/main/proto/token_unfreeze_account.proto +++ b/sdk/src/main/proto/token_unfreeze_account.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_unpause.proto b/sdk/src/main/proto/token_unpause.proto index 6954815b4b..ee3a928e04 100644 --- a/sdk/src/main/proto/token_unpause.proto +++ b/sdk/src/main/proto/token_unpause.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_update.proto b/sdk/src/main/proto/token_update.proto index 8e528d61a3..956a1e7623 100644 --- a/sdk/src/main/proto/token_update.proto +++ b/sdk/src/main/proto/token_update.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_update_nfts.proto b/sdk/src/main/proto/token_update_nfts.proto index 42d557cdd0..e7206a1e1e 100644 --- a/sdk/src/main/proto/token_update_nfts.proto +++ b/sdk/src/main/proto/token_update_nfts.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/token_wipe_account.proto b/sdk/src/main/proto/token_wipe_account.proto index 8ad292a11c..81a4c3bbeb 100644 --- a/sdk/src/main/proto/token_wipe_account.proto +++ b/sdk/src/main/proto/token_wipe_account.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/topic.proto b/sdk/src/main/proto/topic.proto index 5340f9023e..612881a373 100644 --- a/sdk/src/main/proto/topic.proto +++ b/sdk/src/main/proto/topic.proto @@ -24,7 +24,7 @@ package proto; import "basic_types.proto"; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction.proto b/sdk/src/main/proto/transaction.proto index 5e2adc7b2c..a9c7ad0eed 100644 --- a/sdk/src/main/proto/transaction.proto +++ b/sdk/src/main/proto/transaction.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_body.proto b/sdk/src/main/proto/transaction_body.proto index cc7feb701e..ef4abf6ce4 100644 --- a/sdk/src/main/proto/transaction_body.proto +++ b/sdk/src/main/proto/transaction_body.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_contents.proto b/sdk/src/main/proto/transaction_contents.proto index 76826ef792..7ac643322b 100644 --- a/sdk/src/main/proto/transaction_contents.proto +++ b/sdk/src/main/proto/transaction_contents.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_get_fast_record.proto b/sdk/src/main/proto/transaction_get_fast_record.proto index bea0e79c93..10ac2d27ce 100644 --- a/sdk/src/main/proto/transaction_get_fast_record.proto +++ b/sdk/src/main/proto/transaction_get_fast_record.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_get_receipt.proto b/sdk/src/main/proto/transaction_get_receipt.proto index 7a469aab66..5315456b98 100644 --- a/sdk/src/main/proto/transaction_get_receipt.proto +++ b/sdk/src/main/proto/transaction_get_receipt.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_get_record.proto b/sdk/src/main/proto/transaction_get_record.proto index 8f53e5956a..0321477456 100644 --- a/sdk/src/main/proto/transaction_get_record.proto +++ b/sdk/src/main/proto/transaction_get_record.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_list.proto b/sdk/src/main/proto/transaction_list.proto index f0bf8fb85f..a6a7b92418 100644 --- a/sdk/src/main/proto/transaction_list.proto +++ b/sdk/src/main/proto/transaction_list.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package proto; -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; option java_multiple_files = true; import "transaction.proto"; diff --git a/sdk/src/main/proto/transaction_receipt.proto b/sdk/src/main/proto/transaction_receipt.proto index 6a715c650f..f50f6c32ab 100644 --- a/sdk/src/main/proto/transaction_receipt.proto +++ b/sdk/src/main/proto/transaction_receipt.proto @@ -18,7 +18,7 @@ package proto; * limitations under the License. */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_record.proto b/sdk/src/main/proto/transaction_record.proto index 7222a404c0..3efeca6f66 100644 --- a/sdk/src/main/proto/transaction_record.proto +++ b/sdk/src/main/proto/transaction_record.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/transaction_response.proto b/sdk/src/main/proto/transaction_response.proto index fceb66b4ab..c3136023ae 100644 --- a/sdk/src/main/proto/transaction_response.proto +++ b/sdk/src/main/proto/transaction_response.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/unchecked_submit.proto b/sdk/src/main/proto/unchecked_submit.proto index fbc39b2168..7aff81bb62 100644 --- a/sdk/src/main/proto/unchecked_submit.proto +++ b/sdk/src/main/proto/unchecked_submit.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/util_prng.proto b/sdk/src/main/proto/util_prng.proto index a13a6f18f8..17af031603 100644 --- a/sdk/src/main/proto/util_prng.proto +++ b/sdk/src/main/proto/util_prng.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/util_service.proto b/sdk/src/main/proto/util_service.proto index 2c343a17ec..ac784ea24c 100644 --- a/sdk/src/main/proto/util_service.proto +++ b/sdk/src/main/proto/util_service.proto @@ -22,7 +22,7 @@ package proto; * ‍ */ -option java_package = "com.hiero.sdk.proto"; +option java_package = "org.hiero.sdk.proto"; // <<>> This comment is special code for setting PBJ Compiler java package import "transaction_response.proto"; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap deleted file mode 100644 index 39f2d34f56..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hiero.sdk.AccountBalanceQueryTest.shouldSerializeWithAccountId=[ - "# com.hiero.sdk.proto.Query\ncryptoget_account_balance {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] - - -com.hiero.sdk.AccountBalanceQueryTest.shouldSerializeWithContractId=[ - "# com.hiero.sdk.proto.Query\ncryptoget_account_balance {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap deleted file mode 100644 index 289a1aa090..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.snap +++ /dev/null @@ -1,88 +0,0 @@ -com.hiero.sdk.AccountIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hiero.sdk.AccountIdTest.fromBytesAlias=[ - "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" -] - - -com.hiero.sdk.AccountIdTest.fromBytesAliasEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hiero.sdk.AccountIdTest.fromBytesEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hiero.sdk.AccountIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hiero.sdk.AccountIdTest.fromSolidityAddressWith0x=[ - "0.0.5005" -] - - -com.hiero.sdk.AccountIdTest.fromString=[ - "0.0.5005" -] - - -com.hiero.sdk.AccountIdTest.fromStringWithAliasEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hiero.sdk.AccountIdTest.fromStringWithAliasKey=[ - "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" -] - - -com.hiero.sdk.AccountIdTest.fromStringWithChecksumOnMainnet=[ - "0.0.123-vfmkw" -] - - -com.hiero.sdk.AccountIdTest.fromStringWithChecksumOnPreviewnet=[ - "0.0.123-ogizo" -] - - -com.hiero.sdk.AccountIdTest.fromStringWithChecksumOnTestnet=[ - "0.0.123-esxsf" -] - - -com.hiero.sdk.AccountIdTest.fromStringWithEvmAddress=[ - "0.0.302a300506032b6570032100114e6abc371b82da" -] - - -com.hiero.sdk.AccountIdTest.toBytes=[ - "188d27" -] - - -com.hiero.sdk.AccountIdTest.toBytesAlias=[ - "22221220114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" -] - - -com.hiero.sdk.AccountIdTest.toBytesAliasEvmAddress=[ - "2214302a300506032b6570032100114e6abc371b82da" -] - - -com.hiero.sdk.AccountIdTest.toBytesEvmAddress=[ - "2214302a300506032b6570032100114e6abc371b82da" -] - - -com.hiero.sdk.AccountIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap deleted file mode 100644 index 9e0c4c0e64..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.AccountInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncrypto_get_info {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap deleted file mode 100644 index cbc326c928..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.AccountRecordsQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncrypto_get_account_records {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap deleted file mode 100644 index 656e9a08af..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.AccountStakersQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncrypto_get_proxy_stakers {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap deleted file mode 100644 index b539f7baa9..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.ContractByteCodeQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncontract_get_bytecode {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap deleted file mode 100644 index 6f5b754b88..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.snap +++ /dev/null @@ -1,48 +0,0 @@ -com.hiero.sdk.ContractIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hiero.sdk.ContractIdTest.fromEvmAddress=[ - "1.2.98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hiero.sdk.ContractIdTest.fromEvmAddressWith0x=[ - "1.2.98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hiero.sdk.ContractIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hiero.sdk.ContractIdTest.fromSolidityAddressWith0x=[ - "0.0.5005" -] - - -com.hiero.sdk.ContractIdTest.fromString=[ - "0.0.5005" -] - - -com.hiero.sdk.ContractIdTest.fromStringWithEvmAddress=[ - "1.2.98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hiero.sdk.ContractIdTest.toBytes=[ - "188d27" -] - - -com.hiero.sdk.ContractIdTest.toSolidityAddress2=[ - "98329e006610472e6b372c080833f6d79ed833cf" -] - - -com.hiero.sdk.ContractIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap deleted file mode 100644 index 9ba7f7a12d..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.ContractInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncontract_get_info {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap b/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap deleted file mode 100644 index 43fc7644b3..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.snap +++ /dev/null @@ -1,28 +0,0 @@ -com.hiero.sdk.DelegateContractIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hiero.sdk.DelegateContractIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hiero.sdk.DelegateContractIdTest.fromSolidityAddressWith0x=[ - "0.0.5005" -] - - -com.hiero.sdk.DelegateContractIdTest.fromString=[ - "0.0.5005" -] - - -com.hiero.sdk.DelegateContractIdTest.toBytes=[ - "188d27" -] - - -com.hiero.sdk.DelegateContractIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] diff --git a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap deleted file mode 100644 index 3838913501..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.FileContentsQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\nfile_get_contents {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/FileIdTest.snap b/sdk/src/test/java/com/hiero/sdk/FileIdTest.snap deleted file mode 100644 index bebd6f4749..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/FileIdTest.snap +++ /dev/null @@ -1,23 +0,0 @@ -com.hiero.sdk.FileIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hiero.sdk.FileIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hiero.sdk.FileIdTest.shouldSerializeFromString=[ - "0.0.5005" -] - - -com.hiero.sdk.FileIdTest.toBytes=[ - "188d27" -] - - -com.hiero.sdk.FileIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap deleted file mode 100644 index 2b6a89ad9c..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.FileInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\nfile_get_info {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap deleted file mode 100644 index 176369a5d9..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.NetworkVersionInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\nnetwork_get_version_info {\n header {\n payment {\n signed_transaction_bytes: \"\\336\\255\\276\\357\"\n }\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap b/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap deleted file mode 100644 index 0b585e931c..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.NetworkVersionInfoTest.shouldSerialize=[ - "com.hiero.sdk.NetworkVersionInfo" -] diff --git a/sdk/src/test/java/com/hiero/sdk/NftIdTest.snap b/sdk/src/test/java/com/hiero/sdk/NftIdTest.snap deleted file mode 100644 index 3f39bd22b9..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/NftIdTest.snap +++ /dev/null @@ -1,33 +0,0 @@ -com.hiero.sdk.NftIdTest.fromBytes=[ - "0.0.5005/574489" -] - - -com.hiero.sdk.NftIdTest.fromString2=[ - "0.0.5005/1234" -] - - -com.hiero.sdk.NftIdTest.fromString=[ - "0.0.5005/1234" -] - - -com.hiero.sdk.NftIdTest.fromStringWithChecksumOnMainnet=[ - "0.0.123-vfmkw/7584" -] - - -com.hiero.sdk.NftIdTest.fromStringWithChecksumOnPreviewnet=[ - "0.0.123-ogizo/487302" -] - - -com.hiero.sdk.NftIdTest.fromStringWithChecksumOnTestnet=[ - "0.0.123-esxsf/584903" -] - - -com.hiero.sdk.NftIdTest.toBytes=[ - "0a03188d2710b826" -] diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap deleted file mode 100644 index 9d76470d77..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.ScheduleInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\nschedule_get_info {\n header {\n }\n schedule_i_d {\n realm_num: 0\n schedule_num: 5005\n shard_num: 0\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap deleted file mode 100644 index dcb4715ca5..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.TokenAssociationTest.shouldSerializeAccount=[ - "TokenAssociation{tokenId=1.2.3, accountId=4.5.6}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap deleted file mode 100644 index b542f14a69..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.TokenInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ntoken_get_info {\n header {\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap b/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap deleted file mode 100644 index fcf92cee57..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.snap +++ /dev/null @@ -1,10 +0,0 @@ -com.hiero.sdk.TokenSupplyTypeTest.fromProtobuf=[ - "INFINITE", - "FINITE" -] - - -com.hiero.sdk.TokenSupplyTypeTest.toProtobuf=[ - "INFINITE", - "FINITE" -] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap deleted file mode 100644 index 5877a59b92..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.snap +++ /dev/null @@ -1,23 +0,0 @@ -com.hiero.sdk.TopicIdTest.fromBytes=[ - "0.0.5005" -] - - -com.hiero.sdk.TopicIdTest.fromSolidityAddress=[ - "0.0.5005" -] - - -com.hiero.sdk.TopicIdTest.shouldSerializeFromString=[ - "0.0.5005" -] - - -com.hiero.sdk.TopicIdTest.toBytes=[ - "188d27" -] - - -com.hiero.sdk.TopicIdTest.toSolidityAddress=[ - "000000000000000000000000000000000000138d" -] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap b/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap deleted file mode 100644 index ed165ff364..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.snap +++ /dev/null @@ -1,3 +0,0 @@ -com.hiero.sdk.TopicInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\nconsensus_get_topic_info {\n header {\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5005\n }\n}" -] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap b/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap deleted file mode 100644 index aca3726f13..0000000000 --- a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.snap +++ /dev/null @@ -1,8 +0,0 @@ -com.hiero.sdk.TransactionIdTest.shouldSerialize2=[ - "0.0.23847@1588539964.632521325?scheduled/3" -] - - -com.hiero.sdk.TransactionIdTest.shouldSerialize=[ - "0.0.23847@1588539964.632521325" -] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java index 9e66345a69..a37959eb57 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -7,8 +7,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.snap similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.snap index 1c14e2afdd..23023ccade 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceApproveTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.AccountAllowanceApproveTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_approve_allowance {\n crypto_allowances {\n amount: 300000000\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n crypto_allowances {\n amount: 300000000\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n nft_allowances {\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n token_allowances {\n amount: 6\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n token_allowances {\n amount: 6\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountAllowanceApproveTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_approve_allowance {\n crypto_allowances {\n amount: 300000000\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n crypto_allowances {\n amount: 300000000\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 1\n realm_num: 1\n shard_num: 1\n }\n }\n nft_allowances {\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n spender {\n account_num: 5\n realm_num: 5\n shard_num: 5\n }\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 789\n spender {\n account_num: 9\n realm_num: 9\n shard_num: 9\n }\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n approved_for_all {\n value: true\n }\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n token_id {\n realm_num: 6\n shard_num: 6\n token_num: 6\n }\n }\n token_allowances {\n amount: 6\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n token_allowances {\n amount: 6\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n spender {\n account_num: 3\n realm_num: 3\n shard_num: 3\n }\n token_id {\n realm_num: 2\n shard_num: 2\n token_num: 2\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java index 31d7511718..7074b1495e 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap index 26a9bb65e5..70808c7d29 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.AccountAllowanceDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_delete_allowance {\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n serial_numbers: 789\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountAllowanceDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_delete_allowance {\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 123\n serial_numbers: 456\n serial_numbers: 789\n token_id {\n realm_num: 4\n shard_num: 4\n token_num: 4\n }\n }\n nft_allowances {\n owner {\n account_num: 7\n realm_num: 6\n shard_num: 5\n }\n serial_numbers: 456\n token_id {\n realm_num: 8\n shard_num: 8\n token_num: 8\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java index 782a128564..c5a6d42f14 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountBalanceQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerializeWithAccountId() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new AccountBalanceQuery() .setAccountId(AccountId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); @@ -30,7 +30,7 @@ void shouldSerializeWithAccountId() { @Test void shouldSerializeWithContractId() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new AccountBalanceQuery() .setContractId(ContractId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.snap new file mode 100644 index 0000000000..618ddd7af2 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.snap @@ -0,0 +1,8 @@ +org.hiero.sdk.AccountBalanceQueryTest.shouldSerializeWithAccountId=[ + "# org.hiero.sdk.proto.Query\ncryptoget_account_balance {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] + + +org.hiero.sdk.AccountBalanceQueryTest.shouldSerializeWithContractId=[ + "# org.hiero.sdk.proto.Query\ncryptoget_account_balance {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java index 2f9bf35ea6..b5b0b4aeb3 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.CryptoCreateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.CryptoCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.snap similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.snap index fbea71371e..387f66b81e 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.AccountCreateTransactionTest.shouldSerialize2=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_create_account {\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountCreateTransactionTest.shouldSerialize2=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_create_account {\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.AccountCreateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_create_account {\n alias: \"\\\\V.\\220\\376\\257\\016\\353\\323>\\247]!\\002O$\\235E\\024\\027\"\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountCreateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_create_account {\n alias: \"\\\\V.\\220\\376\\257\\016\\353\\323>\\247]!\\002O$\\235E\\024\\027\"\n auto_renew_period {\n seconds: 36000\n }\n initial_balance: 450\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations: 100\n memo: \"some dumb memo\"\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receive_record_threshold: 0\n receiver_sig_required: true\n send_record_threshold: 0\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java index cadd809f0d..6987bd166a 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.CryptoDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.CryptoDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.snap similarity index 79% rename from sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.snap index 46fd270d06..9dd69d1bc3 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.AccountDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_delete {\n delete_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_delete {\n delete_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java b/sdk/src/test/java/org/hiero/sdk/AccountIdTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/AccountIdTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountIdTest.java index 6dc6285451..2b9ca27073 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountIdTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountIdTest.snap new file mode 100644 index 0000000000..c3ba18b097 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/AccountIdTest.snap @@ -0,0 +1,88 @@ +org.hiero.sdk.AccountIdTest.fromBytes=[ + "0.0.5005" +] + + +org.hiero.sdk.AccountIdTest.fromBytesAlias=[ + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" +] + + +org.hiero.sdk.AccountIdTest.fromBytesAliasEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +org.hiero.sdk.AccountIdTest.fromBytesEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +org.hiero.sdk.AccountIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +org.hiero.sdk.AccountIdTest.fromSolidityAddressWith0x=[ + "0.0.5005" +] + + +org.hiero.sdk.AccountIdTest.fromString=[ + "0.0.5005" +] + + +org.hiero.sdk.AccountIdTest.fromStringWithAliasEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +org.hiero.sdk.AccountIdTest.fromStringWithAliasKey=[ + "0.0.302a300506032b6570032100114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" +] + + +org.hiero.sdk.AccountIdTest.fromStringWithChecksumOnMainnet=[ + "0.0.123-vfmkw" +] + + +org.hiero.sdk.AccountIdTest.fromStringWithChecksumOnPreviewnet=[ + "0.0.123-ogizo" +] + + +org.hiero.sdk.AccountIdTest.fromStringWithChecksumOnTestnet=[ + "0.0.123-esxsf" +] + + +org.hiero.sdk.AccountIdTest.fromStringWithEvmAddress=[ + "0.0.302a300506032b6570032100114e6abc371b82da" +] + + +org.hiero.sdk.AccountIdTest.toBytes=[ + "188d27" +] + + +org.hiero.sdk.AccountIdTest.toBytesAlias=[ + "22221220114e6abc371b82dab5c15ea149f02d34a012087b163516dd70f44acafabf7777" +] + + +org.hiero.sdk.AccountIdTest.toBytesAliasEvmAddress=[ + "2214302a300506032b6570032100114e6abc371b82da" +] + + +org.hiero.sdk.AccountIdTest.toBytesEvmAddress=[ + "2214302a300506032b6570032100114e6abc371b82da" +] + + +org.hiero.sdk.AccountIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java index bf0a03bc3e..e96edc9e07 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new AccountInfoQuery() .setAccountId(AccountId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.snap new file mode 100644 index 0000000000..d837d51110 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.AccountInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncrypto_get_info {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java b/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java index ecda40fc8f..fcaf0280a6 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoGetInfoResponse; -import com.hiero.sdk.proto.KeyList; -import com.hiero.sdk.proto.LiveHash; +import org.hiero.sdk.proto.CryptoGetInfoResponse; +import org.hiero.sdk.proto.KeyList; +import org.hiero.sdk.proto.LiveHash; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.snap similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/AccountInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/AccountInfoTest.snap index 40bf1c6000..d97ed2a401 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.snap @@ -1,18 +1,18 @@ -com.hiero.sdk.AccountInfoTest.fromBytes=[ +org.hiero.sdk.AccountInfoTest.fromBytes=[ "AccountInfo{accountId=0.0.1, contractAccountId=, deleted=true, proxyAccountId=0.0.8, proxyReceived=2 tℏ, key=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, balance=3 tℏ, sendRecordThreshold=4 tℏ, receiveRecordThreshold=5 tℏ, receiverSignatureRequired=true, expirationTime=1970-01-01T00:00:00.006Z, autoRenewPeriod=PT168H, liveHashes=[LiveHash{accountId=0.0.10, hash=[0, 1, 2], keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, duration=PT264H}], tokenRelationships={}, accountMemo=, ownedNfts=0, maxAutomaticTokenAssociations=0, aliasKey=null, ledgerId=previewnet, ethereumNonce=1001, stakingInfo=null}" ] -com.hiero.sdk.AccountInfoTest.fromProtobufWithOtherOptions=[ +org.hiero.sdk.AccountInfoTest.fromProtobufWithOtherOptions=[ "AccountInfo{accountId=0.0.1, contractAccountId=, deleted=true, proxyAccountId=0.0.8, proxyReceived=2 tℏ, key=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, balance=3 tℏ, sendRecordThreshold=4 tℏ, receiveRecordThreshold=5 tℏ, receiverSignatureRequired=true, expirationTime=1970-01-01T00:00:00.006Z, autoRenewPeriod=PT168H, liveHashes=[LiveHash{accountId=0.0.10, hash=[0, 1, 2], keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, duration=PT264H}], tokenRelationships={}, accountMemo=, ownedNfts=0, maxAutomaticTokenAssociations=0, aliasKey=null, ledgerId=previewnet, ethereumNonce=1001, stakingInfo=null}" ] -com.hiero.sdk.AccountInfoTest.toBytes=[ +org.hiero.sdk.AccountInfoTest.toBytes=[ "CgIYARgBIgIYCDACOiISIODI7CdYpYef+sImoTwMUWt5nnLjUUGg3YKPlNN5iKS3QANIBFAFWAFiBRCAm+4CagQIgPUkcjUKAhgKEgMAAQIaJAoiEiDgyOwnWKWHn/rCJqE8DFFreZ5y41FBoN2Cj5TTeYiktyoECICBOqIBAQKoAekH" ] -com.hiero.sdk.AccountInfoTest.toProtobuf=[ - "# com.hiero.sdk.proto.CryptoGetInfoResponse$AccountInfo@57c9441\naccount_i_d {\n account_num: 1\n realm_num: 0\n shard_num: 0\n}\nauto_renew_period {\n seconds: 604800\n}\nbalance: 3\ndeleted: true\nethereum_nonce: 1001\nexpiration_time {\n nanos: 6000000\n seconds: 0\n}\ngenerate_receive_record_threshold: 5\ngenerate_send_record_threshold: 4\nkey {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n}\nledger_id: \"\\002\"\nlive_hashes {\n account_id {\n account_num: 10\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 950400\n }\n hash: \"\\000\\001\\002\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n}\nowned_nfts: 0\nproxy_account_i_d {\n account_num: 8\n realm_num: 0\n shard_num: 0\n}\nproxy_received: 2\nreceiver_sig_required: true" +org.hiero.sdk.AccountInfoTest.toProtobuf=[ + "# org.hiero.sdk.proto.CryptoGetInfoResponse$AccountInfo@57c9441\naccount_i_d {\n account_num: 1\n realm_num: 0\n shard_num: 0\n}\nauto_renew_period {\n seconds: 604800\n}\nbalance: 3\ndeleted: true\nethereum_nonce: 1001\nexpiration_time {\n nanos: 6000000\n seconds: 0\n}\ngenerate_receive_record_threshold: 5\ngenerate_send_record_threshold: 4\nkey {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n}\nledger_id: \"\\002\"\nlive_hashes {\n account_id {\n account_num: 10\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 950400\n }\n hash: \"\\000\\001\\002\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n}\nowned_nfts: 0\nproxy_account_i_d {\n account_num: 8\n realm_num: 0\n shard_num: 0\n}\nproxy_received: 2\nreceiver_sig_required: true" ] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java index 84e72b81d7..9305f01835 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountRecordsQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new AccountRecordsQuery() .setAccountId(AccountId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.snap new file mode 100644 index 0000000000..a67d776052 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.AccountRecordsQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncrypto_get_account_records {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java index 0df37a7e84..724748dcc9 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountStakersQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new AccountStakersQuery() .setAccountId(AccountId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.snap new file mode 100644 index 0000000000..2312920192 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.AccountStakersQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncrypto_get_proxy_stakers {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java index dc0b40709b..66cda0fa0b 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.CryptoUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.CryptoUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.snap similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.snap index 7688ebe677..ec8cc1a5cd 100644 --- a/sdk/src/test/java/com/hiero/sdk/AccountUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.AccountUpdateTransactionTest.shouldSerialize2=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountUpdateTransactionTest.shouldSerialize2=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.AccountUpdateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.AccountUpdateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_update_account {\n account_i_d_to_update {\n account_num: 2002\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158543\n }\n key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n max_automatic_token_associations {\n value: 100\n }\n memo {\n value: \"Some memo\"\n }\n proxy_account_i_d {\n account_num: 1001\n realm_num: 0\n shard_num: 0\n }\n receiver_sig_required_wrapper {\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java b/sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java rename to sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java index 807f44d719..a135890b1c 100644 --- a/sdk/src/test/java/com/hiero/sdk/AddressBookQueryMockTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatException; -import com.hiero.sdk.proto.mirror.NetworkServiceGrpc; +import org.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.Server; import io.grpc.Status; import io.grpc.inprocess.InProcessServerBuilder; @@ -56,11 +56,11 @@ void teardown() throws Exception { @ParameterizedTest(name = "[{0}] AddressBookQuery works") @CsvSource({"sync", "async"}) void addressBookQueryWorks(String executeVersion) throws Throwable { - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .setLimit(3) .build()); - addressBookServiceStub.responses.add(new com.hiero.sdk.NodeAddress() + addressBookServiceStub.responses.add(new org.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .toProtobuf()); @@ -82,10 +82,10 @@ Endpoint spawnEndpoint() { @Test void networkUpdatePeriodWorks() throws Throwable { - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build()); - addressBookServiceStub.responses.add(new com.hiero.sdk.NodeAddress() + addressBookServiceStub.responses.add(new org.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .setAddresses(Collections.singletonList(spawnEndpoint())) .toProtobuf()); @@ -110,15 +110,15 @@ void networkUpdatePeriodWorks() throws Throwable { "async, UNAVAILABLE, " }) void addressBookQueryRetries(String executeVersion, Status.Code code, String description) throws Throwable { - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build()); - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build()); addressBookServiceStub.responses.add( code.toStatus().withDescription(description).asRuntimeException()); - addressBookServiceStub.responses.add(new com.hiero.sdk.NodeAddress() + addressBookServiceStub.responses.add(new org.hiero.sdk.NodeAddress() .setAccountId(AccountId.fromString("0.0.3")) .toProtobuf()); @@ -141,7 +141,7 @@ void addressBookQueryRetries(String executeVersion, Status.Code code, String des "async, INVALID_ARGUMENT, " }) void addressBookQueryFails(String executeVersion, Status.Code code, String description) { - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build()); addressBookServiceStub.responses.add( @@ -169,10 +169,10 @@ void addressBookQueryStopsAtMaxAttempts(String executeVersion, Status.Code code, throws Throwable { addressBookQuery.setMaxAttempts(2); - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build()); - addressBookServiceStub.requests.add(com.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() + addressBookServiceStub.requests.add(org.hiero.sdk.proto.mirror.AddressBookQuery.newBuilder() .setFileId(FileId.ADDRESS_BOOK.toProtobuf()) .build()); addressBookServiceStub.responses.add( @@ -189,13 +189,13 @@ void addressBookQueryStopsAtMaxAttempts(String executeVersion, Status.Code code, private static class AddressBookQueryStub extends NetworkServiceGrpc.NetworkServiceImplBase { - private final Queue requests = new ArrayDeque<>(); + private final Queue requests = new ArrayDeque<>(); private final Queue responses = new ArrayDeque<>(); @Override public void getNodes( - com.hiero.sdk.proto.mirror.AddressBookQuery addressBookQuery, - StreamObserver streamObserver) { + org.hiero.sdk.proto.mirror.AddressBookQuery addressBookQuery, + StreamObserver streamObserver) { var request = requests.poll(); assertThat(request).isNotNull(); assertThat(addressBookQuery).isEqualTo(request); @@ -209,7 +209,7 @@ public void getNodes( return; } - streamObserver.onNext((com.hiero.sdk.proto.NodeAddress) response); + streamObserver.onNext((org.hiero.sdk.proto.NodeAddress) response); } streamObserver.onCompleted(); } diff --git a/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java b/sdk/src/test/java/org/hiero/sdk/AllowancesTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/AllowancesTest.java rename to sdk/src/test/java/org/hiero/sdk/AllowancesTest.java index e32607b8e9..73abc3812c 100644 --- a/sdk/src/test/java/com/hiero/sdk/AllowancesTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AllowancesTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/AllowancesTest.snap b/sdk/src/test/java/org/hiero/sdk/AllowancesTest.snap similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/AllowancesTest.snap rename to sdk/src/test/java/org/hiero/sdk/AllowancesTest.snap index 242a2ab5a7..30d3c5f1be 100644 --- a/sdk/src/test/java/com/hiero/sdk/AllowancesTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AllowancesTest.snap @@ -1,4 +1,4 @@ -com.hiero.sdk.AllowancesTest.shouldSerialize=[ +org.hiero.sdk.AllowancesTest.shouldSerialize=[ "HbarAllowance{ownerAccountId=1.1.1, spenderAccountId=2.2.2, amount=3 ℏ}", "TokenAllowance{tokenId=1.2.3, ownerAccountId=4.5.6, spenderAccountId=5.5.5, amount=777}", "TokenNftAllowance{tokenId=1.1.1, ownerAccountId=2.2.2, spenderAccountId=3.3.3, delegatingSpender=null, serials=[123, 456]}", diff --git a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java b/sdk/src/test/java/org/hiero/sdk/AssessedCustomFeeTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java rename to sdk/src/test/java/org/hiero/sdk/AssessedCustomFeeTest.java index 62238f1a3e..924bb5930c 100644 --- a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AssessedCustomFeeTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -17,7 +17,7 @@ public class AssessedCustomFeeTest { private static final List payerAccountIds = List.of(new AccountId(8, 9, 10), new AccountId(11, 12, 13), new AccountId(14, 15, 16)); - private final com.hiero.sdk.proto.AssessedCustomFee fee = com.hiero.sdk.proto.AssessedCustomFee.newBuilder() + private final org.hiero.sdk.proto.AssessedCustomFee fee = org.hiero.sdk.proto.AssessedCustomFee.newBuilder() .setAmount(amount) .setTokenId(tokenId.toProtobuf()) .setFeeCollectorAccountId(feeCollector.toProtobuf()) diff --git a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap b/sdk/src/test/java/org/hiero/sdk/AssessedCustomFeeTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap rename to sdk/src/test/java/org/hiero/sdk/AssessedCustomFeeTest.snap index 8cda9717b8..2dca2e49e9 100644 --- a/sdk/src/test/java/com/hiero/sdk/AssessedCustomFeeTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/AssessedCustomFeeTest.snap @@ -1,13 +1,13 @@ -com.hiero.sdk.AssessedCustomFeeTest.fromProtobuf=[ +org.hiero.sdk.AssessedCustomFeeTest.fromProtobuf=[ "AssessedCustomFee{amount=1, tokenId=2.3.4, feeCollectorAccountId=5.6.7, payerAccountIdList=[8.9.10, 11.12.13, 14.15.16]}" ] -com.hiero.sdk.AssessedCustomFeeTest.shouldSerialize=[ +org.hiero.sdk.AssessedCustomFeeTest.shouldSerialize=[ "AssessedCustomFee{amount=201, tokenId=1.2.3, feeCollectorAccountId=4.5.6, payerAccountIdList=[0.0.1, 0.0.2, 0.0.3]}" ] -com.hiero.sdk.AssessedCustomFeeTest.toProtobuf=[ - "# com.hiero.sdk.proto.AssessedCustomFee@55ba505b\namount: 1\neffective_payer_account_id {\n account_num: 10\n realm_num: 9\n shard_num: 8\n}\neffective_payer_account_id {\n account_num: 13\n realm_num: 12\n shard_num: 11\n}\neffective_payer_account_id {\n account_num: 16\n realm_num: 15\n shard_num: 14\n}\nfee_collector_account_id {\n account_num: 7\n realm_num: 6\n shard_num: 5\n}\ntoken_id {\n realm_num: 3\n shard_num: 2\n token_num: 4\n}" +org.hiero.sdk.AssessedCustomFeeTest.toProtobuf=[ + "# org.hiero.sdk.proto.AssessedCustomFee@55ba505b\namount: 1\neffective_payer_account_id {\n account_num: 10\n realm_num: 9\n shard_num: 8\n}\neffective_payer_account_id {\n account_num: 13\n realm_num: 12\n shard_num: 11\n}\neffective_payer_account_id {\n account_num: 16\n realm_num: 15\n shard_num: 14\n}\nfee_collector_account_id {\n account_num: 7\n realm_num: 6\n shard_num: 5\n}\ntoken_id {\n realm_num: 3\n shard_num: 2\n token_num: 4\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java b/sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java rename to sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java index 794436bc56..c50d74fd39 100644 --- a/sdk/src/test/java/com/hiero/sdk/BaseNodeAddressTest.java +++ b/sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.BaseNodeAddress.PORT_MIRROR_TLS; -import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; -import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_TLS; +import static org.hiero.sdk.BaseNodeAddress.PORT_MIRROR_TLS; +import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_TLS; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java b/sdk/src/test/java/org/hiero/sdk/ClientCloseTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java rename to sdk/src/test/java/org/hiero/sdk/ClientCloseTest.java index ba5bbcd1ec..71392f87dc 100644 --- a/sdk/src/test/java/com/hiero/sdk/ClientCloseTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ClientCloseTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -62,7 +62,7 @@ void closeHandlesNetworkTimeout() { void closeHandlesNetworkInterrupted() { var interruptedException = new InterruptedException("network interrupted"); var executor = Client.createExecutor(); - var network = mock(Network.class); + var network = Mockito.mock(Network.class); when(network.awaitClose(any(), any())).thenReturn(interruptedException); var mirrorNetwork = MirrorNetwork.forNetwork(executor, Collections.emptyList()); var client = new Client(executor, network, mirrorNetwork, null, true, null); @@ -77,7 +77,7 @@ void closeHandlesNetworkInterrupted() { void closeHandlesMirrorNetworkTimeout() { var executor = Client.createExecutor(); var network = Network.forNetwork(executor, Collections.emptyMap()); - var mirrorNetwork = mock(MirrorNetwork.class); + var mirrorNetwork = Mockito.mock(MirrorNetwork.class); when(mirrorNetwork.awaitClose(any(), any())).thenReturn(new TimeoutException("mirror timeout")); var client = new Client(executor, network, mirrorNetwork, null, true, null); @@ -92,7 +92,7 @@ void closeHandlesMirrorNetworkInterrupted() { var interruptedException = new InterruptedException("network interrupted"); var executor = Client.createExecutor(); var network = Network.forNetwork(executor, Collections.emptyMap()); - var mirrorNetwork = mock(MirrorNetwork.class); + var mirrorNetwork = Mockito.mock(MirrorNetwork.class); when(mirrorNetwork.awaitClose(any(), any())).thenReturn(interruptedException); var client = new Client(executor, network, mirrorNetwork, null, true, null); diff --git a/sdk/src/test/java/com/hiero/sdk/ClientTest.java b/sdk/src/test/java/org/hiero/sdk/ClientTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/ClientTest.java rename to sdk/src/test/java/org/hiero/sdk/ClientTest.java index 9b47dcbb49..c16eec5b5f 100644 --- a/sdk/src/test/java/com/hiero/sdk/ClientTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ClientTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; +import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -372,12 +372,12 @@ void testExecuteSyncTimeout(String timeoutSite) throws Exception { client.close(); } - com.hiero.sdk.proto.NodeAddress nodeAddress(long accountNum, String rsaPubKeyHex, byte[] certHash, byte[] ipv4) { - com.hiero.sdk.proto.NodeAddress.Builder builder = com.hiero.sdk.proto.NodeAddress.newBuilder() - .setNodeAccountId(com.hiero.sdk.proto.AccountID.newBuilder() + org.hiero.sdk.proto.NodeAddress nodeAddress(long accountNum, String rsaPubKeyHex, byte[] certHash, byte[] ipv4) { + org.hiero.sdk.proto.NodeAddress.Builder builder = org.hiero.sdk.proto.NodeAddress.newBuilder() + .setNodeAccountId(org.hiero.sdk.proto.AccountID.newBuilder() .setAccountNum(accountNum) .build()) - .addServiceEndpoint(com.hiero.sdk.proto.ServiceEndpoint.newBuilder() + .addServiceEndpoint(org.hiero.sdk.proto.ServiceEndpoint.newBuilder() .setIpAddressV4(ByteString.copyFrom(ipv4)) .setPort(PORT_NODE_PLAIN) .build()) @@ -396,7 +396,7 @@ void setNetworkFromAddressBook() throws Exception { client.network.network.get(new AccountId(accountNum)).get(0).getAddressBookEntry(); // reconfigure client network from addressbook (add new nodes) - client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() + client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(org.hiero.sdk.proto.NodeAddressBook.newBuilder() .addNodeAddress(nodeAddress(10001, "10001", new byte[] {1, 0, 1}, new byte[] {10, 0, 0, 1})) .addNodeAddress(nodeAddress(10002, "10002", new byte[] {1, 0, 2}, new byte[] {10, 0, 0, 2})) .build() @@ -409,7 +409,7 @@ void setNetworkFromAddressBook() throws Exception { assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("10002"); // reconfigure client network from addressbook without `certHash` - client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() + client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(org.hiero.sdk.proto.NodeAddressBook.newBuilder() .addNodeAddress(nodeAddress(10001, "10001", null, new byte[] {10, 0, 0, 1})) .addNodeAddress(nodeAddress(10002, "10002", null, new byte[] {10, 0, 0, 2})) .build() @@ -422,7 +422,7 @@ void setNetworkFromAddressBook() throws Exception { assertThat(nodeAddress.apply(10002).publicKey).isEqualTo("10002"); // reconfigure client network from addressbook (update existing nodes) - client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(com.hiero.sdk.proto.NodeAddressBook.newBuilder() + client.setNetworkFromAddressBook(NodeAddressBook.fromBytes(org.hiero.sdk.proto.NodeAddressBook.newBuilder() .addNodeAddress(nodeAddress(10001, "810001", new byte[] {8, 1, 0, 1}, new byte[] {10, 0, 0, 1})) .addNodeAddress(nodeAddress(10002, "810002", new byte[] {8, 1, 0, 2}, new byte[] {10, 0, 0, 2})) .build() diff --git a/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java b/sdk/src/test/java/org/hiero/sdk/ConsumerHelperTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java rename to sdk/src/test/java/org/hiero/sdk/ConsumerHelperTest.java index ba20a7659d..4d15d55aab 100644 --- a/sdk/src/test/java/com/hiero/sdk/ConsumerHelperTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ConsumerHelperTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.any; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java index c57de2e479..54ce7c3cf0 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractByteCodeQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new ContractByteCodeQuery() .setContractId(ContractId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.snap new file mode 100644 index 0000000000..ec8e3fa0b1 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.ContractByteCodeQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncontract_get_bytecode {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java index ff58562d9f..e0e838e302 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import org.junit.jupiter.api.AfterAll; @@ -26,7 +26,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new ContractCallQuery() .setContractId(ContractId.fromString("0.0.5005")) .setGas(1541) @@ -41,7 +41,7 @@ void shouldSerialize() { @Test void setFunctionParameters() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new ContractCallQuery() .setContractId(ContractId.fromString("0.0.5005")) .setGas(1541) diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.snap similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.snap index d35d7ff1ec..629cd29c06 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractCallQueryTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.ContractCallQueryTest.setFunctionParameters=[ - "# com.hiero.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" +org.hiero.sdk.ContractCallQueryTest.setFunctionParameters=[ + "# org.hiero.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" ] -com.hiero.sdk.ContractCallQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\022J\\203\\372\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" +org.hiero.sdk.ContractCallQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncontract_call_local {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\022J\\203\\372\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\200\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\005Hello\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\006world!\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\"\n gas: 1541\n header {\n }\n max_result_size: 0\n sender_id {\n account_num: 3\n realm_num: 2\n shard_num: 1\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java index 043445ad48..9a49ea1934 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ContractCreateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ContractCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.snap similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.snap index 183da18345..21cf7b7671 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.ContractCreateTransactionTest.shouldSerialize2=[ - "# com.hiero.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n gas: 0\n initcode: \"\\336\\255\\276\\357\"\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ContractCreateTransactionTest.shouldSerialize2=[ + "# org.hiero.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n gas: 0\n initcode: \"\\336\\255\\276\\357\"\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.ContractCreateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n file_i_d {\n file_num: 3003\n realm_num: 0\n shard_num: 0\n }\n gas: 0\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ContractCreateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncontract_create_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 36000\n }\n constructor_parameters: \"\\n\\v\\f\\r\\031\"\n file_i_d {\n file_num: 3003\n realm_num: 0\n shard_num: 0\n }\n gas: 0\n initial_balance: 1000\n max_automatic_token_associations: 101\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java index bec57e66e6..aabd97ac3a 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ContractDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ContractDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.snap similarity index 79% rename from sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.snap index f18efcd301..792abb8932 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.ContractDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncontract_delete_instance {\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_contract_i_d {\n contract_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ContractDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncontract_delete_instance {\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n transfer_contract_i_d {\n contract_num: 5008\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java index 41186f7841..600b4c4b6e 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ContractCallTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ContractCallTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.snap index 726f00f7f5..9cd5fd27bd 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractExecuteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.ContractExecuteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncontract_call {\n amount: 1000\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\030+\\v\"\n gas: 10\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ContractExecuteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncontract_call {\n amount: 1000\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n function_parameters: \"\\030+\\v\"\n gas: 10\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java b/sdk/src/test/java/org/hiero/sdk/ContractFunctionParametersTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractFunctionParametersTest.java index 581c5633de..a50a02b719 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractFunctionParametersTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractFunctionParametersTest.snap similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractFunctionParametersTest.snap index c4daf8bac4..3515eb9bfd 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionParametersTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractFunctionParametersTest.snap @@ -1,4 +1,4 @@ -com.hiero.sdk.ContractFunctionParametersTest.intSizesEncodeCorrectly=[ +org.hiero.sdk.ContractFunctionParametersTest.intSizesEncodeCorrectly=[ [ "bitWidth = 8: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000002ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080", "bitWidth = 16: 00000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008000", diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java b/sdk/src/test/java/org/hiero/sdk/ContractFunctionResultTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractFunctionResultTest.java index 21093cb5d4..be38e7c980 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionResultTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractFunctionResultTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -38,7 +38,7 @@ public class ContractFunctionResultTest { @Test @DisplayName("provides results correctly") void providesResultsCorrectly() { - var result = new ContractFunctionResult(com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + var result = new ContractFunctionResult(org.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(ContractId.fromString("1.2.3").toProtobuf()) .setContractCallResult(ByteString.copyFrom(callResult)) .setEvmAddress(BytesValue.newBuilder() @@ -96,7 +96,7 @@ void providesResultsCorrectly() { @Test @DisplayName("can get string array result") void canGetStringArrayResult() { - var result = new ContractFunctionResult(com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + var result = new ContractFunctionResult(org.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractCallResult(ByteString.copyFrom(stringArrayCallResult))); var strings = result.getStringArray(0); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java b/sdk/src/test/java/org/hiero/sdk/ContractFunctionSelectorTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractFunctionSelectorTest.java index 5cf8a4dd46..eaf2ea8561 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractFunctionSelectorTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractFunctionSelectorTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java b/sdk/src/test/java/org/hiero/sdk/ContractIdTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/ContractIdTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractIdTest.java index eee2bb2747..4768a78ede 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractIdTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractIdTest.snap new file mode 100644 index 0000000000..ca70ebc528 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/ContractIdTest.snap @@ -0,0 +1,48 @@ +org.hiero.sdk.ContractIdTest.fromBytes=[ + "0.0.5005" +] + + +org.hiero.sdk.ContractIdTest.fromEvmAddress=[ + "1.2.98329e006610472e6b372c080833f6d79ed833cf" +] + + +org.hiero.sdk.ContractIdTest.fromEvmAddressWith0x=[ + "1.2.98329e006610472e6b372c080833f6d79ed833cf" +] + + +org.hiero.sdk.ContractIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +org.hiero.sdk.ContractIdTest.fromSolidityAddressWith0x=[ + "0.0.5005" +] + + +org.hiero.sdk.ContractIdTest.fromString=[ + "0.0.5005" +] + + +org.hiero.sdk.ContractIdTest.fromStringWithEvmAddress=[ + "1.2.98329e006610472e6b372c080833f6d79ed833cf" +] + + +org.hiero.sdk.ContractIdTest.toBytes=[ + "188d27" +] + + +org.hiero.sdk.ContractIdTest.toSolidityAddress2=[ + "98329e006610472e6b372c080833f6d79ed833cf" +] + + +org.hiero.sdk.ContractIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java index d2b04f4b0b..8f07e4ec8c 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new ContractInfoQuery() .setContractId(ContractId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.snap new file mode 100644 index 0000000000..3b20155c4f --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.ContractInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncontract_get_info {\n contract_i_d {\n contract_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java index 7b4586ba9c..65167304d8 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractGetInfoResponse; +import org.hiero.sdk.proto.ContractGetInfoResponse; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.snap similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/ContractInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractInfoTest.snap index 09d462744d..e234bbc587 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.snap @@ -1,19 +1,19 @@ -com.hiero.sdk.ContractInfoTest.fromBytes=[ +org.hiero.sdk.ContractInfoTest.fromBytes=[ "ContractInfo{contractId=0.0.1, accountId=0.0.2, contractAccountId=3, adminKey=null, expirationTime=1970-01-01T00:00:00.004Z, autoRenewPeriod=PT120H, autoRenewAccountId=null, storage=6, contractMemo=7, balance=8 tℏ, isDeleted=false, tokenRelationships={}, ledgerId=testnet, stakingInfo=null}" ] -com.hiero.sdk.ContractInfoTest.fromProtobuf=[ +org.hiero.sdk.ContractInfoTest.fromProtobuf=[ "ContractInfo{contractId=0.0.1, accountId=0.0.2, contractAccountId=3, adminKey=null, expirationTime=1970-01-01T00:00:00.004Z, autoRenewPeriod=PT120H, autoRenewAccountId=null, storage=6, contractMemo=7, balance=8 tℏ, isDeleted=false, tokenRelationships={}, ledgerId=testnet, stakingInfo=null}" ] -com.hiero.sdk.ContractInfoTest.toBytes=[ +org.hiero.sdk.ContractInfoTest.toBytes=[ "0a021801120218021a01332a05108092f40132040880af1a38064201374808620101" ] -com.hiero.sdk.ContractInfoTest.toProtobuf=[ +org.hiero.sdk.ContractInfoTest.toProtobuf=[ { "memoizedHashCode": 0, "memoizedSerializedSize": 2147483647, diff --git a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java index 04be1d2fd0..f7516514f7 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ContractLoginfo; +import org.hiero.sdk.proto.ContractLoginfo; import io.github.jsonSnapshot.SnapshotMatcher; import java.nio.charset.StandardCharsets; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.snap similarity index 54% rename from sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.snap index dbfb24c06d..3c0eea34a8 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractLogInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.snap @@ -1,18 +1,18 @@ -com.hiero.sdk.ContractLogInfoTest.fromBytes=[ +org.hiero.sdk.ContractLogInfoTest.fromBytes=[ "ContractLogInfo{contractId=0.0.10, bloom=626c6f6f6d, topics=[626c6f6f6d]}" ] -com.hiero.sdk.ContractLogInfoTest.fromProtobuf=[ +org.hiero.sdk.ContractLogInfoTest.fromProtobuf=[ "ContractLogInfo{contractId=0.0.10, bloom=626c6f6f6d, topics=[626c6f6f6d]}" ] -com.hiero.sdk.ContractLogInfoTest.toBytes=[ +org.hiero.sdk.ContractLogInfoTest.toBytes=[ "0a02180a1205626c6f6f6d1a05626c6f6f6d" ] -com.hiero.sdk.ContractLogInfoTest.toProtobuf=[ - "# com.hiero.sdk.proto.ContractLoginfo@cb39e330\nbloom: \"bloom\"\ncontract_i_d {\n contract_num: 10\n realm_num: 0\n shard_num: 0\n}\ntopic: \"bloom\"" +org.hiero.sdk.ContractLogInfoTest.toProtobuf=[ + "# org.hiero.sdk.proto.ContractLoginfo@cb39e330\nbloom: \"bloom\"\ncontract_i_d {\n contract_num: 10\n realm_num: 0\n shard_num: 0\n}\ntopic: \"bloom\"" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ContractNonceInfoTest.java similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractNonceInfoTest.java index a46cc56c72..446333356c 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractNonceInfoTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; public class ContractNonceInfoTest { - private final com.hiero.sdk.proto.ContractNonceInfo info = com.hiero.sdk.proto.ContractNonceInfo.newBuilder() + private final org.hiero.sdk.proto.ContractNonceInfo info = org.hiero.sdk.proto.ContractNonceInfo.newBuilder() .setContractId(new ContractId(1).toProtobuf()) .setNonce(2) .build(); diff --git a/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractNonceInfoTest.snap similarity index 80% rename from sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractNonceInfoTest.snap index 5b28a93f26..72b96475b4 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractNonceInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractNonceInfoTest.snap @@ -1,19 +1,19 @@ -com.hiero.sdk.ContractNonceInfoTest.fromBytes=[ +org.hiero.sdk.ContractNonceInfoTest.fromBytes=[ "ContractNonceInfo{contractId=0.0.1, nonce=2}" ] -com.hiero.sdk.ContractNonceInfoTest.fromProtobuf=[ +org.hiero.sdk.ContractNonceInfoTest.fromProtobuf=[ "ContractNonceInfo{contractId=0.0.1, nonce=2}" ] -com.hiero.sdk.ContractNonceInfoTest.toBytes=[ +org.hiero.sdk.ContractNonceInfoTest.toBytes=[ "0a0218011002" ] -com.hiero.sdk.ContractNonceInfoTest.toProtobuf=[ +org.hiero.sdk.ContractNonceInfoTest.toProtobuf=[ { "memoizedHashCode": 0, "memoizedSerializedSize": 2147483647, diff --git a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java index 5c905894a4..6aad465c91 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ContractUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ContractUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.snap similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.snap index b085d8d377..fb7908b95d 100644 --- a/sdk/src/test/java/com/hiero/sdk/ContractUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.ContractUpdateTransactionTest.shouldSerialize2=[ - "# com.hiero.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ContractUpdateTransactionTest.shouldSerialize2=[ + "# org.hiero.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_node_id: 4\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.ContractUpdateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ContractUpdateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncontract_update_instance {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account_id {\n account_num: 30\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n contract_i_d {\n contract_num: 5007\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n max_automatic_token_associations {\n value: 101\n }\n memo_wrapper {\n value: \"3\"\n }\n proxy_account_i_d {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n staked_account_id {\n account_num: 3\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java index 40aeffc156..4b024109b1 100644 --- a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.CryptoTransferTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionList; +import org.hiero.sdk.proto.CryptoTransferTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionList; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; @@ -154,9 +154,9 @@ void canGetDecimals() { @Test void transactionBodiesMustMatch() throws InvalidProtocolBufferException { - com.hiero.sdk.proto.Transaction tx1 = + org.hiero.sdk.proto.Transaction tx1 = TransactionList.parseFrom(spawnTestTransaction().toBytes()).getTransactionList(0); - com.hiero.sdk.proto.Transaction tx2 = TransactionList.parseFrom( + org.hiero.sdk.proto.Transaction tx2 = TransactionList.parseFrom( spawnModifiedTestTransaction().toBytes()) .getTransactionList(1); var brokenTxList = TransactionList.newBuilder().addTransactionList(tx1).addTransactionList(tx2); diff --git a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.snap similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.snap index 8d59599e77..0a53112e44 100644 --- a/sdk/src/test/java/com/hiero/sdk/CryptoTransferTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.CryptoTransferTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_transfer {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n transfers {\n account_amounts {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n account_amounts {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n is_approval: true\n }\n account_amounts {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.CryptoTransferTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_transfer {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n transfers {\n account_amounts {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n account_amounts {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n is_approval: true\n }\n account_amounts {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java b/sdk/src/test/java/org/hiero/sdk/CustomFeeListTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java rename to sdk/src/test/java/org/hiero/sdk/CustomFeeListTest.java index 5bb4e4e89b..cd694d00d7 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomFeeListTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.snap b/sdk/src/test/java/org/hiero/sdk/CustomFeeListTest.snap similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.snap rename to sdk/src/test/java/org/hiero/sdk/CustomFeeListTest.snap index 2a98757c8e..26973ac3ae 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFeeListTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/CustomFeeListTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.CustomFeeListTest.deepClone=[ +org.hiero.sdk.CustomFeeListTest.deepClone=[ "[CustomFixedFee{feeCollectorAccountId=0.0.4322, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}, CustomFractionalFee{feeCollectorAccountId=0.0.389042, allCollectorsAreExempt=false, numerator=3, denominator=7, min=3, max=100, assessmentMethod=INCLUSIVE}, CustomRoyaltyFee{feeCollectorAccountId=0.0.23423, allCollectorsAreExempt=false, numerator=5, denominator=8, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}}]" ] -com.hiero.sdk.CustomFeeListTest.shouldSerialize=[ +org.hiero.sdk.CustomFeeListTest.shouldSerialize=[ "[CustomFixedFee{feeCollectorAccountId=0.0.4322, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}, CustomFractionalFee{feeCollectorAccountId=0.0.389042, allCollectorsAreExempt=false, numerator=3, denominator=7, min=3, max=100, assessmentMethod=INCLUSIVE}, CustomRoyaltyFee{feeCollectorAccountId=0.0.23423, allCollectorsAreExempt=false, numerator=5, denominator=8, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}}]" ] diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java b/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java rename to sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java index 4a730222a8..b1ce76b994 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.FixedFee; +import org.hiero.sdk.proto.FixedFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap b/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.snap similarity index 50% rename from sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap rename to sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.snap index cc4791945e..5a45bd9ea9 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFixedFeeTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.snap @@ -1,13 +1,13 @@ -com.hiero.sdk.CustomFixedFeeTest.fromProtobuf=[ +org.hiero.sdk.CustomFixedFeeTest.fromProtobuf=[ "CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=4, demoninatingTokenId=5.6.7}" ] -com.hiero.sdk.CustomFixedFeeTest.toFixedFeeProtobuf=[ - "# com.hiero.sdk.proto.FixedFee@409d860\namount: 4\ndenominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n}" +org.hiero.sdk.CustomFixedFeeTest.toFixedFeeProtobuf=[ + "# org.hiero.sdk.proto.FixedFee@409d860\namount: 4\ndenominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n}" ] -com.hiero.sdk.CustomFixedFeeTest.toProtobuf=[ - "# com.hiero.sdk.proto.CustomFee@91885f65\nfixed_fee {\n amount: 4\n denominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n }\n}" +org.hiero.sdk.CustomFixedFeeTest.toProtobuf=[ + "# org.hiero.sdk.proto.CustomFee@91885f65\nfixed_fee {\n amount: 4\n denominating_token_id {\n realm_num: 6\n shard_num: 5\n token_num: 7\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java b/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java rename to sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java index 98141e0079..820026e2f6 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.Fraction; -import com.hiero.sdk.proto.FractionalFee; +import org.hiero.sdk.proto.Fraction; +import org.hiero.sdk.proto.FractionalFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap b/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.snap similarity index 63% rename from sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap rename to sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.snap index c9f47a9cda..e84d7a2565 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomFractionalFeeTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.CustomFractionalFeeTest.fromProtobuf=[ +org.hiero.sdk.CustomFractionalFeeTest.fromProtobuf=[ "CustomFractionalFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, numerator=4, denominator=5, min=6, max=7, assessmentMethod=EXCLUSIVE}" ] -com.hiero.sdk.CustomFractionalFeeTest.toProtobuf=[ - "# com.hiero.sdk.proto.CustomFee@b2abef2c\nfractional_fee {\n fractional_amount {\n denominator: 5\n numerator: 4\n }\n maximum_amount: 7\n minimum_amount: 6\n net_of_transfers: true\n}" +org.hiero.sdk.CustomFractionalFeeTest.toProtobuf=[ + "# org.hiero.sdk.proto.CustomFee@b2abef2c\nfractional_fee {\n fractional_amount {\n denominator: 5\n numerator: 4\n }\n maximum_amount: 7\n minimum_amount: 6\n net_of_transfers: true\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java b/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java rename to sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java index d151bf1adc..2f7ea27527 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.FixedFee; -import com.hiero.sdk.proto.Fraction; -import com.hiero.sdk.proto.RoyaltyFee; +import org.hiero.sdk.proto.FixedFee; +import org.hiero.sdk.proto.Fraction; +import org.hiero.sdk.proto.RoyaltyFee; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap b/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.snap similarity index 67% rename from sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap rename to sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.snap index 5c6f9daf88..ba1be741d8 100644 --- a/sdk/src/test/java/com/hiero/sdk/CustomRoyaltyFeeTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.CustomRoyaltyFeeTest.fromProtobuf=[ +org.hiero.sdk.CustomRoyaltyFeeTest.fromProtobuf=[ "CustomRoyaltyFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, numerator=4, denominator=5, fallbackFee=CustomFixedFee{feeCollectorAccountId=null, allCollectorsAreExempt=false, amount=6, demoninatingTokenId=null}}" ] -com.hiero.sdk.CustomRoyaltyFeeTest.toProtobuf=[ - "# com.hiero.sdk.proto.CustomFee@1abe2492\nroyalty_fee {\n exchange_value_fraction {\n denominator: 5\n numerator: 4\n }\n fallback_fee {\n amount: 6\n }\n}" +org.hiero.sdk.CustomRoyaltyFeeTest.toProtobuf=[ + "# org.hiero.sdk.proto.CustomFee@1abe2492\nroyalty_fee {\n exchange_value_fraction {\n denominator: 5\n numerator: 4\n }\n fallback_fee {\n amount: 6\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java b/sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java rename to sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.java index b8efc2fe99..9cc385cdb9 100644 --- a/sdk/src/test/java/com/hiero/sdk/DelegateContractIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; diff --git a/sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.snap b/sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.snap new file mode 100644 index 0000000000..8e5d15a4ae --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/DelegateContractIdTest.snap @@ -0,0 +1,28 @@ +org.hiero.sdk.DelegateContractIdTest.fromBytes=[ + "0.0.5005" +] + + +org.hiero.sdk.DelegateContractIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +org.hiero.sdk.DelegateContractIdTest.fromSolidityAddressWith0x=[ + "0.0.5005" +] + + +org.hiero.sdk.DelegateContractIdTest.fromString=[ + "0.0.5005" +] + + +org.hiero.sdk.DelegateContractIdTest.toBytes=[ + "188d27" +] + + +org.hiero.sdk.DelegateContractIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/DuplicateTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/DuplicateTransactionTest.java index db15c800ad..3e3ff69188 100644 --- a/sdk/src/test/java/com/hiero/sdk/DuplicateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/DuplicateTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java b/sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java rename to sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java index 886fe79f9e..2e81d3fe28 100644 --- a/sdk/src/test/java/com/hiero/sdk/ECDSAPrivateKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.utils.Bip32Utils; +import org.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java b/sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java rename to sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java index c9ad2a2986..55b378fd9e 100644 --- a/sdk/src/test/java/com/hiero/sdk/ECDSAPublicKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; @@ -8,6 +8,7 @@ import java.math.BigDecimal; import java.util.Collections; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -52,8 +53,8 @@ void keyByteSerialization2() { @Test void keyByteValidation() { byte[] invalidKeyECDSA = new byte[33]; - assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyECDSA)); - assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(invalidKeyECDSA)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyECDSA)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(invalidKeyECDSA)); byte[] invalidCompressedKey = new byte[] { 0x00, @@ -132,10 +133,10 @@ void keyByteValidation() { 0x4f, 0x59 }; - assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(validCompressedKey)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(validCompressedKey)); byte[] validDERKey = PrivateKey.generateECDSA().getPublicKey().toBytesDER(); - assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(validDERKey)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytesECDSA(validDERKey)); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java b/sdk/src/test/java/org/hiero/sdk/Ed25519PrivateKeyTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java rename to sdk/src/test/java/org/hiero/sdk/Ed25519PrivateKeyTest.java index 6d29b65c87..d82a2fe4dc 100644 --- a/sdk/src/test/java/com/hiero/sdk/Ed25519PrivateKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/Ed25519PrivateKeyTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -8,6 +8,7 @@ import java.io.StringReader; import java.nio.charset.StandardCharsets; import java.util.stream.Stream; +import org.assertj.core.api.Assertions; import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; @@ -268,7 +269,7 @@ void keyFromGeneratedMnemonic24() { byte[] signature = privateKey.sign(messageToSign); - assertThat(Ed25519.verify( + Assertions.assertThat(Ed25519.verify( signature, 0, privateKey.getPublicKey().toBytes(), 0, messageToSign, 0, messageToSign.length)) .isTrue(); } @@ -283,7 +284,7 @@ void keyFromGeneratedMnemonic12() { byte[] signature = privateKey.sign(messageToSign); - assertThat(Ed25519.verify( + Assertions.assertThat(Ed25519.verify( signature, 0, privateKey.getPublicKey().toBytes(), 0, messageToSign, 0, messageToSign.length)) .isTrue(); } diff --git a/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java b/sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java rename to sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java index 7b7fc26833..7f4106a877 100644 --- a/sdk/src/test/java/com/hiero/sdk/Ed25519PublicKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; @@ -36,7 +36,7 @@ void verifyTransaction() { void keyByteValidation() { byte[] invalidKeyED25519 = new byte[32]; Assertions.assertDoesNotThrow(() -> PublicKey.fromBytes(invalidKeyED25519)); - assertDoesNotThrow(() -> PublicKey.fromBytesED25519(invalidKeyED25519)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytesED25519(invalidKeyED25519)); byte[] invalidKey = new byte[] { 0x00, @@ -81,10 +81,10 @@ void keyByteValidation() { .isThrownBy(() -> PublicKey.fromBytesED25519(malformedKey)); byte[] validKey = PrivateKey.generateED25519().getPublicKey().toBytes(); - assertDoesNotThrow(() -> PublicKey.fromBytesED25519(validKey)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytesED25519(validKey)); byte[] validDERKey = PrivateKey.generateED25519().getPublicKey().toBytesDER(); - assertDoesNotThrow(() -> PublicKey.fromBytesED25519(validDERKey)); + Assertions.assertDoesNotThrow(() -> PublicKey.fromBytesED25519(validDERKey)); } @Test diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java b/sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java rename to sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java index 6ef2432d24..6ec6406c14 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumFlowMockTest.java +++ b/sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java @@ -1,22 +1,21 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.FileID; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseCodeEnum; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionGetReceiptResponse; -import com.hiero.sdk.proto.TransactionReceipt; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.FileID; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionGetReceiptResponse; +import org.hiero.sdk.proto.TransactionReceipt; +import org.hiero.sdk.proto.TransactionResponse; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -106,7 +105,7 @@ void extractsCallData(String versionToTest) assertThat(transactionBody.getDataCase()) .isEqualByComparingTo(TransactionBody.DataCase.ETHEREUMTRANSACTION); assertThat(transactionBody.hasEthereumTransaction()).isTrue(); - Assertions.assertThat(EthereumTransactionData.fromBytes(transactionBody + assertThat(EthereumTransactionData.fromBytes(transactionBody .getEthereumTransaction() .getEthereumData() .toByteArray()) diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java b/sdk/src/test/java/org/hiero/sdk/EthereumTransactionDataLegacyTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java rename to sdk/src/test/java/org/hiero/sdk/EthereumTransactionDataLegacyTest.java index 1488e5b1f6..18a2a05a2e 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionDataLegacyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/EthereumTransactionDataLegacyTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/EthereumTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/EthereumTransactionTest.java index a26e668ef6..e9adc0761a 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/EthereumTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/EthereumTransactionTest.snap similarity index 79% rename from sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/EthereumTransactionTest.snap index 8a36a32e0e..e49d5846e7 100644 --- a/sdk/src/test/java/com/hiero/sdk/EthereumTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/EthereumTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.EthereumTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nethereum_transaction {\n call_data {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n ethereum_data: \"\\336\\255\\276\\357\"\n max_gas_allowance: 300000000\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.EthereumTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nethereum_transaction {\n call_data {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n ethereum_data: \"\\336\\255\\276\\357\"\n max_gas_allowance: 300000000\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java b/sdk/src/test/java/org/hiero/sdk/ExchangeRatesTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java rename to sdk/src/test/java/org/hiero/sdk/ExchangeRatesTest.java index 04078c9929..61827c7a81 100644 --- a/sdk/src/test/java/com/hiero/sdk/ExchangeRatesTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ExchangeRatesTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java b/sdk/src/test/java/org/hiero/sdk/ExecutableTest.java similarity index 85% rename from sdk/src/test/java/com/hiero/sdk/ExecutableTest.java rename to sdk/src/test/java/org/hiero/sdk/ExecutableTest.java index 75419aa0d2..1227e7cefe 100644 --- a/sdk/src/test/java/com/hiero/sdk/ExecutableTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ExecutableTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -9,13 +9,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.hiero.sdk.Executable.GrpcRequest; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseCodeEnum; -import com.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.Executable.GrpcRequest; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import io.grpc.StatusRuntimeException; import java.time.Duration; @@ -31,6 +31,7 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; import org.mockito.stubbing.Answer; class ExecutableTest { @@ -42,13 +43,13 @@ class ExecutableTest { @BeforeEach void setup() { client = Client.forMainnet(); - network = mock(Network.class); + network = Mockito.mock(Network.class); client.network = network; client.setLogger(new Logger(LogLevel.WARN)); - node3 = mock(Node.class); - node4 = mock(Node.class); - node5 = mock(Node.class); + node3 = Mockito.mock(Node.class); + node4 = Mockito.mock(Node.class); + node5 = Mockito.mock(Node.class); when(node3.getAccountId()).thenReturn(new AccountId(3)); when(node4.getAccountId()).thenReturn(new AccountId(4)); @@ -71,7 +72,7 @@ void firstNodeHealthy() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - Assertions.assertThat(node).isEqualTo(node3); + assertThat(node).isEqualTo(node3); } @Test @@ -88,8 +89,8 @@ void calloptionsShouldRespectGrpcDeadline() { var grpcRequest = tx.getGrpcRequest(1); var timeRemaining = grpcRequest.getCallOptions().getDeadline().timeRemaining(TimeUnit.MILLISECONDS); - Assertions.assertThat(timeRemaining).isLessThan(10000); - Assertions.assertThat(timeRemaining).isGreaterThan(9000); + assertThat(timeRemaining).isLessThan(10000); + assertThat(timeRemaining).isGreaterThan(9000); } @Test @@ -124,7 +125,7 @@ void executableShouldUseGrpcDeadline() throws InterruptedException, PrecheckStat assertThat(grpcTimeRemaining).isGreaterThan(0); // transaction's grpc deadline should keep its original value - Assertions.assertThat(tx.grpcDeadline().toMillis()).isEqualTo(defaultDeadlineMs); + assertThat(tx.grpcDeadline().toMillis()).isEqualTo(defaultDeadlineMs); currentTimeRemaining.set(currentTimeRemaining.get() - minimumRetryDelayMs); @@ -161,7 +162,7 @@ void multipleNodesUnhealthy() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - Assertions.assertThat(node).isEqualTo(node4); + assertThat(node).isEqualTo(node4); } @Test @@ -182,7 +183,7 @@ void allNodesUnhealthy() { tx.nodeAccountIds.setIndex(1); var node = tx.getNodeForExecute(1); - Assertions.assertThat(node).isEqualTo(node4); + assertThat(node).isEqualTo(node4); } @Test @@ -201,12 +202,12 @@ void multipleRequestsWithSingleHealthyNode() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - Assertions.assertThat(node).isEqualTo(node3); + assertThat(node).isEqualTo(node3); tx.nodeAccountIds.advance(); tx.nodes.advance(); node = tx.getNodeForExecute(2); - Assertions.assertThat(node).isEqualTo(node3); + assertThat(node).isEqualTo(node3); verify(node4).getRemainingTimeForBackoff(); verify(node5).getRemainingTimeForBackoff(); } @@ -234,15 +235,15 @@ void multipleRequestsWithNoHealthyNodes() { tx.setMaxBackoff(Duration.ofMillis(1000)); var node = tx.getNodeForExecute(1); - Assertions.assertThat(node).isEqualTo(node5); + assertThat(node).isEqualTo(node5); i.incrementAndGet(); node = tx.getNodeForExecute(2); - Assertions.assertThat(node).isEqualTo(node4); + assertThat(node).isEqualTo(node4); i.incrementAndGet(); node = tx.getNodeForExecute(3); - Assertions.assertThat(node).isEqualTo(node3); + assertThat(node).isEqualTo(node3); } @Test @@ -252,9 +253,9 @@ void successfulExecute() throws PrecheckStatusException, TimeoutException { @Nullable @Override TransactionResponse mapResponse( - com.hiero.sdk.proto.TransactionResponse response, + org.hiero.sdk.proto.TransactionResponse response, AccountId nodeId, - com.hiero.sdk.proto.Transaction request) { + org.hiero.sdk.proto.Transaction request) { return new TransactionResponse( new AccountId(3), TransactionId.withValidStart(new AccountId(3), now), @@ -267,12 +268,12 @@ TransactionResponse mapResponse( var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() + var txResp = org.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute(client); + org.hiero.sdk.TransactionResponse resp = (org.hiero.sdk.TransactionResponse) tx.execute(client); assertThat(resp.nodeId).isEqualTo(new AccountId(3)); assertThat(resp.getValidateStatus()).isTrue(); @@ -292,9 +293,9 @@ void executeWithChannelFailure() throws PrecheckStatusException, TimeoutExceptio @Nullable @Override TransactionResponse mapResponse( - com.hiero.sdk.proto.TransactionResponse response, + org.hiero.sdk.proto.TransactionResponse response, AccountId nodeId, - com.hiero.sdk.proto.Transaction request) { + org.hiero.sdk.proto.Transaction request) { return new TransactionResponse( new AccountId(4), TransactionId.withValidStart(new AccountId(4), now), @@ -306,12 +307,12 @@ TransactionResponse mapResponse( var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() + var txResp = org.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute(client); + org.hiero.sdk.TransactionResponse resp = (org.hiero.sdk.TransactionResponse) tx.execute(client); verify(node3).channelFailedToConnect(any(Instant.class)); verify(node4).channelFailedToConnect(any(Instant.class)); @@ -344,9 +345,9 @@ void executeWithAllUnhealthyNodes() throws PrecheckStatusException, TimeoutExcep @Nullable @Override TransactionResponse mapResponse( - com.hiero.sdk.proto.TransactionResponse response, + org.hiero.sdk.proto.TransactionResponse response, AccountId nodeId, - com.hiero.sdk.proto.Transaction request) { + org.hiero.sdk.proto.Transaction request) { return new TransactionResponse( new AccountId(3), TransactionId.withValidStart(new AccountId(3), now), @@ -358,12 +359,12 @@ TransactionResponse mapResponse( var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() + var txResp = org.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.OK) .build(); tx.blockingUnaryCall = (grpcRequest) -> txResp; - com.hiero.sdk.TransactionResponse resp = (com.hiero.sdk.TransactionResponse) tx.execute(client); + org.hiero.sdk.TransactionResponse resp = (org.hiero.sdk.TransactionResponse) tx.execute(client); verify(node3, times(2)).channelFailedToConnect(any(Instant.class)); verify(node4).channelFailedToConnect(any(Instant.class)); @@ -446,7 +447,7 @@ void executeQueryDelay() throws PrecheckStatusException, TimeoutException { AtomicInteger i = new AtomicInteger(); var tx = new DummyQuery() { @Override - Status mapResponseStatus(com.hiero.sdk.proto.Response response) { + Status mapResponseStatus(org.hiero.sdk.proto.Response response) { return Status.RECEIPT_NOT_FOUND; } @@ -458,10 +459,10 @@ ExecutionState getExecutionState(Status status, Response response) { var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var receipt = com.hiero.sdk.proto.TransactionReceipt.newBuilder() + var receipt = org.hiero.sdk.proto.TransactionReceipt.newBuilder() .setStatus(ResponseCodeEnum.OK) .build(); - var receiptResp = com.hiero.sdk.proto.TransactionGetReceiptResponse.newBuilder() + var receiptResp = org.hiero.sdk.proto.TransactionGetReceiptResponse.newBuilder() .setReceipt(receipt) .build(); @@ -480,14 +481,14 @@ void executeUserError() throws PrecheckStatusException, TimeoutException { var tx = new DummyTransaction() { @Override - Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { + Status mapResponseStatus(org.hiero.sdk.proto.TransactionResponse response) { return Status.ACCOUNT_DELETED; } }; var nodeAccountIds = Arrays.asList(new AccountId(3), new AccountId(4), new AccountId(5)); tx.setNodeAccountIds(nodeAccountIds); - var txResp = com.hiero.sdk.proto.TransactionResponse.newBuilder() + var txResp = org.hiero.sdk.proto.TransactionResponse.newBuilder() .setNodeTransactionPrecheckCode(ResponseCodeEnum.ACCOUNT_DELETED) .build(); @@ -501,13 +502,13 @@ Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { void shouldRetryReturnsCorrectStates() { var tx = new DummyTransaction(); - Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)) + assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)) .isEqualTo(ExecutionState.SERVER_ERROR); - Assertions.assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)) + assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)) .isEqualTo(ExecutionState.SERVER_ERROR); - Assertions.assertThat(tx.getExecutionState(Status.BUSY, null)).isEqualTo(ExecutionState.RETRY); - Assertions.assertThat(tx.getExecutionState(Status.OK, null)).isEqualTo(ExecutionState.SUCCESS); - Assertions.assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)) + assertThat(tx.getExecutionState(Status.BUSY, null)).isEqualTo(ExecutionState.RETRY); + assertThat(tx.getExecutionState(Status.OK, null)).isEqualTo(ExecutionState.SUCCESS); + assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)) .isEqualTo(ExecutionState.REQUEST_ERROR); } @@ -517,14 +518,14 @@ void shouldSetMaxRetry() { tx.setMaxRetry(1); - Assertions.assertThat(tx.getMaxRetry()).isEqualTo(1); + assertThat(tx.getMaxRetry()).isEqualTo(1); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> tx.setMaxRetry(0)); } static class DummyTransaction> extends Executable< - T, com.hiero.sdk.proto.Transaction, com.hiero.sdk.proto.TransactionResponse, TransactionResponse> { + T, org.hiero.sdk.proto.Transaction, org.hiero.sdk.proto.TransactionResponse, TransactionResponse> { @Override void onExecute(Client client) {} @@ -537,27 +538,27 @@ CompletableFuture onExecuteAsync(Client client) { @Nullable @Override - com.hiero.sdk.proto.Transaction makeRequest() { + org.hiero.sdk.proto.Transaction makeRequest() { return null; } @Nullable @Override TransactionResponse mapResponse( - com.hiero.sdk.proto.TransactionResponse response, + org.hiero.sdk.proto.TransactionResponse response, AccountId nodeId, - com.hiero.sdk.proto.Transaction request) { + org.hiero.sdk.proto.Transaction request) { return null; } @Override - Status mapResponseStatus(com.hiero.sdk.proto.TransactionResponse response) { + Status mapResponseStatus(org.hiero.sdk.proto.TransactionResponse response) { return Status.OK; } @Nullable @Override - MethodDescriptor + MethodDescriptor getMethodDescriptor() { return null; } @@ -574,22 +575,22 @@ static class DummyQuery extends Query getMethodDescriptor() { + MethodDescriptor getMethodDescriptor() { return null; } @Override - void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) {} + void onMakeRequest(org.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) {} @Override ResponseHeader mapResponseHeader(Response response) { @@ -597,7 +598,7 @@ ResponseHeader mapResponseHeader(Response response) { } @Override - QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) { + QueryHeader mapRequestHeader(org.hiero.sdk.proto.Query request) { return null; } diff --git a/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java b/sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java similarity index 72% rename from sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java rename to sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java index d65342bb0c..4dfbc00487 100644 --- a/sdk/src/test/java/com/hiero/sdk/FeeAssessmentMethodTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -9,7 +9,7 @@ class FeeAssessmentMethodTest { @Test void feeAssessmentMethodToString() { - Assertions.assertThat(FeeAssessmentMethod.valueOf(true)).hasToString(FeeAssessmentMethod.EXCLUSIVE.toString()); + assertThat(FeeAssessmentMethod.valueOf(true)).hasToString(FeeAssessmentMethod.EXCLUSIVE.toString()); assertThat(FeeAssessmentMethod.valueOf(false)).hasToString(FeeAssessmentMethod.INCLUSIVE.toString()); } } diff --git a/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java b/sdk/src/test/java/org/hiero/sdk/FeeSchedulesTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java rename to sdk/src/test/java/org/hiero/sdk/FeeSchedulesTest.java index be8f9a802a..b918b16f40 100644 --- a/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FeeSchedulesTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.snap b/sdk/src/test/java/org/hiero/sdk/FeeSchedulesTest.snap similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.snap rename to sdk/src/test/java/org/hiero/sdk/FeeSchedulesTest.snap index 7048cfec7b..15fad2d09a 100644 --- a/sdk/src/test/java/com/hiero/sdk/FeeSchedulesTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FeeSchedulesTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.FeeSchedulesTest.shouldSerialize=[ +org.hiero.sdk.FeeSchedulesTest.shouldSerialize=[ "FeeSchedules{current=FeeSchedule{transactionFeeSchedules=[TransactionFeeSchedule{requestType=NONE, feeData=null, fees=[FeeData{nodeData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, networkData=FeeComponents{min=2, max=5, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, serviceData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, type=DEFAULT}]}], expirationTime=2019-04-01T22:42:22Z}, next=FeeSchedule{transactionFeeSchedules=[TransactionFeeSchedule{requestType=NONE, feeData=null, fees=[FeeData{nodeData=FeeComponents{min=1, max=2, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, networkData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, serviceData=FeeComponents{min=0, max=0, constant=0, transactionBandwidthByte=0, transactionVerification=0, transactionRamByteHour=0, transactionStorageByteHour=0, contractTransactionGas=0, transferVolumeHbar=0, responseMemoryByte=0, responseDiskByte=0}, type=DEFAULT}]}], expirationTime=2019-04-01T22:37:02Z}}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java index c2b7472922..6cf499be17 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.proto.FileAppendTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.FileAppendTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; diff --git a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.snap similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.snap index 38f7f19302..236754fa7a 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileAppendTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.snap @@ -1,23 +1,23 @@ -com.hiero.sdk.FileAppendTransactionTest.shouldGetAllSignatures=[ +org.hiero.sdk.FileAppendTransactionTest.shouldGetAllSignatures=[ "[{0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=40d079bcb4a9fbdf102051328ee5f3903e166c1dd7c1e748efc95a2fdd640e421c0a8e23709b61e4d8110451adecd71cd16d1293ce0e57ea974de5b6b2ef070e, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=0cbdeaac11d392081289fb67a93a7fd995e86f55764e45b3e5eefd2f64056a38b50e8478e64cb1af5c310c321478e09b60d641a6e898820625d2674dc54ce80e, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=1490ad50f0fb5af40ee1d823e4f4b2603c135b3c7979b1b0ee6a323ba494e0b5cca833157c1106b976c876b060249e7ee2db30a8566d8682a42fac2f5f4a3406, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=23a657e362da4b3ea29673c26d8b17b967c53528449d99b3154e1b81676dc8d0aa229b824f9e613803b3262bc9cecc6dc6e2fc01a21830fb1641b5ed03722e07, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=4b4ed404ef9a37752c070c5eb364b0df0fbe06afb0b64e0743d27767c26b1045e8532308288e2f1a40cced0782b87f20b6cfdcd8b9890c600c0e2146a48ace00, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=95444670cecb07fc452a4e3f350eca481e5462e3349a6741cd4e6746b21c66e67825c169f3b4cf82ab1853f1cf0acedc84b2f565346dc173a93f054c19966b08, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=ce2b975f698ca802721c80a3792fca39d73609afaa8961bb91da569463c50eecb07d7e26e7e8febb5163474139e94533e8eb7016e0c149e0823d7102ed2b0502, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=ea31e49f64fd41773561f81459a2381e0194788853e28ffb683caded7a675d386b2a228c67ec83bfc448f14ee4fd2eae41569f06006c515621e1f26514c9bf0a, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=0aedd8f92e68278823397cb0eddc1c07f1fd80c223781280a0ffb0eef21b516444e4521294ad380e8a46c7f22f1723eef8872ccf4d8aa415345e0a7fe1485c06, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=8cf7f0ae116557d5f4a5bbee82dee3cfe950c0ecedbce5d2a7b729dd7614d47c436e6951c401870f85dadd696160ecee1ab8e65aa607ca942051e78b8f09a406, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=47c3e240259603f3e7fa41ced3eb9931bc4350367aa6529994c048fb0aca1853630bf8fbbdf9b2768c52b91b5f5d669a4adab06ef0851107f6e8012d948ba90b, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=d1a4d3349a1bc7cd0242e09ed9b1811ea99fb6123826b946651ee8c9dd593eb40591697fad4360e3941c9eea55cd2173189df349aa16b9a11db62ed28de8ad06, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=aa009ad11594bb981504f8d4063c9d90bfb0bccc4bda8f9e3ffd326fc39e599fae94ba98110342a449437f7c848e2a9dd6de0d008e8d00c8387ff094c93c2700, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=5a2b40589f128f3bac99649d0aec7230e3c993130f36814c742ae37104e93d22e2b548d97e471f583d1c81bbcf6f916cc03f20375499e3a37b2c6b13a5a94507, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=63800201fd378e81946c73104907b0b0aa70ff5913889b21b4eac730e535f8acbf08f63da5824419fc14155d6fc19f23a53bfd3324d8baa68dc5d00e8974de07, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=084bdc8f8580a2ebcc0a5140f766aca111b5488092a41871d104834dda27d6b99288423835bc7114860ce6c740300ebe9f8ab576e7646097eee7d6692b90d109, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=645d9d66e90a104462741e2f49fe77d2edce5d49a033c9c51768a2fba6deda96a71ad95e00416bb5a8a07cfaf543a1fee8730c11af4a380d6f30ec88d2271c0d, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=2bc0f7e72aa2e953741815ac95135e50ece67543683e6da3a26bc95534d9ca538d802d567fcb154bf98001663dc46d8674ff4e9361021fbe2a55e83f9442f802, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=e83759154409ce22146e31ff826a3ee4940916784e5953c4c0502ef5c2f9e7ca2d114223c3461a491dfebdcc11e511e91400007a1dc3827b7b98c7225239460f, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=595653b3f5cedf84e845f0dc2c503aad94b259eee4c10ad32cd86976b246cd81726ae8edc35e41e9ebae9e27a3ed96aff524b9b04481fad2722fdab8a4ee5a0f, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=dea30ba3201c32f5c23afac9d5b013c4e41a30d08205d21a09722f5aebb0760b2452ba254eea5008de68411560081e94ccd78c5008353aa6bb64779e79078702, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=903762ba6159fcf940281d810a268980cdf2fa35683626d52e41ad18202492fef5f8de2002c49cb56ac9d9e78177823f1f97741634237943459c31540f801502, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=c463b37297427a620f739b3a420512f897745a8451315de360391b2f6879e644ba3a8597e4f6e3a1a135bf354bb0911fe421e0174f48b650f54e3fe86247e507, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=342e41dbd4e3ef300192767ffeb9b062b1fae68027153a84f151fdb1d3ce43592f275d87a7b90a9d6db6a67d32c6ec9e585ce199ed199cdcac0b4ef4ac12200f, }, }, {0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=9e4dcb75574c75c7e54cc76ff08bf9e6c28cb2e74f79eb4ed8e4f968e6829bd994d9fadff9fb265988de757b858e4921c7b4db119c31f6156a79eb62ffc4110c, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=195fdc0b4c9730139ede43d8e80befe7bef91ab8fa2f271173bab926cff2c797117a28716112b6d1ab3b6c669a4b923f5885b40f67885b1a64d0445ad75bbe0e, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=0e3e02a08fd3a807c79c1ce2117612c2902557aa7c57da2494744f45b105f3f67b9977564f83baf2cd7dd4fe2cf0421f9367343a92d90199e97f22bc977f3d0f, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=a9ef610d944c989424477a2e31b970033bffcce8899116820f9eac06f2d06226cfe714e6a835135e2fb632dda80b439199e76870156acd6f81d4c3cf342a3706, }, }, ]" ] -com.hiero.sdk.FileAppendTransactionTest.shouldGetSignatures=[ +org.hiero.sdk.FileAppendTransactionTest.shouldGetSignatures=[ "{0.0.555={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=a762395ad7e3fa298ed990785699133ca64d11a28fb4dfc83d6d95a9a2639b688d5afc288fcdb8168f4a85876b2b785e3303ddec38666bbae4f5436d6334540b, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=8bea3d52ad5badc4ebf5e20f874cf2e5dec3189d3a471c39fd1062743ba7729de1c484f1e8ac2f15343494799e97b5ac220734a261994d91ffed9e113c09d700, }, 0.0.444={302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7=4b8fd70342b6c201f08177de53122be909d5d72f97d29fba69e7ac6ef04d96b19ac417c9b84fbb122bce9c8323bc38bd6165b5750ce16ee4a2f23e28d7123006, 302a300506032b657003210072a1a2b6b694902f095ac85c6a5fa96ab1a87933e3fc1fd66e57ac6af628ca2d=371b502056cbf34c1bd7f9891e82c7a53ab8d92ce1728f790acc9a09989196fbf4c1c111ca010a19f1af82f2480be92229b5a1aadfe4af9142bd212254c88b08, }, }" ] -com.hiero.sdk.FileAppendTransactionTest.shouldHash=[ +org.hiero.sdk.FileAppendTransactionTest.shouldHash=[ "[{0.0.555=d2f10044785bb7ecbfc024a171b28ec877a123a2b6f3b2a48db5595208ea8bd036e4c4babb682d87e06ce62d7c2b1bb3, 0.0.444=38603d6b2a449030ea49b7cbd7e19cd66b4e3f2891ca40df861b4840418cb08575b7ce25426b1192545d352a89f0f3da, }, {0.0.555=74ed3e44b14e41ad5964a52adde1c32932b9dd75f589d0985504bbc483dc778493866ae879769d693e2a6fa80c6a118c, 0.0.444=0939a5cbfb9bbbd545d3e9f961e7fc3bcbf49553ce7e3a00414b5b0964ca9aae0ea878e280efa217503aed65d1057880, }, {0.0.555=9ef69da0531b3828cfc5b14cb5df373ae46922ad192df9d488684b845ce4754b2a20c1e966d2835ea178890fdaac9a00, 0.0.444=1332b1dfb679ea2a91b21de2bed0d086c5139893fce55b0471e2b08ec2e0fbbcee48783eda0a1e876ee0a7086416c26a, }, {0.0.555=e62ca0554d6e40461dbecc035165d35716d61eae59a305414a91a6fb85f36ba3adc1f6b963c429366485fe514407d294, 0.0.444=2deb2d9674c3e238c53080ad4d139f172dc907ba4b898210ed9359f3db92f0880503cca4fec35cd6b47c71ba5dd46aa3, }, {0.0.555=8a7721e7a8d8eede13e0ab5adb5c9520af6099c909592f45f9dc89775f69e16a2bea4a392480f1b750c817787a94099f, 0.0.444=dbb52ed2eea79c5cc58bb0b898ce03f4ee7d4ba6ad94c0d718c0c6b46fd8cea9e2ab76c42221fce44933827e382df57f, }, {0.0.555=0292097e1f3bdd4390134f10b51b2c9928fcfbe4fd54de25d407ee8b93c6ede6dda4c4263786d983de47413f541834e0, 0.0.444=16c12a7acaa5754a1e1adfc40550e5d4b09195c2347dc4fda3882d7a2823dd212ea1682642f211290b8985d45be55a0b, }, {0.0.555=e4c53e598718933cc67491218c478c23be4637e9d89107a3c1699f04143c421fd6bf5f2ff11d31ea646103cd7cd00b57, 0.0.444=5571dfcd8a279d4c33c0e9199c865556ab3aec478ddbc1560dd9c41c53423decb95348fb54b63cbc744fd1e496b2a01f, }, ]" ] -com.hiero.sdk.FileAppendTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nfile_append {\n contents: \"\\001\\002\\003\\004\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.FileAppendTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nfile_append {\n contents: \"\\001\\002\\003\\004\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.FileAppendTransactionTest.shouldSerializeBigContents=[ - "# com.hiero.sdk.proto.TransactionBody\nfile_append {\n contents: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\\n\\nSuspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\\n\\nNunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\\n\\nInteger pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\\n\\nPellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\\n\\nCras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\\n\\nUt interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\\n\\nAenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\\n\\nPellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\\n\\nIn hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\\n\\nVivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\\n\\nDonec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\\n\\nFusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\\n\\nNunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\\n\\nDuis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\\n\\nMauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\\n\\nAenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\\n\\nNunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\\n\\nMauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\\n\\nProin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\\n\\nSuspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\\n\\nIn consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nEtiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\\n\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 444\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.FileAppendTransactionTest.shouldSerializeBigContents=[ + "# org.hiero.sdk.proto.TransactionBody\nfile_append {\n contents: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam augue sem, ut mattis dui laoreet a. Curabitur consequat est euismod, scelerisque metus et, tristique dui. Nulla commodo mauris ut faucibus ultricies. Quisque venenatis nisl nec augue tempus, at efficitur elit eleifend. Duis pharetra felis metus, sed dapibus urna vehicula id. Duis non venenatis turpis, sit amet ornare orci. Donec non interdum quam. Sed finibus nunc et risus finibus, non sagittis lorem cursus. Proin pellentesque tempor aliquam. Sed congue nisl in enim bibendum, condimentum vehicula nisi feugiat.\\n\\nSuspendisse non sodales arcu. Suspendisse sodales, lorem ac mollis blandit, ipsum neque porttitor nulla, et sodales arcu ante fermentum tellus. Integer sagittis dolor sed augue fringilla accumsan. Cras vitae finibus arcu, sit amet varius dolor. Etiam id finibus dolor, vitae luctus velit. Proin efficitur augue nec pharetra accumsan. Aliquam lobortis nisl diam, vel fermentum purus finibus id. Etiam at finibus orci, et tincidunt turpis. Aliquam imperdiet congue lacus vel facilisis. Phasellus id magna vitae enim dapibus vestibulum vitae quis augue. Morbi eu consequat enim. Maecenas neque nulla, pulvinar sit amet consequat sed, tempor sed magna. Mauris lacinia sem feugiat faucibus aliquet. Etiam congue non turpis at commodo. Nulla facilisi.\\n\\nNunc velit turpis, cursus ornare fringilla eu, lacinia posuere leo. Mauris rutrum ultricies dui et suscipit. Curabitur in euismod ligula. Curabitur vitae faucibus orci. Phasellus volutpat vestibulum diam sit amet vestibulum. In vel purus leo. Nulla condimentum lectus vestibulum lectus faucibus, id lobortis eros consequat. Proin mollis libero elit, vel aliquet nisi imperdiet et. Morbi ornare est velit, in vehicula nunc malesuada quis. Donec vehicula convallis interdum.\\n\\nInteger pellentesque in nibh vitae aliquet. Ut at justo id libero dignissim hendrerit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent quis ornare lectus. Nam malesuada non diam quis cursus. Phasellus a libero ligula. Suspendisse ligula elit, congue et nisi sit amet, cursus euismod dolor. Morbi aliquam, nulla a posuere pellentesque, diam massa ornare risus, nec eleifend neque eros et elit.\\n\\nPellentesque a sodales dui. Sed in efficitur ante. Duis eget volutpat elit, et ornare est. Nam felis dolor, placerat mattis diam id, maximus lobortis quam. Sed pellentesque lobortis sem sed placerat. Pellentesque augue odio, molestie sed lectus sit amet, congue volutpat massa. Quisque congue consequat nunc id fringilla. Duis semper nulla eget enim venenatis dapibus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque varius turpis nibh, sit amet malesuada mauris malesuada quis. Vivamus dictum egestas placerat. Vivamus id augue elit.\\n\\nCras fermentum volutpat eros, vitae euismod lorem viverra nec. Donec lectus augue, porta eleifend odio sit amet, condimentum rhoncus urna. Nunc sed odio velit. Morbi non cursus odio, eget imperdiet erat. Nunc rhoncus massa non neque volutpat, sit amet faucibus ante congue. Phasellus nec lorem vel leo accumsan lobortis. Maecenas id ligula bibendum purus suscipit posuere ac eget diam. Nam in quam pretium, semper erat auctor, iaculis odio. Maecenas placerat, nisi ac elementum tempor, felis nulla porttitor orci, ac rhoncus diam justo in elit. Etiam lobortis fermentum ligula in tincidunt. Donec quis vestibulum nunc. Sed eros diam, interdum in porta lobortis, gravida eu magna. Donec diam purus, finibus et sollicitudin quis, fringilla nec nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ultricies sagittis dapibus. Etiam ullamcorper aliquet libero, eu venenatis mauris suscipit id.\\n\\nUt interdum eleifend sem, vel bibendum ipsum volutpat eget. Nunc ac dignissim augue. Aliquam ornare aliquet magna id dignissim. Vestibulum velit sem, lacinia eu rutrum in, rhoncus vitae mauris. Pellentesque scelerisque pulvinar mauris non cursus. Integer id dolor porta, bibendum sem vel, pretium tortor. Fusce a nisi convallis, interdum quam condimentum, suscipit dolor. Sed magna diam, efficitur non nunc in, tincidunt varius mi. Aliquam ullamcorper nulla eu fermentum bibendum. Vivamus a felis pretium, hendrerit enim vitae, hendrerit leo. Suspendisse lacinia lectus a diam consectetur suscipit. Aenean hendrerit nisl sed diam venenatis pellentesque. Nullam egestas lectus a consequat pharetra. Vivamus ornare tellus auctor, facilisis lacus id, feugiat dui. Nam id est ut est rhoncus varius.\\n\\nAenean vel vehicula erat. Aenean gravida risus vitae purus sodales, quis dictum enim porta. Ut elit elit, fermentum sed posuere non, accumsan eu justo. Integer porta malesuada quam, et elementum massa suscipit nec. Donec in elit diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis suscipit vel ante volutpat vestibulum.\\n\\nPellentesque ex arcu, euismod et sapien ut, vulputate suscipit enim. Donec mattis sagittis augue, et mattis lacus. Cras placerat consequat lorem sed luctus. Nam suscipit aliquam sem ac imperdiet. Mauris a semper augue, pulvinar fringilla magna. Integer pretium massa non risus commodo hendrerit. Sed dictum libero id erat sodales mattis. Etiam auctor dolor lectus, ut sagittis enim lobortis vitae. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur nec orci lobortis, cursus risus eget, sollicitudin massa. Integer vel tincidunt mi, id eleifend quam. Nullam facilisis nisl eu mauris congue, vitae euismod nisi malesuada. Vivamus sit amet urna et libero sagittis dictum.\\n\\nIn hac habitasse platea dictumst. Aliquam erat volutpat. Ut dictum, mi a viverra venenatis, mi urna pulvinar nisi, nec gravida lectus diam eget urna. Ut dictum sit amet nisl ut dignissim. Sed sed mauris scelerisque, efficitur augue in, vulputate turpis. Proin dolor justo, bibendum et sollicitudin feugiat, imperdiet sed mi. Sed elementum vitae massa vel lobortis. Cras vitae massa sit amet libero dictum tempus.\\n\\nVivamus ut mauris lectus. Curabitur placerat ornare scelerisque. Cras malesuada nunc quis tortor pretium bibendum vel sed dui. Cras lobortis nibh eu erat blandit, sit amet consequat neque fermentum. Phasellus imperdiet molestie tristique. Cras auctor purus erat, id mollis ligula porttitor eget. Mauris porta pharetra odio et finibus. Suspendisse eu est a ligula bibendum cursus. Mauris ac laoreet libero. Nullam volutpat sem quis rhoncus gravida.\\n\\nDonec malesuada lacus ac iaculis cursus. Sed sem orci, feugiat ac est ut, ultricies posuere nisi. Suspendisse potenti. Phasellus ut ultricies purus. Etiam sem tortor, fermentum quis aliquam eget, consequat ut nulla. Aliquam dictum metus in mi fringilla, vel gravida nulla accumsan. Cras aliquam eget leo vel posuere. Vivamus vitae malesuada nunc. Morbi placerat magna mi, id suscipit lacus auctor quis. Nam at lorem vel odio finibus fringilla ut ac velit. Donec laoreet at nibh quis vehicula.\\n\\nFusce ac tristique nisi. Donec leo nisi, consectetur at tellus sit amet, consectetur ultrices dui. Quisque gravida mollis tempor. Maecenas semper, sapien ut dignissim feugiat, massa enim viverra dolor, non varius eros nulla nec felis. Nunc massa lacus, ornare et feugiat id, bibendum quis purus. Praesent viverra elit sit amet purus consectetur venenatis. Maecenas nibh risus, elementum sit amet enim sagittis, ultrices malesuada lectus. Vivamus non felis ante. Ut vulputate ex arcu. Aliquam porta gravida porta. Aliquam eros leo, malesuada quis eros non, maximus tristique neque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam ligula orci, mollis vel luctus nec, venenatis vitae est. Fusce rutrum convallis nisi.\\n\\nNunc laoreet eget nibh in feugiat. Pellentesque nec arcu cursus, gravida dolor a, pellentesque nisi. Praesent vel justo blandit, placerat risus eget, consectetur orci. Sed maximus metus mi, ut euismod augue ultricies in. Nunc id risus hendrerit, aliquet lorem nec, congue justo. Vestibulum vel nunc ac est euismod mattis ac vitae nulla. Donec blandit luctus mauris, sit amet bibendum dui egestas et. Aenean nec lorem nec elit ornare rutrum nec eget ligula. Fusce a ipsum vitae neque elementum pharetra. Pellentesque ullamcorper ullamcorper libero, vitae porta sem sagittis vel. Interdum et malesuada fames ac ante ipsum primis in faucibus.\\n\\nDuis at massa sit amet risus pellentesque varius sit amet vitae eros. Cras tempor aliquet sapien, vehicula varius neque volutpat et. Donec purus nibh, pellentesque ut lobortis nec, ultricies ultricies nisl. Sed accumsan ut dui sit amet vulputate. Suspendisse eu facilisis massa, a hendrerit mauris. Nulla elementum molestie tincidunt. Donec mi justo, ornare vel tempor id, gravida et orci. Nam molestie erat nec nisi bibendum accumsan. Duis vitae tempor ante. Morbi congue mauris vel sagittis facilisis. Vivamus vehicula odio orci, a tempor nibh euismod in. Proin mattis, nibh at feugiat porta, purus velit posuere felis, quis volutpat sapien dui vel odio. Nam fermentum sem nec euismod aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat.\\n\\nMauris congue lacus tortor. Pellentesque arcu eros, accumsan imperdiet porttitor vitae, mattis nec justo. Nullam ac aliquam mauris. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse potenti. Fusce accumsan tempus felis a sagittis. Maecenas et velit odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aliquam eros lacus, volutpat non urna sed, tincidunt ullamcorper elit. Sed sit amet gravida libero. In varius mi vel diam sollicitudin mollis.\\n\\nAenean varius, diam vitae hendrerit feugiat, libero augue ultrices odio, eget consequat sem tellus eu nisi. Nam dapibus enim et auctor sollicitudin. Nunc iaculis eros orci, ac accumsan eros malesuada ut. Ut semper augue felis, nec sodales lorem consectetur non. Cras gravida eleifend est, et sagittis eros imperdiet congue. Fusce id tellus dapibus nunc scelerisque tempus. Donec tempor placerat libero, in commodo nisi bibendum eu. Donec id eros non est sollicitudin luctus. Duis bibendum bibendum tellus nec viverra. Aliquam non faucibus ex, nec luctus dui. Curabitur efficitur varius urna non dignissim. Suspendisse elit elit, ultrices in elementum eu, tempor at magna.\\n\\nNunc in purus sit amet mi laoreet pulvinar placerat eget sapien. Donec vel felis at dui ultricies euismod quis vel neque. Donec tincidunt urna non eros pretium blandit. Nullam congue tincidunt condimentum. Curabitur et libero nibh. Proin ultricies risus id imperdiet scelerisque. Suspendisse purus mi, viverra vitae risus ut, tempus tincidunt enim. Ut luctus lobortis nisl, eget venenatis tortor cursus non. Mauris finibus nisl quis gravida ultricies. Fusce elementum lacus sit amet nunc congue, in porta nulla tincidunt.\\n\\nMauris ante risus, imperdiet blandit posuere in, blandit eu ipsum. Integer et auctor arcu. Integer quis elementum purus. Nunc in ultricies nisl, sed rutrum risus. Suspendisse venenatis eros nec lorem rhoncus, in scelerisque velit condimentum. Etiam condimentum quam felis, in elementum odio mattis et. In ut nibh porttitor, hendrerit tellus vel, luctus magna. Vestibulum et ligula et dolor pellentesque porta. Aenean efficitur porta massa et bibendum. Nulla vehicula sem in risus volutpat, a eleifend elit maximus.\\n\\nProin orci lorem, auctor a felis eu, pretium lobortis nulla. Phasellus aliquam efficitur interdum. Sed sit amet velit rutrum est dictum facilisis. Duis cursus enim at nisl tincidunt, eu molestie elit vehicula. Cras pellentesque nisl id enim feugiat fringilla. In quis tincidunt neque. Nam eu consectetur dolor. Ut id interdum mauris. Mauris nunc tortor, placerat in tempor ut, vestibulum eu nisl. Integer vel dapibus ipsum. Nunc id erat pulvinar, tincidunt magna id, condimentum massa. Pellentesque consequat est eget odio placerat vehicula. Etiam augue neque, sagittis non leo eu, tristique scelerisque dui. Ut dui urna, blandit quis urna ac, tincidunt tristique turpis.\\n\\nSuspendisse venenatis rhoncus ligula ultrices condimentum. In id laoreet eros. Suspendisse suscipit fringilla leo id euismod. Sed in quam libero. Ut at ligula tellus. Sed tristique gravida dui, at egestas odio aliquam iaculis. Praesent imperdiet velit quis nibh consequat, quis pretium sem sagittis. Donec tortor ex, congue sit amet pulvinar ac, rutrum non est. Praesent ipsum magna, venenatis sit amet vulputate id, eleifend ac ipsum.\\n\\nIn consequat, nisi iaculis laoreet elementum, massa mauris varius nisi, et porta nisi velit at urna. Maecenas sit amet aliquet eros, a rhoncus nisl. Maecenas convallis enim nunc. Morbi purus nisl, aliquam ac tincidunt sed, mattis in augue. Quisque et elementum quam, vitae maximus orci. Suspendisse hendrerit risus nec vehicula placerat. Nulla et lectus nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nEtiam ut sodales ex. Nulla luctus, magna eu scelerisque sagittis, nibh quam consectetur neque, non rutrum dolor metus nec ex. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed egestas augue elit, sollicitudin accumsan massa lobortis ac. Curabitur placerat, dolor a aliquam maximus, velit ipsum laoreet ligula, id ullamcorper lacus nibh eget nisl. Donec eget lacus venenatis enim consequat auctor vel in.\\n\"\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 444\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java b/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java index fa7c497307..a5578e6295 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileContentsQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new FileContentsQuery() .setFileId(FileId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.snap new file mode 100644 index 0000000000..03ef0af9fa --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.FileContentsQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\nfile_get_contents {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java index b6e5831502..12a5acaf0b 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.FileCreateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.FileCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.snap similarity index 82% rename from sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.snap index 189f3e1ccb..d721547f58 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.FileCreateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nfile_create {\n contents: \"\\001\\002\\003\\004\"\n expiration_time {\n seconds: 1554158728\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo: \"Hello memo\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.FileCreateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nfile_create {\n contents: \"\\001\\002\\003\\004\"\n expiration_time {\n seconds: 1554158728\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo: \"Hello memo\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java index d8d43c532d..f8f7e50ff1 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.FileDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.FileDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.snap index 3c48274d8a..2a30b33c93 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.FileDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nfile_delete {\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.FileDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nfile_delete {\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/FileIdTest.java b/sdk/src/test/java/org/hiero/sdk/FileIdTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/FileIdTest.java rename to sdk/src/test/java/org/hiero/sdk/FileIdTest.java index b0bd61c104..d2e6922ae1 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; diff --git a/sdk/src/test/java/org/hiero/sdk/FileIdTest.snap b/sdk/src/test/java/org/hiero/sdk/FileIdTest.snap new file mode 100644 index 0000000000..2377b6b8a8 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/FileIdTest.snap @@ -0,0 +1,23 @@ +org.hiero.sdk.FileIdTest.fromBytes=[ + "0.0.5005" +] + + +org.hiero.sdk.FileIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +org.hiero.sdk.FileIdTest.shouldSerializeFromString=[ + "0.0.5005" +] + + +org.hiero.sdk.FileIdTest.toBytes=[ + "188d27" +] + + +org.hiero.sdk.FileIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java index fbb601f198..dc2e8a6778 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new FileInfoQuery() .setFileId(FileId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.snap new file mode 100644 index 0000000000..ab84c36302 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.FileInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\nfile_get_info {\n file_i_d {\n file_num: 5005\n realm_num: 0\n shard_num: 0\n }\n header {\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java b/sdk/src/test/java/org/hiero/sdk/FileInfoTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/FileInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/FileInfoTest.java index 911623ef2e..930480d5cc 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileInfoTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.FileGetInfoResponse; -import com.hiero.sdk.proto.KeyList; +import org.hiero.sdk.proto.FileGetInfoResponse; +import org.hiero.sdk.proto.KeyList; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/test/java/com/hiero/sdk/FileInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/FileInfoTest.snap similarity index 81% rename from sdk/src/test/java/com/hiero/sdk/FileInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/FileInfoTest.snap index 62c5bc3c36..28d9c29c67 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FileInfoTest.snap @@ -1,18 +1,18 @@ -com.hiero.sdk.FileInfoTest.fromBytes=[ +org.hiero.sdk.FileInfoTest.fromBytes=[ "FileInfo{fileId=0.0.1, size=2, expirationTime=1970-01-01T00:00:00.003Z, isDeleted=true, keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, fileMemo=, ledgerId=mainnet}" ] -com.hiero.sdk.FileInfoTest.fromProtobuf=[ +org.hiero.sdk.FileInfoTest.fromProtobuf=[ "FileInfo{fileId=0.0.1, size=2, expirationTime=1970-01-01T00:00:00.003Z, isDeleted=true, keys=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, fileMemo=, ledgerId=mainnet}" ] -com.hiero.sdk.FileInfoTest.toBytes=[ +org.hiero.sdk.FileInfoTest.toBytes=[ "0a02180110021a0510c08db70120012a240a221220e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b73a0100" ] -com.hiero.sdk.FileInfoTest.toProtobuf=[ - "# com.hiero.sdk.proto.FileGetInfoResponse$FileInfo@e51665b9\ndeleted: true\nexpiration_time {\n nanos: 3000000\n seconds: 0\n}\nfile_i_d {\n file_num: 1\n realm_num: 0\n shard_num: 0\n}\nkeys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nledger_id: \"\\000\"\nsize: 2" +org.hiero.sdk.FileInfoTest.toProtobuf=[ + "# org.hiero.sdk.proto.FileGetInfoResponse$FileInfo@e51665b9\ndeleted: true\nexpiration_time {\n nanos: 3000000\n seconds: 0\n}\nfile_i_d {\n file_num: 1\n realm_num: 0\n shard_num: 0\n}\nkeys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nledger_id: \"\\000\"\nsize: 2" ] diff --git a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java index f655e6d800..d82b96b3fc 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.FileUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.FileUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.snap similarity index 85% rename from sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.snap index 8317211ce2..d56951dff3 100644 --- a/sdk/src/test/java/com/hiero/sdk/FileUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.FileUpdateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nfile_update {\n contents: \"\\001\\002\\003\\004\\005\"\n expiration_time {\n seconds: 1554158728\n }\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo {\n value: \"Hello memo\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.FileUpdateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nfile_update {\n contents: \"\\001\\002\\003\\004\\005\"\n expiration_time {\n seconds: 1554158728\n }\n file_i_d {\n file_num: 6006\n realm_num: 0\n shard_num: 0\n }\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n memo {\n value: \"Hello memo\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java index 8a0e9a9c0a..1e68976039 100644 --- a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.FreezeTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.FreezeTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.snap similarity index 82% rename from sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.snap index 8ad9655009..ffdabafe0b 100644 --- a/sdk/src/test/java/com/hiero/sdk/FreezeTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.FreezeTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nfreeze {\n file_hash: \"\\027#\\220E\\207\\022\\t8\\225G\\0024\\230W\"\n freeze_type: TELEMETRY_UPGRADE\n freeze_type_value: 5\n start_time {\n seconds: 1554158542\n }\n update_file {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.FreezeTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nfreeze {\n file_hash: \"\\027#\\220E\\207\\022\\t8\\225G\\0024\\230W\"\n freeze_type: TELEMETRY_UPGRADE\n freeze_type_value: 5\n start_time {\n seconds: 1554158542\n }\n update_file {\n file_num: 6\n realm_num: 5\n shard_num: 4\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/Function.java b/sdk/src/test/java/org/hiero/sdk/Function.java similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/Function.java rename to sdk/src/test/java/org/hiero/sdk/Function.java index 820a476de8..f7b452886f 100644 --- a/sdk/src/test/java/com/hiero/sdk/Function.java +++ b/sdk/src/test/java/org/hiero/sdk/Function.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; public interface Function { /** diff --git a/sdk/src/test/java/com/hiero/sdk/HbarTest.java b/sdk/src/test/java/org/hiero/sdk/HbarTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/HbarTest.java rename to sdk/src/test/java/org/hiero/sdk/HbarTest.java index f0c0ceb4e3..9f116a4fca 100644 --- a/sdk/src/test/java/com/hiero/sdk/HbarTest.java +++ b/sdk/src/test/java/org/hiero/sdk/HbarTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java b/sdk/src/test/java/org/hiero/sdk/HederaTrustManagerTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java rename to sdk/src/test/java/org/hiero/sdk/HederaTrustManagerTest.java index 45eb6fa4fe..59ee569ffd 100644 --- a/sdk/src/test/java/com/hiero/sdk/HederaTrustManagerTest.java +++ b/sdk/src/test/java/org/hiero/sdk/HederaTrustManagerTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/com/hiero/sdk/KeyListTest.java b/sdk/src/test/java/org/hiero/sdk/KeyListTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/KeyListTest.java rename to sdk/src/test/java/org/hiero/sdk/KeyListTest.java index 3ad922b24f..500e4b24c9 100644 --- a/sdk/src/test/java/com/hiero/sdk/KeyListTest.java +++ b/sdk/src/test/java/org/hiero/sdk/KeyListTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.Key; +import org.hiero.sdk.proto.Key; import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -38,7 +38,7 @@ void fromProtobuf() { var protoKey2 = Key.newBuilder() .setEd25519(ByteString.copyFrom(mTestPublicKey3.toBytes())) .build(); - var protoKeyList = com.hiero.sdk.proto.KeyList.newBuilder() + var protoKeyList = org.hiero.sdk.proto.KeyList.newBuilder() .addAllKeys(List.of(protoKey1, protoKey2, protoKey3)) .build(); diff --git a/sdk/src/test/java/com/hiero/sdk/KeyTest.java b/sdk/src/test/java/org/hiero/sdk/KeyTest.java similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/KeyTest.java rename to sdk/src/test/java/org/hiero/sdk/KeyTest.java index 2bc4a4728c..560adc5efa 100644 --- a/sdk/src/test/java/com/hiero/sdk/KeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/KeyTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.Key.fromBytes; +import static org.hiero.sdk.Key.fromBytes; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -9,9 +9,9 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.Key; -import com.hiero.sdk.proto.KeyList; -import com.hiero.sdk.proto.ThresholdKey; +import org.hiero.sdk.proto.Key; +import org.hiero.sdk.proto.KeyList; +import org.hiero.sdk.proto.ThresholdKey; import java.math.BigInteger; import java.util.List; import org.bouncycastle.util.encoders.Hex; @@ -128,12 +128,12 @@ void fromProtoKeyKeyList() { var protoKey = Key.newBuilder().setKeyList(protoKeyList).build(); // when - var cut = com.hiero.sdk.Key.fromProtobufKey(protoKey); + var cut = org.hiero.sdk.Key.fromProtobufKey(protoKey); // then - assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(org.hiero.sdk.KeyList.class); - var keyList = (com.hiero.sdk.KeyList) cut; + var keyList = (org.hiero.sdk.KeyList) cut; var actual = keyList.toProtobufKey().getKeyList(); assertThat(actual.getKeysCount()).isEqualTo(2); @@ -160,12 +160,12 @@ void fromProtoKeyThresholdKey() { var protoKey = Key.newBuilder().setThresholdKey(protoThresholdKey).build(); // when - var cut = com.hiero.sdk.Key.fromProtobufKey(protoKey); + var cut = org.hiero.sdk.Key.fromProtobufKey(protoKey); // then - assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(org.hiero.sdk.KeyList.class); - var thresholdKey = (com.hiero.sdk.KeyList) cut; + var thresholdKey = (org.hiero.sdk.KeyList) cut; var actual = thresholdKey.toProtobufKey().getThresholdKey(); assertThat(actual.getThreshold()).isEqualTo(1); @@ -181,7 +181,7 @@ void throwsUnsupportedKey() { var protoKey = Key.newBuilder().setRSA3072(ByteString.copyFrom(keyBytes)).build(); assertThatExceptionOfType(IllegalStateException.class) - .isThrownBy(() -> com.hiero.sdk.Key.fromProtobufKey(protoKey)); + .isThrownBy(() -> org.hiero.sdk.Key.fromProtobufKey(protoKey)); } @Test @@ -219,7 +219,7 @@ void keyListMethods() { var key3 = PrivateKey.fromString( "302e020100300506032b657004220420db484b828e64b2d8f12ce3c0a0e93a0b8cce7af1bb8f39c97732394482538e12"); - var keyList = com.hiero.sdk.KeyList.withThreshold(1); + var keyList = org.hiero.sdk.KeyList.withThreshold(1); keyList.add(key1); keyList.addAll(List.of(key2, key3)); @@ -234,7 +234,7 @@ void keyListMethods() { assertThat(arr[1]).isEqualTo(key2); assertThat(arr[2]).isEqualTo(key3); - arr = new com.hiero.sdk.Key[] {null, null, null}; + arr = new org.hiero.sdk.Key[] {null, null, null}; keyList.toArray(arr); assertThat(arr[0]).isEqualTo(key1); assertThat(arr[1]).isEqualTo(key2); @@ -301,9 +301,9 @@ void fromBytesKeyList() throws InvalidProtocolBufferException { var cut = fromBytes(bytes); - assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(org.hiero.sdk.KeyList.class); - var keyList = (com.hiero.sdk.KeyList) cut; + var keyList = (org.hiero.sdk.KeyList) cut; var actual = keyList.toProtobufKey().getKeyList(); assertThat(actual.getKeysCount()).isEqualTo(2); @@ -331,9 +331,9 @@ void fromBytesThresholdKey() throws InvalidProtocolBufferException { var cut = fromBytes(bytes); - assertThat(cut.getClass()).isEqualTo(com.hiero.sdk.KeyList.class); + assertThat(cut.getClass()).isEqualTo(org.hiero.sdk.KeyList.class); - var thresholdKey = (com.hiero.sdk.KeyList) cut; + var thresholdKey = (org.hiero.sdk.KeyList) cut; var actual = thresholdKey.toProtobufKey().getThresholdKey(); assertThat(actual.getThreshold()).isEqualTo(1); diff --git a/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java b/sdk/src/test/java/org/hiero/sdk/KeystoreTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/KeystoreTest.java rename to sdk/src/test/java/org/hiero/sdk/KeystoreTest.java index 64262f0001..6e1adbe0fc 100644 --- a/sdk/src/test/java/com/hiero/sdk/KeystoreTest.java +++ b/sdk/src/test/java/org/hiero/sdk/KeystoreTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/ListInputTest.java b/sdk/src/test/java/org/hiero/sdk/ListInputTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/ListInputTest.java rename to sdk/src/test/java/org/hiero/sdk/ListInputTest.java index fa83313483..70d8e50d7e 100644 --- a/sdk/src/test/java/com/hiero/sdk/ListInputTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ListInputTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/LiveHashAddTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/LiveHashAddTransactionTest.java index ae32b4abdc..43b52acbd1 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashAddTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/LiveHashAddTransactionTest.snap similarity index 84% rename from sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/LiveHashAddTransactionTest.snap index e156af428b..b5126cf751 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashAddTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashAddTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.LiveHashAddTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_add_live_hash {\n live_hash {\n account_id {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 2592000\n }\n hash: \"hash\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.LiveHashAddTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_add_live_hash {\n live_hash {\n account_id {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n duration {\n seconds: 2592000\n }\n hash: \"hash\"\n keys {\n keys {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n }\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/LiveHashDeleteTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/LiveHashDeleteTransactionTest.java index c5d49dafac..eb3976ea54 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashDeleteTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/LiveHashDeleteTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/LiveHashDeleteTransactionTest.snap index f9223e1d88..fbbe1b5994 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.LiveHashDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\ncrypto_delete_live_hash {\n account_of_live_hash {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n live_hash_to_delete: \"hash\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.LiveHashDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\ncrypto_delete_live_hash {\n account_of_live_hash {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n live_hash_to_delete: \"hash\"\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java b/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java index 1829a1830f..d567e09f0f 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -22,7 +22,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new LiveHashQuery() .setAccountId(AccountId.fromString("0.0.100")) .setHash(hash) diff --git a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.snap similarity index 51% rename from sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.snap index 780c3a122d..775892d68b 100644 --- a/sdk/src/test/java/com/hiero/sdk/LiveHashQueryTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.LiveHashQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ncrypto_get_live_hash {\n account_i_d {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n hash: \"\\000\\001\\002\"\n header {\n }\n}" +org.hiero.sdk.LiveHashQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ncrypto_get_live_hash {\n account_i_d {\n account_num: 100\n realm_num: 0\n shard_num: 0\n }\n hash: \"\\000\\001\\002\"\n header {\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java b/sdk/src/test/java/org/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java rename to sdk/src/test/java/org/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java index 270ea63ace..1d96315a96 100644 --- a/sdk/src/test/java/com/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MaxQueryPaymentExceededExceptionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java index 4eb955117d..e1828e1b94 100644 --- a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.snap similarity index 77% rename from sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.snap index 882564a254..ed2688eda5 100644 --- a/sdk/src/test/java/com/hiero/sdk/MessageSubmitTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.MessageSubmitTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nconsensus_submit_message {\n message: \"hello\"\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.MessageSubmitTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nconsensus_submit_message {\n message: \"hello\"\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java b/sdk/src/test/java/org/hiero/sdk/MirrorNodeContractQueryTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/MirrorNodeContractQueryTest.java index c3d291cea6..5c205394fa 100644 --- a/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MirrorNodeContractQueryTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/MirrorNodeContractQueryTest.snap similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/MirrorNodeContractQueryTest.snap index cc85b80081..a3a86e148e 100644 --- a/sdk/src/test/java/com/hiero/sdk/MirrorNodeContractQueryTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/MirrorNodeContractQueryTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.MirrorNodeContractQueryTest.shouldSerialize=[ +org.hiero.sdk.MirrorNodeContractQueryTest.shouldSerialize=[ "MirrorNodeContractEstimateGasQuery{contractId=null, contractEvmAddress='0x1234567890abcdef1234567890abcdef12345678', sender=null, senderEvmAddress='0xabcdefabcdefabcdefabcdefabcdefabcdef', callData=[116, 101, 115, 116, 68, 97, 116, 97], value=1000, gasLimit=500000, gasPrice=20, blockNumber=123456}MirrorNodeContractCallQuery{contractId=null, contractEvmAddress='0x1234567890abcdef1234567890abcdef12345678', sender=null, senderEvmAddress='0xabcdefabcdefabcdefabcdefabcdefabcdef', callData=[116, 101, 115, 116, 68, 97, 116, 97], value=1000, gasLimit=500000, gasPrice=20, blockNumber=123456}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java b/sdk/src/test/java/org/hiero/sdk/MnemonicTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/MnemonicTest.java rename to sdk/src/test/java/org/hiero/sdk/MnemonicTest.java index f183485945..93ba649b31 100644 --- a/sdk/src/test/java/com/hiero/sdk/MnemonicTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MnemonicTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.utils.Bip32Utils; +import org.hiero.sdk.utils.Bip32Utils; import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/test/java/com/hiero/sdk/Mocker.java b/sdk/src/test/java/org/hiero/sdk/Mocker.java similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/Mocker.java rename to sdk/src/test/java/org/hiero/sdk/Mocker.java index e4258df4d4..36cd8ad70a 100644 --- a/sdk/src/test/java/com/hiero/sdk/Mocker.java +++ b/sdk/src/test/java/org/hiero/sdk/Mocker.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; - -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; -import com.hiero.sdk.proto.ConsensusServiceGrpc; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.TokenServiceGrpc; +package org.hiero.sdk; + +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import io.grpc.Server; import io.grpc.ServerMethodDefinition; diff --git a/sdk/src/test/java/com/hiero/sdk/MockingTest.java b/sdk/src/test/java/org/hiero/sdk/MockingTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/MockingTest.java rename to sdk/src/test/java/org/hiero/sdk/MockingTest.java index 9afa0a2e25..dabf41b3e3 100644 --- a/sdk/src/test/java/com/hiero/sdk/MockingTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MockingTest.java @@ -1,26 +1,26 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.AccountID; -import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse; -import com.hiero.sdk.proto.CryptoGetInfoResponse; -import com.hiero.sdk.proto.CryptoServiceGrpc; -import com.hiero.sdk.proto.FileServiceGrpc; -import com.hiero.sdk.proto.Query; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.ResponseCodeEnum; -import com.hiero.sdk.proto.ResponseHeader; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.SmartContractServiceGrpc; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionGetReceiptResponse; -import com.hiero.sdk.proto.TransactionGetRecordResponse; -import com.hiero.sdk.proto.TransactionReceipt; -import com.hiero.sdk.proto.TransactionRecord; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.AccountID; +import org.hiero.sdk.proto.CryptoGetAccountBalanceResponse; +import org.hiero.sdk.proto.CryptoGetInfoResponse; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionGetReceiptResponse; +import org.hiero.sdk.proto.TransactionGetRecordResponse; +import org.hiero.sdk.proto.TransactionReceipt; +import org.hiero.sdk.proto.TransactionRecord; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; import io.grpc.stub.StreamObserver; import java.nio.charset.StandardCharsets; @@ -80,10 +80,10 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetReceipt(St var server = new TestServer("getReceiptRetry" + sync, service); server.client.setMaxAttempts(3); - service.buffer.enqueueResponse(TestResponse.transaction(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)); + service.buffer.enqueueResponse(TestResponse.transaction(org.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)); service.buffer.enqueueResponse(TestResponse.transactionOk()); - com.hiero.sdk.TransactionResponse transactionResponse; + org.hiero.sdk.TransactionResponse transactionResponse; if (sync.equals("sync")) { transactionResponse = new AccountCreateTransaction().execute(server.client); } else { @@ -101,7 +101,7 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetReceipt(St .build()) .build()) .build())) - .enqueueResponse(TestResponse.receipt(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)) + .enqueueResponse(TestResponse.receipt(org.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)) .enqueueResponse(TestResponse.successfulReceipt()); if (sync.equals("sync")) { @@ -118,10 +118,10 @@ void shouldRetryExceptionallyFunctionsCorrectlyForPlatformNotActiveGetRecord(Str var server = new TestServer("getRecordRetry" + sync, service); server.client.setMaxAttempts(3); - service.buffer.enqueueResponse(TestResponse.transaction(com.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)); + service.buffer.enqueueResponse(TestResponse.transaction(org.hiero.sdk.Status.PLATFORM_NOT_ACTIVE)); service.buffer.enqueueResponse(TestResponse.transactionOk()); - com.hiero.sdk.TransactionResponse transactionResponse; + org.hiero.sdk.TransactionResponse transactionResponse; if (sync.equals("sync")) { transactionResponse = new AccountCreateTransaction().execute(server.client); } else { @@ -241,11 +241,11 @@ void contractCreateFlowFunctions(String versionToTest, String stakeType) throws Assertions.assertEquals(3, cryptoService.buffer.queryRequestsReceived.size()); Assertions.assertEquals(3, fileService.buffer.transactionRequestsReceived.size()); Assertions.assertEquals(1, contractService.buffer.transactionRequestsReceived.size()); - var transactions = new ArrayList>(); + var transactions = new ArrayList>(); for (var request : fileService.buffer.transactionRequestsReceived) { - transactions.add(com.hiero.sdk.Transaction.fromBytes(request.toByteArray())); + transactions.add(org.hiero.sdk.Transaction.fromBytes(request.toByteArray())); } - transactions.add(com.hiero.sdk.Transaction.fromBytes( + transactions.add(org.hiero.sdk.Transaction.fromBytes( contractService.buffer.transactionRequestsReceived.get(0).toByteArray())); Assertions.assertInstanceOf(FileCreateTransaction.class, transactions.get(0)); @@ -472,7 +472,7 @@ void hitsTxMaxAttemptsCorrectly(Integer numberOfErrors, Integer maxAttempts, Str "PLATFORM_TRANSACTION_NOT_CREATED, 3, async", "TRANSACTION_EXPIRED, 3, async" }) - void shouldRetryFunctionsCorrectly(com.hiero.sdk.Status status, int numberOfErrors, String sync) throws Exception { + void shouldRetryFunctionsCorrectly(org.hiero.sdk.Status status, int numberOfErrors, String sync) throws Exception { var service = new TestCryptoService(); var server = new TestServer("shouldRetryFunctionsCorrectly" + status + numberOfErrors + sync, service); @@ -510,7 +510,7 @@ void shouldRetryFunctionsCorrectly(com.hiero.sdk.Status status, int numberOfErro "PLATFORM_TRANSACTION_NOT_CREATED, async", "PLATFORM_NOT_ACTIVE, async", }) - void hitsClientMaxAttemptsCorrectly(com.hiero.sdk.Status status, String sync) throws Exception { + void hitsClientMaxAttemptsCorrectly(org.hiero.sdk.Status status, String sync) throws Exception { var service = new TestCryptoService(); var server = new TestServer("shouldRetryFunctionsCorrectly" + status + sync, service); @@ -577,9 +577,9 @@ void defaultMaxTransactionFeeTest() throws Exception { new AccountDeleteTransaction().setMaxTransactionFee(new Hbar(3)).execute(server.client); Assertions.assertEquals(4, service.buffer.transactionRequestsReceived.size()); - var transactions = new ArrayList>(); + var transactions = new ArrayList>(); for (var request : service.buffer.transactionRequestsReceived) { - transactions.add(com.hiero.sdk.Transaction.fromBytes(request.toByteArray())); + transactions.add(org.hiero.sdk.Transaction.fromBytes(request.toByteArray())); } Assertions.assertEquals(new Hbar(2), transactions.get(0).getMaxTransactionFee()); Assertions.assertEquals(new Hbar(5), transactions.get(1).getMaxTransactionFee()); @@ -666,7 +666,7 @@ void canCancelExecuteAsync() throws Exception { var noReceiptResponse = TestResponse.query(Response.newBuilder() .setTransactionGetReceipt(TransactionGetReceiptResponse.newBuilder() .setHeader(ResponseHeader.newBuilder() - .setNodeTransactionPrecheckCode(com.hiero.sdk.Status.RECEIPT_NOT_FOUND.code))) + .setNodeTransactionPrecheckCode(org.hiero.sdk.Status.RECEIPT_NOT_FOUND.code))) .build()); service.buffer.enqueueResponse(noReceiptResponse); diff --git a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java index f336437140..969de04a13 100644 --- a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.QueryHeader; -import com.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Transaction; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -22,7 +22,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new NetworkVersionInfoQuery() .setMaxQueryPayment(Hbar.fromTinybars(100_000)) .onMakeRequest( diff --git a/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.snap new file mode 100644 index 0000000000..4d76e578d3 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.NetworkVersionInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\nnetwork_get_version_info {\n header {\n payment {\n signed_transaction_bytes: \"\\336\\255\\276\\357\"\n }\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.java b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.java index a3d4ba7bae..8e23ed6ae3 100644 --- a/sdk/src/test/java/com/hiero/sdk/NetworkVersionInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.snap new file mode 100644 index 0000000000..d2512a8e22 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.NetworkVersionInfoTest.shouldSerialize=[ + "org.hiero.sdk.NetworkVersionInfo" +] diff --git a/sdk/src/test/java/com/hiero/sdk/NftIdTest.java b/sdk/src/test/java/org/hiero/sdk/NftIdTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/NftIdTest.java rename to sdk/src/test/java/org/hiero/sdk/NftIdTest.java index 45d5452d45..b5f2325ad7 100644 --- a/sdk/src/test/java/com/hiero/sdk/NftIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NftIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/org/hiero/sdk/NftIdTest.snap b/sdk/src/test/java/org/hiero/sdk/NftIdTest.snap new file mode 100644 index 0000000000..93a2ac6f0c --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/NftIdTest.snap @@ -0,0 +1,33 @@ +org.hiero.sdk.NftIdTest.fromBytes=[ + "0.0.5005/574489" +] + + +org.hiero.sdk.NftIdTest.fromString2=[ + "0.0.5005/1234" +] + + +org.hiero.sdk.NftIdTest.fromString=[ + "0.0.5005/1234" +] + + +org.hiero.sdk.NftIdTest.fromStringWithChecksumOnMainnet=[ + "0.0.123-vfmkw/7584" +] + + +org.hiero.sdk.NftIdTest.fromStringWithChecksumOnPreviewnet=[ + "0.0.123-ogizo/487302" +] + + +org.hiero.sdk.NftIdTest.fromStringWithChecksumOnTestnet=[ + "0.0.123-esxsf/584903" +] + + +org.hiero.sdk.NftIdTest.toBytes=[ + "0a03188d2710b826" +] diff --git a/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java index e0687d71b2..7bd3abfc32 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.NodeCreateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.NodeCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.snap similarity index 92% rename from sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.snap index b21a01b450..b42d7dfd34 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.NodeCreateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_create {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description: \"Test description\"\n gossip_ca_certificate: \"\\000\\001\\002\\003\\004\"\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash: \"\\005\\006\\a\\b\\t\"\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.NodeCreateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_create {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description: \"Test description\"\n gossip_ca_certificate: \"\\000\\001\\002\\003\\004\"\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash: \"\\005\\006\\a\\b\\t\"\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java index f88478486a..645df525bd 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.NodeDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.NodeDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.snap similarity index 72% rename from sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.snap index 14a521e4c4..63526fe4ad 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.NodeDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_delete {\n node_id: 420\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.NodeDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_delete {\n node_id: 420\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java index 27380fadeb..dddfacbaa6 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -7,9 +7,9 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.NodeUpdateTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.NodeUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.snap similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.snap index 9d5b085893..bf8f7777fb 100644 --- a/sdk/src/test/java/com/hiero/sdk/NodeUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.NodeUpdateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_update {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description {\n value: \"Test description\"\n }\n gossip_ca_certificate {\n value: \"\\000\\001\\002\\003\\004\"\n }\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash {\n value: \"\\005\\006\\a\\b\\t\"\n }\n node_id: 420\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.NodeUpdateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nnode_update {\n account_id {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n admin_key {\n ed25519: \"\\030\\214\\252`\\231\\024#O\\b\\370\\342\\232\\321g\\274\\273\\346\\221}\\211m\\244R\\306\\017\\230\\017j,\\246\\206\\001\"\n }\n description {\n value: \"Test description\"\n }\n gossip_ca_certificate {\n value: \"\\000\\001\\002\\003\\004\"\n }\n gossip_endpoint {\n domain_name: \"0unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 42\n }\n gossip_endpoint {\n domain_name: \"1unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 43\n }\n gossip_endpoint {\n domain_name: \"2unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 44\n }\n grpc_certificate_hash {\n value: \"\\005\\006\\a\\b\\t\"\n }\n node_id: 420\n service_endpoint {\n domain_name: \"3unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 45\n }\n service_endpoint {\n domain_name: \"4unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 46\n }\n service_endpoint {\n domain_name: \"5unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 47\n }\n service_endpoint {\n domain_name: \"6unit.test.com\"\n ip_address_v4: \"\\000\\001\\002\\003\"\n port: 48\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java b/sdk/src/test/java/org/hiero/sdk/PendingAirdropIdTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java rename to sdk/src/test/java/org/hiero/sdk/PendingAirdropIdTest.java index f6d05c0105..19dd6ae388 100644 --- a/sdk/src/test/java/com/hiero/sdk/PendingAirdropIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/PendingAirdropIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -78,7 +78,7 @@ void testSetNftId() { @Test void testToProtobufWithTokenId() { PendingAirdropId pendingAirdropId = new PendingAirdropId(sender, receiver, tokenId); - com.hiero.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); + org.hiero.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); assertNotNull(proto); assertEquals(sender.toProtobuf(), proto.getSenderId()); @@ -89,7 +89,7 @@ void testToProtobufWithTokenId() { @Test void testToProtobufWithNftId() { PendingAirdropId pendingAirdropId = new PendingAirdropId(sender, receiver, nftId); - com.hiero.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); + org.hiero.sdk.proto.PendingAirdropId proto = pendingAirdropId.toProtobuf(); assertNotNull(proto); assertEquals(sender.toProtobuf(), proto.getSenderId()); @@ -99,7 +99,7 @@ void testToProtobufWithNftId() { @Test void testFromProtobufWithTokenId() { - com.hiero.sdk.proto.PendingAirdropId proto = com.hiero.sdk.proto.PendingAirdropId.newBuilder() + org.hiero.sdk.proto.PendingAirdropId proto = org.hiero.sdk.proto.PendingAirdropId.newBuilder() .setSenderId(sender.toProtobuf()) .setReceiverId(receiver.toProtobuf()) .setFungibleTokenType(tokenId.toProtobuf()) @@ -116,7 +116,7 @@ void testFromProtobufWithTokenId() { @Test void testFromProtobufWithNftId() { - com.hiero.sdk.proto.PendingAirdropId proto = com.hiero.sdk.proto.PendingAirdropId.newBuilder() + org.hiero.sdk.proto.PendingAirdropId proto = org.hiero.sdk.proto.PendingAirdropId.newBuilder() .setSenderId(sender.toProtobuf()) .setReceiverId(receiver.toProtobuf()) .setNonFungibleToken(nftId.toProtobuf()) diff --git a/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java b/sdk/src/test/java/org/hiero/sdk/PrivateKeyTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java rename to sdk/src/test/java/org/hiero/sdk/PrivateKeyTest.java index 5d2b2a0c54..77e5659b23 100644 --- a/sdk/src/test/java/com/hiero/sdk/PrivateKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/PrivateKeyTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/PrngTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/PrngTransactionTest.java index d1759ff697..8e1f0575f3 100644 --- a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/PrngTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/PrngTransactionTest.snap similarity index 73% rename from sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/PrngTransactionTest.snap index 992751a36b..42712f9a75 100644 --- a/sdk/src/test/java/com/hiero/sdk/PrngTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/PrngTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.PrngTransactionTest.shouldSerialize2=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n range: 100\n}" +org.hiero.sdk.PrngTransactionTest.shouldSerialize2=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n range: 100\n}" ] -com.hiero.sdk.PrngTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n}" +org.hiero.sdk.PrngTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}\nutil_prng {\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java b/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java similarity index 85% rename from sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java rename to sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java index c96038e5d7..65ca28f439 100644 --- a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.ProxyStaker; +import org.hiero.sdk.proto.ProxyStaker; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -26,7 +26,7 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.ProxyStaker.fromProtobuf(proxyStaker).toString()) + org.hiero.sdk.ProxyStaker.fromProtobuf(proxyStaker).toString()) .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap b/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.snap similarity index 54% rename from sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap rename to sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.snap index e56fbd1b71..010dcf9025 100644 --- a/sdk/src/test/java/com/hiero/sdk/ProxyStakerTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.ProxyStakerTest.fromProtobuf=[ +org.hiero.sdk.ProxyStakerTest.fromProtobuf=[ "ProxyStaker{accountId=0.0.100, amount=10 tℏ}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java b/sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java similarity index 84% rename from sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java rename to sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java index cb58373d94..bd184a4e22 100644 --- a/sdk/src/test/java/com/hiero/sdk/ReceiptStatusExceptionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.ResponseCodeEnum; import java.time.Instant; import org.junit.jupiter.api.Test; @@ -13,7 +13,7 @@ class ReceiptStatusExceptionTest { void shouldHaveMessage() { var validStart = Instant.ofEpochSecond(1554158542); var txId = new TransactionId(new AccountId(0, 0, 100), validStart); - var txReceipt = TransactionReceipt.fromProtobuf(com.hiero.sdk.proto.TransactionReceipt.newBuilder() + var txReceipt = TransactionReceipt.fromProtobuf(org.hiero.sdk.proto.TransactionReceipt.newBuilder() .setStatusValue(ResponseCodeEnum.INSUFFICIENT_TX_FEE_VALUE) .build()); var e = new ReceiptStatusException(txId, txReceipt); diff --git a/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java b/sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java rename to sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java index 0f002c169a..494c15ef8d 100644 --- a/sdk/src/test/java/com/hiero/sdk/RegenerateTransactionIdsTest.java +++ b/sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.ResponseCodeEnum; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; import java.util.HashSet; import java.util.List; diff --git a/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java b/sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java rename to sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java index a5a0ce980d..17c3e0a6ee 100644 --- a/sdk/src/test/java/com/hiero/sdk/RequestTypeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.HederaFunctionality; +import org.hiero.sdk.proto.HederaFunctionality; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.IntStream; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleCreateTransactionTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ScheduleCreateTransactionTest.java index 3aea7051f2..dff72fb457 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleCreateTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ScheduleCreateTransactionTest.snap similarity index 89% rename from sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ScheduleCreateTransactionTest.snap index b821d28d4f..27ae7f55af 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleCreateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.ScheduleCreateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_create {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n expiration_time {\n seconds: 1554158542\n }\n memo: \"hi\"\n payer_account_i_d {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n scheduled_transaction_body {\n crypto_transfer {\n transfers {\n account_amounts {\n account_i_d {\n account_num: 333\n realm_num: 0\n shard_num: 0\n }\n amount: 1000000000\n }\n account_amounts {\n account_i_d {\n account_num: 555\n realm_num: 0\n shard_num: 0\n }\n amount: -1000000000\n }\n }\n }\n transaction_fee: 100000000\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ScheduleCreateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_create {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n expiration_time {\n seconds: 1554158542\n }\n memo: \"hi\"\n payer_account_i_d {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n scheduled_transaction_body {\n crypto_transfer {\n transfers {\n account_amounts {\n account_i_d {\n account_num: 333\n realm_num: 0\n shard_num: 0\n }\n amount: 1000000000\n }\n account_amounts {\n account_i_d {\n account_num: 555\n realm_num: 0\n shard_num: 0\n }\n amount: -1000000000\n }\n }\n }\n transaction_fee: 100000000\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java index 214f754325..aea3bd9836 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.ScheduleDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ScheduleDeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.snap similarity index 76% rename from sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.snap index 98969d291f..98a1c0c4ab 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.ScheduleDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_delete {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ScheduleDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_delete {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java similarity index 87% rename from sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java index 6f6a5e237b..309e1dab58 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new ScheduleInfoQuery() .setScheduleId(ScheduleId.fromString("0.0.5005")) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.snap new file mode 100644 index 0000000000..060c3a0fc2 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.ScheduleInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\nschedule_get_info {\n header {\n }\n schedule_i_d {\n realm_num: 0\n schedule_num: 5005\n shard_num: 0\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java index 4ff7b7fdf4..0c246d0a1f 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.CryptoDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.CryptoDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import org.junit.jupiter.api.AfterAll; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.snap similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.snap index abd42d9a89..a01debe3a2 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.ScheduleInfoTest.shouldSerialize=[ +org.hiero.sdk.ScheduleInfoTest.shouldSerialize=[ "ScheduleInfo{scheduleId=1.2.3, scheduledTransactionId=0.0.5006.000000000, creatorAccountId=4.5.6, payerAccountId=2.3.4, signatories=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, expirationTime=2019-04-01T22:42:22Z, memo=memo, executedAt=2019-04-01T22:42:22Z, deletedAt=null, ledgerId=testnet, waitForExpiry=true}" ] -com.hiero.sdk.ScheduleInfoTest.shouldSerializeDeleted=[ +org.hiero.sdk.ScheduleInfoTest.shouldSerializeDeleted=[ "ScheduleInfo{scheduleId=1.2.3, scheduledTransactionId=0.0.5006.000000000, creatorAccountId=4.5.6, payerAccountId=2.3.4, signatories=KeyList{threshold=null, keys=[302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7]}, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, expirationTime=2019-04-01T22:42:22Z, memo=memo, executedAt=null, deletedAt=2019-04-01T22:42:22Z, ledgerId=testnet, waitForExpiry=true}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleSignTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/ScheduleSignTransactionTest.java index c409628c00..b4afa40005 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleSignTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/ScheduleSignTransactionTest.snap similarity index 76% rename from sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/ScheduleSignTransactionTest.snap index 553484a7f9..e0b4d254b3 100644 --- a/sdk/src/test/java/com/hiero/sdk/ScheduleSignTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleSignTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.ScheduleSignTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_sign {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.ScheduleSignTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nschedule_sign {\n schedule_i_d {\n realm_num: 0\n schedule_num: 444\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/Snapshot.java b/sdk/src/test/java/org/hiero/sdk/Snapshot.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/Snapshot.java rename to sdk/src/test/java/org/hiero/sdk/Snapshot.java index c2366e744f..3278d02883 100644 --- a/sdk/src/test/java/com/hiero/sdk/Snapshot.java +++ b/sdk/src/test/java/org/hiero/sdk/Snapshot.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java b/sdk/src/test/java/org/hiero/sdk/StakingInfoTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/StakingInfoTest.java index 1d025ee94a..25bcd228ac 100644 --- a/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/StakingInfoTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/StakingInfoTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/StakingInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/StakingInfoTest.snap index f98a1e9bd4..30aef2aec3 100644 --- a/sdk/src/test/java/com/hiero/sdk/StakingInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/StakingInfoTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.StakingInfoTest.shouldSerializeAccount=[ +org.hiero.sdk.StakingInfoTest.shouldSerializeAccount=[ "StakingInfo{declineStakingReward=true, stakePeriodStart=2019-04-01T22:42:22Z, pendingReward=5 ℏ, stakedToMe=10 ℏ, stakedAccountId=1.2.3, stakedNodeId=null}" ] -com.hiero.sdk.StakingInfoTest.shouldSerializeNode=[ +org.hiero.sdk.StakingInfoTest.shouldSerializeNode=[ "StakingInfo{declineStakingReward=true, stakePeriodStart=2019-04-01T22:42:22Z, pendingReward=5 ℏ, stakedToMe=10 ℏ, stakedAccountId=null, stakedNodeId=3}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/StatusTest.java b/sdk/src/test/java/org/hiero/sdk/StatusTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/StatusTest.java rename to sdk/src/test/java/org/hiero/sdk/StatusTest.java index b04c7fce89..030b6c4882 100644 --- a/sdk/src/test/java/com/hiero/sdk/StatusTest.java +++ b/sdk/src/test/java/org/hiero/sdk/StatusTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.ResponseCodeEnum; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java index e094597c95..ede697646b 100644 --- a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SystemDeleteTransactionBody; -import com.hiero.sdk.proto.TimestampSeconds; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SystemDeleteTransactionBody; +import org.hiero.sdk.proto.TimestampSeconds; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.snap similarity index 77% rename from sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.snap index c0ea93ae92..3bdb072343 100644 --- a/sdk/src/test/java/com/hiero/sdk/SystemDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.SystemDeleteTransactionTest.shouldSerializeContract=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n seconds: 1554158542\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.SystemDeleteTransactionTest.shouldSerializeContract=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n expiration_time {\n seconds: 1554158542\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.SystemDeleteTransactionTest.shouldSerializeFile=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n expiration_time {\n seconds: 1554158542\n }\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.SystemDeleteTransactionTest.shouldSerializeFile=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_delete {\n expiration_time {\n seconds: 1554158542\n }\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java index e1ab07e19c..b92dc18645 100644 --- a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.SystemUndeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SystemUndeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.snap index a07e93154e..b6bc4f8105 100644 --- a/sdk/src/test/java/com/hiero/sdk/SystemUndeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.SystemUndeleteTransactionTest.shouldSerializeContract=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.SystemUndeleteTransactionTest.shouldSerializeContract=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n contract_i_d {\n contract_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.SystemUndeleteTransactionTest.shouldSerializeFile=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.SystemUndeleteTransactionTest.shouldSerializeFile=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\nsystem_undelete {\n file_i_d {\n file_num: 444\n realm_num: 0\n shard_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TestResponse.java b/sdk/src/test/java/org/hiero/sdk/TestResponse.java similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/TestResponse.java rename to sdk/src/test/java/org/hiero/sdk/TestResponse.java index 982beda8cd..c5a3ecba8a 100644 --- a/sdk/src/test/java/com/hiero/sdk/TestResponse.java +++ b/sdk/src/test/java/org/hiero/sdk/TestResponse.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.TransactionGetReceiptResponse; -import com.hiero.sdk.proto.TransactionReceipt; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.TransactionGetReceiptResponse; +import org.hiero.sdk.proto.TransactionReceipt; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; import javax.annotation.Nullable; diff --git a/sdk/src/test/java/com/hiero/sdk/TestServer.java b/sdk/src/test/java/org/hiero/sdk/TestServer.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TestServer.java rename to sdk/src/test/java/org/hiero/sdk/TestServer.java index 7ee4279846..317f87461a 100644 --- a/sdk/src/test/java/com/hiero/sdk/TestServer.java +++ b/sdk/src/test/java/org/hiero/sdk/TestServer.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import io.grpc.BindableService; import io.grpc.Server; diff --git a/sdk/src/test/java/com/hiero/sdk/TestService.java b/sdk/src/test/java/org/hiero/sdk/TestService.java similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/TestService.java rename to sdk/src/test/java/org/hiero/sdk/TestService.java index e6ce483819..aa569fc4ca 100644 --- a/sdk/src/test/java/com/hiero/sdk/TestService.java +++ b/sdk/src/test/java/org/hiero/sdk/TestService.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.Query; -import com.hiero.sdk.proto.Response; -import com.hiero.sdk.proto.Transaction; -import com.hiero.sdk.proto.TransactionResponse; +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; import java.util.ArrayDeque; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java index 6a26285003..ae5c46ca04 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -7,9 +7,9 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenAirdropTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.snap similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.snap index e929d51f35..4f498fbbb5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAirdropTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenAirdropTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_airdrop {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n nft_transfers {\n is_approval: true\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: 123\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenAirdropTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_airdrop {\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 2\n }\n }\n token_transfers {\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 3\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 1\n }\n nft_transfers {\n receiver_account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n serial_number: 2\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 3\n }\n }\n token_transfers {\n nft_transfers {\n is_approval: true\n receiver_account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n sender_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n serial_number: 4\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 4\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -1\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: 123\n is_approval: true\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 1\n }\n }\n token_transfers {\n expected_decimals {\n value: 3\n }\n token {\n realm_num: 0\n shard_num: 0\n token_num: 5\n }\n transfers {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n amount: -800\n }\n transfers {\n account_i_d {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n transfers {\n account_i_d {\n account_num: 5008\n realm_num: 0\n shard_num: 0\n }\n amount: 400\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java b/sdk/src/test/java/org/hiero/sdk/TokenAllowanceTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenAllowanceTest.java index 65f206951b..7a74e8e09a 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAllowanceTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenAllowanceTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java index 0b5253438d..09ffef2d17 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenAssociateTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAssociateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.snap index 6ea2349de8..99b5e93e0f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAssociateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenAssociateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_associate {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n tokens {\n realm_num: 0\n shard_num: 0\n token_num: 666\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenAssociateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_associate {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n tokens {\n realm_num: 0\n shard_num: 0\n token_num: 666\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java b/sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.java index 3e05345be0..07e0ed017e 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenAssociationTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.snap new file mode 100644 index 0000000000..611c3037cd --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/TokenAssociationTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.TokenAssociationTest.shouldSerializeAccount=[ + "TokenAssociation{tokenId=1.2.3, accountId=4.5.6}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java index 56b9b2800d..1dc3743c2b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenBurnTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenBurnTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.snap similarity index 76% rename from sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.snap index afdec5cce2..6cc4287227 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenBurnTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TokenBurnTransactionTest.shouldSerializeFungible=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 69\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenBurnTransactionTest.shouldSerializeFungible=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 69\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.TokenBurnTransactionTest.shouldSerializeNft=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 0\n serial_numbers: 420\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenBurnTransactionTest.shouldSerializeNft=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_burn {\n amount: 0\n serial_numbers: 420\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java index dd82329d4f..888c3dac3d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenCancelAirdropTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenCancelAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.snap similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.snap index 03cd3aea82..374ae1b10c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenCancelAirdropTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenCancelAirdropTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_cancel_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenCancelAirdropTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_cancel_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java index 6d7c2c72d5..f74be20f59 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenClaimAirdropTransactionBody; -import com.hiero.sdk.proto.TokenServiceGrpc; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenClaimAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.snap similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.snap index 4d1e4ebf65..76b6ecc17e 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenClaimAirdropTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenClaimAirdropTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_claim_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenClaimAirdropTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_claim_airdrop {\n pending_airdrops {\n fungible_token_type {\n realm_num: 0\n shard_num: 0\n token_num: 123\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n pending_airdrops {\n non_fungible_token {\n serial_number: 123\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 1234\n }\n }\n receiver_id {\n account_num: 456\n realm_num: 0\n shard_num: 0\n }\n sender_id {\n account_num: 457\n realm_num: 0\n shard_num: 0\n }\n }\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java index a097317070..da1c15673b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TokenCreateTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TokenCreateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; @@ -182,7 +182,7 @@ void constructTokenCreateTransactionFungibleFromTransactionBodyProtobuf() { .setSupplyKey(testSupplyKey.toProtobufKey()) .setAdminKey(testAdminKey.toProtobufKey()) .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) - .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setAutoRenewPeriod(org.hiero.sdk.proto.Duration.newBuilder() .setSeconds(testAutoRenewPeriod.toSeconds()) .build()) .setExpiry(Timestamp.newBuilder() @@ -239,14 +239,14 @@ void constructTokenCreateTransactionNftFromTransactionBodyProtobuf() { .setMaxSupply(testMaxSupply) .setAdminKey(testAdminKey.toProtobufKey()) .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) - .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setAutoRenewPeriod(org.hiero.sdk.proto.Duration.newBuilder() .setSeconds(testAutoRenewPeriod.toSeconds()) .build()) .setExpiry(Timestamp.newBuilder() .setSeconds(testExpirationTime.getEpochSecond()) .build()) - .setTokenType(com.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE) - .setSupplyType(com.hiero.sdk.proto.TokenSupplyType.FINITE) + .setTokenType(org.hiero.sdk.proto.TokenType.NON_FUNGIBLE_UNIQUE) + .setSupplyType(org.hiero.sdk.proto.TokenSupplyType.FINITE) .setFreezeKey(testFreezeKey.toProtobufKey()) .setWipeKey(testWipeKey.toProtobufKey()) .setSymbol(testTokenSymbol) diff --git a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.snap similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.snap index 8ff80fb208..0011f61b04 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TokenCreateTransactionTest.shouldSerializeFungible=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 543\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 3\n denominating_token_id {\n realm_num: 3\n shard_num: 4\n token_num: 2\n }\n }\n }\n decimals: 3\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_default: true\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 30\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 0\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenCreateTransactionTest.shouldSerializeFungible=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 543\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 3\n denominating_token_id {\n realm_num: 3\n shard_num: 4\n token_num: 2\n }\n }\n }\n decimals: 3\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_default: true\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 30\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 0\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.TokenCreateTransactionTest.shouldSerializeNft=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 0\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 500\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n supply_type: FINITE\n supply_type_value: 1\n symbol: \"test symbol\"\n token_type: NON_FUNGIBLE_UNIQUE\n token_type_value: 1\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenCreateTransactionTest.shouldSerializeNft=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_creation {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n initial_supply: 0\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n max_supply: 500\n memo: \"test memo\"\n metadata: \"\\001\\002\\003\\004\\005\"\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n supply_type: FINITE\n supply_type_value: 1\n symbol: \"test symbol\"\n token_type: NON_FUNGIBLE_UNIQUE\n token_type_value: 1\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java index 624eb6ac73..7d812026a6 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenDeleteTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDeleteTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.snap index 8de52185d9..100ee94e13 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_deletion {\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_deletion {\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java index 308e9ec09d..3340d569dc 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenDissociateTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDissociateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.snap similarity index 82% rename from sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.snap index cf7c1596d7..447e42d8fd 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenDissociateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenDissociateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_dissociate {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 1\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 2\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenDissociateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_dissociate {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 1\n }\n tokens {\n realm_num: 2\n shard_num: 4\n token_num: 2\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java index b62c484d05..fe642442c3 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap index 9a65ab46d8..f41e40b60b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenFeeScheduleUpdateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_fee_schedule_update {\n custom_fees {\n fee_collector_account_id {\n account_num: 4322\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 10\n denominating_token_id {\n realm_num: 0\n shard_num: 0\n token_num: 483902\n }\n }\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 389042\n realm_num: 0\n shard_num: 0\n }\n fractional_fee {\n fractional_amount {\n denominator: 7\n numerator: 3\n }\n maximum_amount: 100\n minimum_amount: 3\n net_of_transfers: true\n }\n }\n token_id {\n realm_num: 0\n shard_num: 0\n token_num: 8798\n }\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenFeeScheduleUpdateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_fee_schedule_update {\n custom_fees {\n fee_collector_account_id {\n account_num: 4322\n realm_num: 0\n shard_num: 0\n }\n fixed_fee {\n amount: 10\n denominating_token_id {\n realm_num: 0\n shard_num: 0\n token_num: 483902\n }\n }\n }\n custom_fees {\n fee_collector_account_id {\n account_num: 389042\n realm_num: 0\n shard_num: 0\n }\n fractional_fee {\n fractional_amount {\n denominator: 7\n numerator: 3\n }\n maximum_amount: 100\n minimum_amount: 3\n net_of_transfers: true\n }\n }\n token_id {\n realm_num: 0\n shard_num: 0\n token_num: 8798\n }\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java index 290abe4de5..c73b6afb33 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenFreezeAccountTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.snap index afa0e2a6b3..2ae2439f6f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenFreezeTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenFreezeTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_freeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenFreezeTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_freeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java index ba109119be..d35c76ff9c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenGrantKycTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenGrantKycTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.snap index d9dc6b4c4a..e79a110868 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenGrantKycTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenGrantKycTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_grant_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenGrantKycTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_grant_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java index 64158f37c2..284f8c4bda 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -24,7 +24,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new TokenInfoQuery() .setTokenId(testTokenId) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.snap new file mode 100644 index 0000000000..f19475fc70 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.TokenInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ntoken_get_info {\n header {\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java b/sdk/src/test/java/org/hiero/sdk/TokenInfoTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenInfoTest.java index e3646eb591..209af9f896 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenInfoTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; @@ -242,9 +242,9 @@ void toProtobuf() { .isEqualTo(testExpirationTime.getEpochSecond()); assertThat(tokenInfoProto.getTokenInfo().getMemo()).isEqualTo(testTokenMemo); assertThat(tokenInfoProto.getTokenInfo().getTokenType()) - .isEqualTo(com.hiero.sdk.proto.TokenType.valueOf(testTokenType.name())); + .isEqualTo(org.hiero.sdk.proto.TokenType.valueOf(testTokenType.name())); assertThat(tokenInfoProto.getTokenInfo().getSupplyType()) - .isEqualTo(com.hiero.sdk.proto.TokenSupplyType.valueOf(testTokenSupplyType.name())); + .isEqualTo(org.hiero.sdk.proto.TokenSupplyType.valueOf(testTokenSupplyType.name())); assertThat(tokenInfoProto.getTokenInfo().getMaxSupply()).isEqualTo(testTokenMaxSupply); assertThat(tokenInfoProto .getTokenInfo() diff --git a/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenInfoTest.snap similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/TokenInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenInfoTest.snap index 904d2c4049..b3a4318098 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenInfoTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenInfoTest.shouldSerialize=[ +org.hiero.sdk.TokenInfoTest.shouldSerialize=[ "TokenInfo{tokenId=0.6.9, name=test token name, symbol=TTN, decimals=3, totalSupply=1000, treasuryAccountId=7.7.7, adminKey=302a300506032b6570032100da87701097866e73f0dd942cbb3e97063329f905588621b178d21759688d47fc, kycKey=302a300506032b6570032100fb88b337dfd765617be4322ae7ef8533d61e6483050e20ec4845a533bddca4b1, freezeKey=302a300506032b65700321003ded53e32233532f3d8462324cd113abbe4f73216df06d54a11cb691c15b27cd, wipeKey=302a300506032b6570032100525b9c155f902b912dbd81bea6d43a077d7a62dd1fefcfc77de96144d5fac3ee, supplyKey=302a300506032b65700321003b913853afa59b55abc581c2ac0d36580ac2eca4bd101c02173fef02e677ddd5, feeScheduleKey=302a300506032b65700321004bbe95a86d24f8f96773b12826fcbe009688cb0dca88cff117a3a8af50c37113, defaultFreezeStatus=true, defaultKycStatus=true, isDeleted=false, autoRenewAccount=8.9.0, autoRenewPeriod=PT10H, expirationTime=2019-04-01T22:42:22Z, tokenMemo=memo, customFees=[CustomFixedFee{feeCollectorAccountId=0.0.4322, allCollectorsAreExempt=false, amount=10, demoninatingTokenId=0.0.483902}, CustomFractionalFee{feeCollectorAccountId=0.0.389042, allCollectorsAreExempt=false, numerator=3, denominator=7, min=3, max=100, assessmentMethod=INCLUSIVE}], tokenType=FUNGIBLE_COMMON, supplyType=FINITE, maxSupply=1000000, pauseKey=302a300506032b6570032100d16865a98cf8b0b7f8fa3776b20dafc5be04ffeb9a2497720783ce991e2b1974, pauseStatus=true, metadata=[1, 2, 3, 4, 5], metadataKey=302a300506032b6570032100146dec92320a6e46eb1a43767bb1ec95a2e6c0251ab0dd780fe37474d4bac415, ledgerId=mainnet}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java index 8d6bd09243..b46f651ff7 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenMintTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenMintTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.snap similarity index 77% rename from sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.snap index 35a7a1c651..d2e8e9ef9f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenMintTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TokenMintTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenMintTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.TokenMintTransactionTest.shouldSerializeMetadata=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 0\n metadata: \"\\001\\002\\003\\004\\005\"\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenMintTransactionTest.shouldSerializeMetadata=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_mint {\n amount: 0\n metadata: \"\\001\\002\\003\\004\\005\"\n token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java similarity index 92% rename from sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java index e5605e6cdc..80ac561e8c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -22,7 +22,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new TokenNftInfoQuery() .setNftId(TokenId.fromString("0.0.5005").nft(101)) .setMaxQueryPayment(Hbar.fromTinybars(100_000)) diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.snap similarity index 54% rename from sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.snap index 85148c5795..a5ce43d190 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoQueryTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenNftInfoQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ntoken_get_nft_info {\n header {\n }\n nft_i_d {\n serial_number: 101\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 5005\n }\n }\n}" +org.hiero.sdk.TokenNftInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ntoken_get_nft_info {\n header {\n }\n nft_i_d {\n serial_number: 101\n token_i_d {\n realm_num: 0\n shard_num: 0\n token_num: 5005\n }\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenNftInfoTest.java index 9375a53cca..281ca8022f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoTest.snap similarity index 73% rename from sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenNftInfoTest.snap index ff92edc2a1..8d05aecb7f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenNftInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TokenNftInfoTest.shouldSerialize=[ +org.hiero.sdk.TokenNftInfoTest.shouldSerialize=[ "TokenNftInfo{nftId=1.2.3/4, accountId=5.6.7, creationTime=2019-04-01T22:42:22Z, metadata=[-34, -83, -66, -17], ledgerId=mainnet, spenderId=8.9.10}" ] -com.hiero.sdk.TokenNftInfoTest.shouldSerializeNullSpender=[ +org.hiero.sdk.TokenNftInfoTest.shouldSerializeNullSpender=[ "TokenNftInfo{nftId=1.2.3/4, accountId=5.6.7, creationTime=2019-04-01T22:42:22Z, metadata=[-34, -83, -66, -17], ledgerId=mainnet, spenderId=null}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java index e9909a7291..ad752db6c1 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenPauseTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenPauseTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.snap index 6520861ed5..a2f8e165f4 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenPauseTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenPauseTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_pause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenPauseTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_pause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java index 2904fc4be6..dcd4d8dfe1 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenReference; -import com.hiero.sdk.proto.TokenRejectTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenReference; +import org.hiero.sdk.proto.TokenRejectTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.snap similarity index 89% rename from sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.snap index 7bdc6ec768..b0e44be01b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRejectTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenRejectTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_reject {\n owner {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n rejections {\n fungible_token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n }\n rejections {\n fungible_token {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n rejections {\n fungible_token {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n rejections {\n nft {\n serial_number: 2\n token_i_d {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n }\n rejections {\n nft {\n serial_number: 3\n token_i_d {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenRejectTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_reject {\n owner {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n rejections {\n fungible_token {\n realm_num: 2\n shard_num: 1\n token_num: 3\n }\n }\n rejections {\n fungible_token {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n rejections {\n fungible_token {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n rejections {\n nft {\n serial_number: 2\n token_i_d {\n realm_num: 5\n shard_num: 4\n token_num: 6\n }\n }\n }\n rejections {\n nft {\n serial_number: 3\n token_i_d {\n realm_num: 8\n shard_num: 7\n token_num: 9\n }\n }\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java b/sdk/src/test/java/org/hiero/sdk/TokenRelationshipTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenRelationshipTest.java index 4982547dca..0e7ddb93bb 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenRelationshipTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenRelationshipTest.snap similarity index 69% rename from sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenRelationshipTest.snap index 8221c009b0..3bddf54f6e 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRelationshipTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenRelationshipTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenRelationshipTest.shouldSerializeTokenRelationship=[ +org.hiero.sdk.TokenRelationshipTest.shouldSerializeTokenRelationship=[ "TokenRelationship{tokenId=1.2.3, symbol=ABC, balance=55, kycStatus=true, freezeStatus=true, decimals=4, automaticAssociation=true}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java similarity index 95% rename from sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java index 0d5f0f3dc3..36aaeba800 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenRevokeKycTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenRevokeKycTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.snap index 9aee784b32..6d1d8afa82 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenRevokeKycTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenRevokeKycTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_revoke_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenRevokeKycTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_revoke_kyc {\n account {\n account_num: 0\n realm_num: 9\n shard_num: 6\n }\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java b/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java similarity index 73% rename from sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java index d60191f4f5..7ef09e2f6f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenSupplyTypeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.TokenSupplyType; +import org.hiero.sdk.proto.TokenSupplyType; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -26,9 +26,9 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite) + org.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite) .toString(), - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite) + org.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite) .toString()) .toMatchSnapshot(); } @@ -36,16 +36,16 @@ void fromProtobuf() { @Test void toProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite) + org.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeInfinite) .toProtobuf(), - com.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite) + org.hiero.sdk.TokenSupplyType.valueOf(tokenSupplyTypeFinite) .toProtobuf()) .toMatchSnapshot(); } @Test void tokenSupplyTestToString() { - assertThat(com.hiero.sdk.TokenSupplyType.INFINITE).hasToString("INFINITE"); - assertThat(com.hiero.sdk.TokenSupplyType.FINITE).hasToString("FINITE"); + assertThat(org.hiero.sdk.TokenSupplyType.INFINITE).hasToString("INFINITE"); + assertThat(org.hiero.sdk.TokenSupplyType.FINITE).hasToString("FINITE"); } } diff --git a/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.snap new file mode 100644 index 0000000000..23b560d471 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.snap @@ -0,0 +1,10 @@ +org.hiero.sdk.TokenSupplyTypeTest.fromProtobuf=[ + "INFINITE", + "FINITE" +] + + +org.hiero.sdk.TokenSupplyTypeTest.toProtobuf=[ + "INFINITE", + "FINITE" +] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java b/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java similarity index 74% rename from sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java index ccff0b4581..050b9aea69 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.TokenType; +import org.hiero.sdk.proto.TokenType; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -25,16 +25,16 @@ public static void afterAll() { @Test void fromProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toString(), - com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toString()) + org.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toString(), + org.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toString()) .toMatchSnapshot(); } @Test void toProtobuf() { SnapshotMatcher.expect( - com.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toProtobuf(), - com.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toProtobuf()) + org.hiero.sdk.TokenType.valueOf(tokenTypeFungible).toProtobuf(), + org.hiero.sdk.TokenType.valueOf(tokenTypeNonFungible).toProtobuf()) .toMatchSnapshot(); } } diff --git a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.snap similarity index 53% rename from sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenTypeTest.snap index 97be08a8f8..650d078492 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenTypeTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.snap @@ -1,10 +1,10 @@ -com.hiero.sdk.TokenTypeTest.fromProtobuf=[ +org.hiero.sdk.TokenTypeTest.fromProtobuf=[ "FUNGIBLE_COMMON", "NON_FUNGIBLE_UNIQUE" ] -com.hiero.sdk.TokenTypeTest.toProtobuf=[ +org.hiero.sdk.TokenTypeTest.toProtobuf=[ "FUNGIBLE_COMMON", "NON_FUNGIBLE_UNIQUE" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java index 53fa492565..bae73e4ebc 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.snap similarity index 78% rename from sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.snap index 55f4effc6a..f7514314f2 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUnfreezeTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenUnfreezeTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unfreeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenUnfreezeTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unfreeze {\n account {\n account_num: 222\n realm_num: 0\n shard_num: 0\n }\n token {\n realm_num: 5\n shard_num: 6\n token_num: 4\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java index 947a79988d..500accf521 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenUnpauseTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenUnpauseTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.snap similarity index 75% rename from sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.snap index 58df5430f5..a46ce30c5c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUnpauseTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenUnpauseTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unpause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenUnpauseTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_unpause {\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java index 4aa13d9768..96ffe5659e 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenUpdateNftsTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenUpdateNftsTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.snap similarity index 80% rename from sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.snap index 50b78973c3..0724022328 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUpdateNftsTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenUpdateNftsTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update_nfts {\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenUpdateNftsTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update_nfts {\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java index 6dc653b2c5..16dae26747 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -7,10 +7,10 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TokenUpdateTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TokenUpdateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; @@ -137,7 +137,7 @@ void constructTokenUpdateTransactionFromTransactionBodyProtobuf() { .setWipeKey(testWipeKey.toProtobufKey()) .setSupplyKey(testSupplyKey.toProtobufKey()) .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) - .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setAutoRenewPeriod(org.hiero.sdk.proto.Duration.newBuilder() .setSeconds(testAutoRenewPeriod.toSeconds()) .build()) .setExpiry(Timestamp.newBuilder() @@ -148,7 +148,7 @@ void constructTokenUpdateTransactionFromTransactionBodyProtobuf() { .setPauseKey(testPauseKey.toProtobufKey()) .setMetadataKey(testMetadataKey.toProtobufKey()) .setMetadata(BytesValue.of(ByteString.copyFrom(testMetadata))) - .setKeyVerificationMode(com.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION) + .setKeyVerificationMode(org.hiero.sdk.proto.TokenKeyValidation.NO_VALIDATION) .build(); var tx = TransactionBody.newBuilder().setTokenUpdate(transactionBody).build(); diff --git a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.snap similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.snap index 46b4478035..69d75bb4cb 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TokenUpdateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n key_verification_mode: NO_VALIDATION\n key_verification_mode_value: 1\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n memo {\n value: \"test memo\"\n }\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenUpdateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_update {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n expiry {\n seconds: 1554158542\n }\n fee_schedule_key {\n ed25519: \"K\\276\\225\\250m$\\370\\371gs\\261(&\\374\\276\\000\\226\\210\\313\\r\\312\\210\\317\\361\\027\\243\\250\\257P\\303q\\023\"\n }\n freeze_key {\n ed25519: \"=\\355S\\343\\\"3S/=\\204b2L\\321\\023\\253\\276Os!m\\360mT\\241\\034\\266\\221\\301[\\'\\315\"\n }\n key_verification_mode: NO_VALIDATION\n key_verification_mode_value: 1\n kyc_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n memo {\n value: \"test memo\"\n }\n metadata {\n value: \"\\001\\002\\003\\004\\005\"\n }\n metadata_key {\n ed25519: \"\\024m\\354\\2222\\nnF\\353\\032Cv{\\261\\354\\225\\242\\346\\300%\\032\\260\\335x\\017\\343tt\\324\\272\\304\\025\"\n }\n name: \"test name\"\n pause_key {\n ed25519: \"\\321he\\251\\214\\370\\260\\267\\370\\3727v\\262\\r\\257\\305\\276\\004\\377\\353\\232$\\227r\\a\\203\\316\\231\\036+\\031t\"\n }\n supply_key {\n ed25519: \";\\2218S\\257\\245\\233U\\253\\305\\201\\302\\254\\r6X\\n\\302\\354\\244\\275\\020\\034\\002\\027?\\357\\002\\346w\\335\\325\"\n }\n symbol: \"test symbol\"\n token {\n realm_num: 2\n shard_num: 4\n token_num: 0\n }\n treasury {\n account_num: 7\n realm_num: 7\n shard_num: 7\n }\n wipe_key {\n ed25519: \"R[\\234\\025_\\220+\\221-\\275\\201\\276\\246\\324:\\a}zb\\335\\037\\357\\317\\307}\\351aD\\325\\372\\303\\356\"\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java index e8c404a210..45615fec59 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TokenWipeAccountTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenWipeAccountTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.snap similarity index 80% rename from sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.snap index cc62e90c67..42ba8f25ad 100644 --- a/sdk/src/test/java/com/hiero/sdk/TokenWipeTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TokenWipeTransactionTest.shouldSerializeFungible=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 4\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenWipeTransactionTest.shouldSerializeFungible=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 4\n serial_numbers: 8\n serial_numbers: 9\n serial_numbers: 10\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.TokenWipeTransactionTest.shouldSerializeNft=[ - "# com.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 0\n serial_numbers: 444\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TokenWipeTransactionTest.shouldSerializeNft=[ + "# org.hiero.sdk.proto.TransactionBody\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntoken_wipe {\n account {\n account_num: 9\n realm_num: 6\n shard_num: 0\n }\n amount: 0\n serial_numbers: 444\n token {\n realm_num: 0\n shard_num: 0\n token_num: 111\n }\n}\ntransaction_fee: 100000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java index e4e29307fc..ddb170ed2f 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.snap similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.snap index acc2d389fe..3bac9e0702 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicCreateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TopicCreateTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nconsensus_create_topic {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n memo: \"hello memo\"\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TopicCreateTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nconsensus_create_topic {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 5007\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 86400\n }\n memo: \"hello memo\"\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java index b53a39afa3..c9ee4e3b0d 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.snap similarity index 76% rename from sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.snap index aa514810e5..247b1ffb70 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicDeleteTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TopicDeleteTransactionTest.shouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nconsensus_delete_topic {\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TopicDeleteTransactionTest.shouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nconsensus_delete_topic {\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 100000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java b/sdk/src/test/java/org/hiero/sdk/TopicIdTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TopicIdTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicIdTest.java index fe42306954..6ff267108c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; import io.github.jsonSnapshot.SnapshotMatcher; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicIdTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicIdTest.snap new file mode 100644 index 0000000000..25f2f4e9b6 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/TopicIdTest.snap @@ -0,0 +1,23 @@ +org.hiero.sdk.TopicIdTest.fromBytes=[ + "0.0.5005" +] + + +org.hiero.sdk.TopicIdTest.fromSolidityAddress=[ + "0.0.5005" +] + + +org.hiero.sdk.TopicIdTest.shouldSerializeFromString=[ + "0.0.5005" +] + + +org.hiero.sdk.TopicIdTest.toBytes=[ + "188d27" +] + + +org.hiero.sdk.TopicIdTest.toSolidityAddress=[ + "000000000000000000000000000000000000138d" +] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java similarity index 86% rename from sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java index 16da542aa5..72e9e83563 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -20,7 +20,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new TopicInfoQuery() .setTopicId(TopicId.fromString("0.0.5005")) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.snap new file mode 100644 index 0000000000..330a7523d0 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.snap @@ -0,0 +1,3 @@ +org.hiero.sdk.TopicInfoQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\nconsensus_get_topic_info {\n header {\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5005\n }\n}" +] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java b/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java index 45dcd8b682..dac75a7507 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.ConsensusGetTopicInfoResponse; -import com.hiero.sdk.proto.ConsensusTopicInfo; +import org.hiero.sdk.proto.ConsensusGetTopicInfoResponse; +import org.hiero.sdk.proto.ConsensusTopicInfo; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.snap similarity index 88% rename from sdk/src/test/java/com/hiero/sdk/TopicInfoTest.snap rename to sdk/src/test/java/org/hiero/sdk/TopicInfoTest.snap index 582a7d1d25..0cfc1ac308 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicInfoTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.snap @@ -1,18 +1,18 @@ -com.hiero.sdk.TopicInfoTest.fromBytes=[ +org.hiero.sdk.TopicInfoTest.fromBytes=[ "TopicInfo{topicId=0.0.0, topicMemo=1, runningHash=[2], sequenceNumber=3, expirationTime=1970-01-01T00:00:00.004Z, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, submitKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, autoRenewPeriod=PT120H, autoRenewAccountId=0.0.4, ledgerId=testnet}" ] -com.hiero.sdk.TopicInfoTest.fromProtobuf=[ +org.hiero.sdk.TopicInfoTest.fromProtobuf=[ "TopicInfo{topicId=0.0.0, topicMemo=1, runningHash=[2], sequenceNumber=3, expirationTime=1970-01-01T00:00:00.004Z, adminKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, submitKey=302a300506032b6570032100e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b7, autoRenewPeriod=PT120H, autoRenewAccountId=0.0.4, ledgerId=testnet}" ] -com.hiero.sdk.TopicInfoTest.toBytes=[ +org.hiero.sdk.TopicInfoTest.toBytes=[ "12002a640a013112010218032205108092f4012a221220e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b732221220e0c8ec2758a5879ffac226a13c0c516b799e72e35141a0dd828f94d37988a4b73a040880af1a420218044a0101" ] -com.hiero.sdk.TopicInfoTest.toProtobuf=[ - "# com.hiero.sdk.proto.ConsensusGetTopicInfoResponse@a2d5b392\ntopic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 0\n}\ntopic_info {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 432000\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n ledger_id: \"\\001\"\n memo: \"1\"\n running_hash: \"\\002\"\n sequence_number: 3\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}" +org.hiero.sdk.TopicInfoTest.toProtobuf=[ + "# org.hiero.sdk.proto.ConsensusGetTopicInfoResponse@a2d5b392\ntopic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 0\n}\ntopic_info {\n admin_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n auto_renew_account {\n account_num: 4\n realm_num: 0\n shard_num: 0\n }\n auto_renew_period {\n seconds: 432000\n }\n expiration_time {\n nanos: 4000000\n seconds: 0\n }\n ledger_id: \"\\001\"\n memo: \"1\"\n running_hash: \"\\002\"\n sequence_number: 3\n submit_key {\n ed25519: \"\\340\\310\\354\\'X\\245\\207\\237\\372\\302&\\241<\\fQky\\236r\\343QA\\240\\335\\202\\217\\224\\323y\\210\\244\\267\"\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java index 77640ba671..d20752ea22 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageChunkTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ConsensusMessageChunkInfo; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import org.hiero.sdk.proto.ConsensusMessageChunkInfo; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java similarity index 93% rename from sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java index d5e6f41d95..384d436c4c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -8,14 +8,14 @@ import com.google.common.primitives.Longs; import com.google.common.util.concurrent.Uninterruptibles; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.AccountID; -import com.hiero.sdk.proto.ConsensusMessageChunkInfo; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TopicID; -import com.hiero.sdk.proto.TransactionID; -import com.hiero.sdk.proto.mirror.ConsensusServiceGrpc; -import com.hiero.sdk.proto.mirror.ConsensusTopicQuery; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import org.hiero.sdk.proto.AccountID; +import org.hiero.sdk.proto.ConsensusMessageChunkInfo; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TopicID; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.mirror.ConsensusServiceGrpc; +import org.hiero.sdk.proto.mirror.ConsensusTopicQuery; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import io.github.jsonSnapshot.SnapshotMatcher; import io.grpc.Server; import io.grpc.Status; @@ -33,6 +33,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; +import org.assertj.core.api.Assertions; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; @@ -176,7 +177,7 @@ void subscribe() { subscribeToMirror(received::add); assertThat(errors).isEmpty(); - assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); + Assertions.assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); } @Test @@ -193,7 +194,7 @@ void subscribeChunked() { var message = combine( response1.getMessage().toByteArray(), response2.getMessage().toByteArray()); assertThat(errors).isEmpty(); - assertThat(received) + Assertions.assertThat(received) .hasSize(1) .first() .returns(toInstant(response2.getConsensusTimestamp()), t -> t.consensusTimestamp) @@ -218,7 +219,7 @@ void subscribeNoResponse() { subscribeToMirror(received::add); assertThat(errors).isEmpty(); - assertThat(received).isEmpty(); + Assertions.assertThat(received).isEmpty(); } @Test @@ -232,7 +233,7 @@ void errorDuringOnNext() { }); assertThat(errors).hasSize(1).first().isInstanceOf(RuntimeException.class); - assertThat(received).isEmpty(); + Assertions.assertThat(received).isEmpty(); } @ParameterizedTest(name = "Retry recovers w/ status {0} and description {1}") @@ -259,7 +260,7 @@ void retryRecovers(Status.Code code, String description) { subscribeToMirror(received::add); - assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); + Assertions.assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); assertThat(errors).isEmpty(); } @@ -274,7 +275,7 @@ void noRetry(Status.Code code, String description) { subscribeToMirror(received::add); - assertThat(received).isEmpty(); + Assertions.assertThat(received).isEmpty(); assertThat(errors) .hasSize(1) .first() @@ -294,7 +295,7 @@ void customRetry() { subscribeToMirror(received::add); - assertThat(received).hasSize(1).extracting(t -> t.sequenceNumber).containsExactly(1L); + Assertions.assertThat(received).hasSize(1).extracting(t -> t.sequenceNumber).containsExactly(1L); assertThat(errors).isEmpty(); } @@ -316,7 +317,7 @@ void retryWithLimit() { subscribeToMirror(received::add); - assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); + Assertions.assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); assertThat(errors).isEmpty(); } @@ -331,7 +332,7 @@ void retriesExhausted() { subscribeToMirror(received::add); - assertThat(received).isEmpty(); + Assertions.assertThat(received).isEmpty(); assertThat(errors) .hasSize(1) .first() @@ -355,7 +356,7 @@ void errorWhenCallIsCancelled() { .extracting(t -> ((StatusRuntimeException) t).getStatus()) .isEqualTo(Status.CANCELLED); - assertThat(received).isEmpty(); + Assertions.assertThat(received).isEmpty(); } private void subscribeToMirror(Consumer onNext) { diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.snap similarity index 100% rename from sdk/src/test/java/com/hiero/sdk/TopicMessageQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.snap diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java index c797a0be1d..f0c9e209e9 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.snap similarity index 100% rename from sdk/src/test/java/com/hiero/sdk/TopicMessageSubmitTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.snap diff --git a/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java index d1fb8c0c3b..e437ddf3be 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicMessageTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; -import com.hiero.sdk.proto.ConsensusMessageChunkInfo; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.mirror.ConsensusTopicResponse; +import org.hiero.sdk.proto.ConsensusMessageChunkInfo; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java similarity index 97% rename from sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java index d287989008..9ffe24d2b8 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.StringValue; -import com.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; -import com.hiero.sdk.proto.CryptoDeleteTransactionBody; -import com.hiero.sdk.proto.SchedulableTransactionBody; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; +import org.hiero.sdk.proto.CryptoDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; @@ -117,7 +117,7 @@ void constructTopicUpdateTransactionFromTransactionBodyProtobuf() { .build()) .setAdminKey(testAdminKey.toProtobufKey()) .setSubmitKey(testSubmitKey.toProtobufKey()) - .setAutoRenewPeriod(com.hiero.sdk.proto.Duration.newBuilder() + .setAutoRenewPeriod(org.hiero.sdk.proto.Duration.newBuilder() .setSeconds(testAutoRenewPeriod.toSeconds()) .build()) .setAutoRenewAccount(testAutoRenewAccountId.toProtobuf()) diff --git a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap b/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.snap similarity index 85% rename from sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap rename to sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.snap index f2ee0eac88..2f618a888b 100644 --- a/sdk/src/test/java/com/hiero/sdk/TopicUpdateTransactionTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TopicUpdateTransactionTest.clearShouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n key_list {\n }\n }\n auto_renew_account {\n account_num: 0\n realm_num: 0\n shard_num: 0\n }\n memo {\n }\n submit_key {\n key_list {\n }\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TopicUpdateTransactionTest.clearShouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n key_list {\n }\n }\n auto_renew_account {\n account_num: 0\n realm_num: 0\n shard_num: 0\n }\n memo {\n }\n submit_key {\n key_list {\n }\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] -com.hiero.sdk.TopicUpdateTransactionTest.setShouldSerialize=[ - "# com.hiero.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158542\n }\n memo {\n value: \"test memo\"\n }\n submit_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" +org.hiero.sdk.TopicUpdateTransactionTest.setShouldSerialize=[ + "# org.hiero.sdk.proto.TransactionBody\nconsensus_update_topic {\n admin_key {\n ed25519: \"\\332\\207p\\020\\227\\206ns\\360\\335\\224,\\273>\\227\\0063)\\371\\005X\\206!\\261x\\322\\027Yh\\215G\\374\"\n }\n auto_renew_account {\n account_num: 8\n realm_num: 8\n shard_num: 8\n }\n auto_renew_period {\n seconds: 36000\n }\n expiration_time {\n seconds: 1554158542\n }\n memo {\n value: \"test memo\"\n }\n submit_key {\n ed25519: \"\\373\\210\\2637\\337\\327ea{\\3442*\\347\\357\\2053\\326\\036d\\203\\005\\016 \\354HE\\2453\\275\\334\\244\\261\"\n }\n topic_i_d {\n realm_num: 0\n shard_num: 0\n topic_num: 5007\n }\n}\nnode_account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n}\ntransaction_fee: 200000000\ntransaction_i_d {\n account_i_d {\n account_num: 5006\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n}\ntransaction_valid_duration {\n seconds: 120\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionIdTest.java similarity index 99% rename from sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java rename to sdk/src/test/java/org/hiero/sdk/TransactionIdTest.java index a16583b421..f5f80a14aa 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionIdTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionIdTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; diff --git a/sdk/src/test/java/org/hiero/sdk/TransactionIdTest.snap b/sdk/src/test/java/org/hiero/sdk/TransactionIdTest.snap new file mode 100644 index 0000000000..0e25e525e5 --- /dev/null +++ b/sdk/src/test/java/org/hiero/sdk/TransactionIdTest.snap @@ -0,0 +1,8 @@ +org.hiero.sdk.TransactionIdTest.shouldSerialize2=[ + "0.0.23847@1588539964.632521325?scheduled/3" +] + + +org.hiero.sdk.TransactionIdTest.shouldSerialize=[ + "0.0.23847@1588539964.632521325" +] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java similarity index 90% rename from sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java index daf422ac65..c6db5bdd60 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import org.junit.jupiter.api.AfterAll; @@ -26,7 +26,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); new TransactionReceiptQuery() .setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5005"), validStart)) .onMakeRequest(builder, QueryHeader.newBuilder().build()); diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.snap similarity index 61% rename from sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.snap index 435dfc80a3..076d50eef5 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptQueryTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TransactionReceiptQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ntransaction_get_receipt {\n header {\n }\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" +org.hiero.sdk.TransactionReceiptQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ntransaction_get_receipt {\n header {\n }\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptTest.java similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java rename to sdk/src/test/java/org/hiero/sdk/TransactionReceiptTest.java index 44fdcba574..a30758604c 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.snap b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptTest.snap similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.snap rename to sdk/src/test/java/org/hiero/sdk/TransactionReceiptTest.snap index 6ccfa3e262..63e97b2235 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionReceiptTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TransactionReceiptTest.shouldSerialize=[ +org.hiero.sdk.TransactionReceiptTest.shouldSerialize=[ "TransactionReceipt{transactionId=null, status=SCHEDULE_ALREADY_DELETED, exchangeRate=ExchangeRate{hbars=3, cents=4, expirationTime=2019-04-01T22:42:22Z, exchangeRateInCents=1.3333333333333333}, accountId=1.2.3, fileId=4.5.6, contractId=3.2.1, topicId=9.8.7, tokenId=6.5.4, topicSequenceNumber=3, topicRunningHash=[54, 56, 54, 102, 55, 55, 50, 48, 54, 101, 54, 102, 55, 55, 50, 48, 54, 50, 55, 50, 54, 102, 55, 55, 54, 101, 50, 48, 54, 51, 54, 102, 55, 55], totalSupply=30, scheduleId=1.1.1, scheduledTransactionId=3.3.3@1554158542.000000000, serials=[1, 2, 3], nodeId=1, duplicates=[], children=[]}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java similarity index 91% rename from sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java rename to sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java index 9eda9bae20..ee236bfb67 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import com.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import org.junit.jupiter.api.AfterAll; @@ -26,7 +26,7 @@ public static void afterAll() { @Test void shouldSerialize() { - var builder = com.hiero.sdk.proto.Query.newBuilder(); + var builder = org.hiero.sdk.proto.Query.newBuilder(); spawnQuery().onMakeRequest(builder, QueryHeader.newBuilder().build()); SnapshotMatcher.expect(builder.build().toString().replaceAll("@[A-Za-z0-9]+", "")) .toMatchSnapshot(); diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap b/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.snap similarity index 67% rename from sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap rename to sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.snap index 4b71c83598..546b1be2c4 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionRecordQueryTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.snap @@ -1,3 +1,3 @@ -com.hiero.sdk.TransactionRecordQueryTest.shouldSerialize=[ - "# com.hiero.sdk.proto.Query\ntransaction_get_record {\n header {\n }\n include_child_records: true\n include_duplicates: true\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" +org.hiero.sdk.TransactionRecordQueryTest.shouldSerialize=[ + "# org.hiero.sdk.proto.Query\ntransaction_get_record {\n header {\n }\n include_child_records: true\n include_duplicates: true\n transaction_i_d {\n account_i_d {\n account_num: 5005\n realm_num: 0\n shard_num: 0\n }\n transaction_valid_start {\n seconds: 1554158542\n }\n }\n}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java rename to sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java index a90144a0df..e0198d6952 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; -import static com.hiero.sdk.TransactionReceiptTest.spawnReceiptExample; +import static org.hiero.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; +import static org.hiero.sdk.TransactionReceiptTest.spawnReceiptExample; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; @@ -41,7 +41,7 @@ private static TransactionRecord spawnRecordExample(@Nullable ByteString prngByt TransactionId.withValidStart(AccountId.fromString("3.3.3"), time), "memo", 3000L, - new ContractFunctionResult(com.hiero.sdk.proto.ContractFunctionResult.newBuilder() + new ContractFunctionResult(org.hiero.sdk.proto.ContractFunctionResult.newBuilder() .setContractID(ContractId.fromString("1.2.3").toProtobuf()) .setContractCallResult(ByteString.copyFrom(callResult)) .setEvmAddress(BytesValue.newBuilder() diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.snap b/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.snap similarity index 98% rename from sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.snap rename to sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.snap index 08e20be479..5452d7ec83 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionRecordTest.snap +++ b/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.snap @@ -1,8 +1,8 @@ -com.hiero.sdk.TransactionRecordTest.shouldSerialize2=[ +org.hiero.sdk.TransactionRecordTest.shouldSerialize2=[ "TransactionRecord{receipt=TransactionReceipt{transactionId=null, status=SCHEDULE_ALREADY_DELETED, exchangeRate=ExchangeRate{hbars=3, cents=4, expirationTime=2019-04-01T22:42:22Z, exchangeRateInCents=1.3333333333333333}, accountId=1.2.3, fileId=4.5.6, contractId=3.2.1, topicId=9.8.7, tokenId=6.5.4, topicSequenceNumber=3, topicRunningHash=[54, 56, 54, 102, 55, 55, 50, 48, 54, 101, 54, 102, 55, 55, 50, 48, 54, 50, 55, 50, 54, 102, 55, 55, 54, 101, 50, 48, 54, 51, 54, 102, 55, 55], totalSupply=30, scheduleId=1.1.1, scheduledTransactionId=3.3.3@1554158542.000000000, serials=[1, 2, 3], nodeId=1, duplicates=[], children=[]}, transactionHash=68656c6c6f, consensusTimestamp=2019-04-01T22:42:22Z, transactionId=3.3.3@1554158542.000000000, transactionMemo=memo, transactionFee=3000 tℏ, contractFunctionResult=ContractFunctionResult{contractId=1.2.3, evmAddress=1.2.98329e006610472e6b372c080833f6d79ed833cf, errorMessage=null, bloom=, gasUsed=0, logs=[], createdContractIds=[], stateChanges=[], gas=0, hbarAmount=0 tℏ, contractFunctionparametersBytes=, rawResult=00000000000000000000000000000000000000000000000000000000ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000011223344556677889900aabbccddeeff00112233ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001448656c6c6f2c20776f726c642c20616761696e21000000000000000000000000, senderAccountId=1.2.3, contractNonces=[], signerNonce=0}, transfers=[Transfer{accountId=4.4.4, amount=5 ℏ}], tokenTransfers={6.6.6={1.1.1=4}}, tokenNftTransfers={4.4.4=[TokenNftTransfer{tokenId=4.4.4, sender=1.2.3, receiver=3.2.1, serial=4, isApproved=true}]}, scheduleRef=3.3.3, assessedCustomFees=[AssessedCustomFee{amount=4, tokenId=4.5.6, feeCollectorAccountId=8.6.5, payerAccountIdList=[3.3.3]}], automaticTokenAssociations=[TokenAssociation{tokenId=5.4.3, accountId=8.7.6}], aliasKey=3036301006072a8648ce3d020106052b8104000a03220002703a9370b0443be6ae7c507b0aec81a55e94e4a863b9655360bd65358caa6588, children=[], duplicates=[], parentConsensusTimestamp=2019-04-01T22:42:22Z, ethereumHash=536f6d652068617368, paidStakingRewards=[Transfer{accountId=1.2.3, amount=8 ℏ}], prngBytes=null, prngNumber=4, evmAddress=30783030, pendingAirdropRecords=[PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=null, nftId=0.0.5005/1234}, pendingAirdropAmount=123}, PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=0.0.12345, nftId=null}, pendingAirdropAmount=123}]}" ] -com.hiero.sdk.TransactionRecordTest.shouldSerialize=[ +org.hiero.sdk.TransactionRecordTest.shouldSerialize=[ "TransactionRecord{receipt=TransactionReceipt{transactionId=null, status=SCHEDULE_ALREADY_DELETED, exchangeRate=ExchangeRate{hbars=3, cents=4, expirationTime=2019-04-01T22:42:22Z, exchangeRateInCents=1.3333333333333333}, accountId=1.2.3, fileId=4.5.6, contractId=3.2.1, topicId=9.8.7, tokenId=6.5.4, topicSequenceNumber=3, topicRunningHash=[54, 56, 54, 102, 55, 55, 50, 48, 54, 101, 54, 102, 55, 55, 50, 48, 54, 50, 55, 50, 54, 102, 55, 55, 54, 101, 50, 48, 54, 51, 54, 102, 55, 55], totalSupply=30, scheduleId=1.1.1, scheduledTransactionId=3.3.3@1554158542.000000000, serials=[1, 2, 3], nodeId=1, duplicates=[], children=[]}, transactionHash=68656c6c6f, consensusTimestamp=2019-04-01T22:42:22Z, transactionId=3.3.3@1554158542.000000000, transactionMemo=memo, transactionFee=3000 tℏ, contractFunctionResult=ContractFunctionResult{contractId=1.2.3, evmAddress=1.2.98329e006610472e6b372c080833f6d79ed833cf, errorMessage=null, bloom=, gasUsed=0, logs=[], createdContractIds=[], stateChanges=[], gas=0, hbarAmount=0 tℏ, contractFunctionparametersBytes=, rawResult=00000000000000000000000000000000000000000000000000000000ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000011223344556677889900aabbccddeeff00112233ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20776f726c642100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001448656c6c6f2c20776f726c642c20616761696e21000000000000000000000000, senderAccountId=1.2.3, contractNonces=[], signerNonce=0}, transfers=[Transfer{accountId=4.4.4, amount=5 ℏ}], tokenTransfers={6.6.6={1.1.1=4}}, tokenNftTransfers={4.4.4=[TokenNftTransfer{tokenId=4.4.4, sender=1.2.3, receiver=3.2.1, serial=4, isApproved=true}]}, scheduleRef=3.3.3, assessedCustomFees=[AssessedCustomFee{amount=4, tokenId=4.5.6, feeCollectorAccountId=8.6.5, payerAccountIdList=[3.3.3]}], automaticTokenAssociations=[TokenAssociation{tokenId=5.4.3, accountId=8.7.6}], aliasKey=3036301006072a8648ce3d020106052b8104000a03220002703a9370b0443be6ae7c507b0aec81a55e94e4a863b9655360bd65358caa6588, children=[], duplicates=[], parentConsensusTimestamp=2019-04-01T22:42:22Z, ethereumHash=536f6d652068617368, paidStakingRewards=[Transfer{accountId=1.2.3, amount=8 ℏ}], prngBytes=766572792072616e646f6d206279746573, prngNumber=null, evmAddress=30783030, pendingAirdropRecords=[PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=null, nftId=0.0.5005/1234}, pendingAirdropAmount=123}, PendingAirdropRecord{pendingAirdropId=PendingAirdropId{sender=0.0.123, receiver=0.0.124, tokenId=0.0.12345, nftId=null}, pendingAirdropAmount=123}]}" ] diff --git a/sdk/src/test/java/com/hiero/sdk/TransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionTest.java similarity index 94% rename from sdk/src/test/java/com/hiero/sdk/TransactionTest.java rename to sdk/src/test/java/org/hiero/sdk/TransactionTest.java index eba0361ce2..b4ca347c90 100644 --- a/sdk/src/test/java/com/hiero/sdk/TransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk; +package org.hiero.sdk; -import static com.hiero.sdk.Transaction.fromBytes; +import static org.hiero.sdk.Transaction.fromBytes; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.TokenAssociateTransactionBody; -import com.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.TokenAssociateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import java.time.Instant; import java.util.Arrays; import java.util.List; @@ -81,7 +81,7 @@ void tokenAssociateTransactionFromTransactionBytes() throws InvalidProtocolBuffe .build(); var signedTransactionBodyProto = TransactionBody.parseFrom(signedTransactionProto.getBodyBytes()); - var transactionSignedProto = com.hiero.sdk.proto.Transaction.newBuilder() + var transactionSignedProto = org.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(signedTransactionBodyProto.toByteString()) .build(); var transactionSignedBodyProto = TransactionBody.parseFrom(transactionSignedProto.getSignedTransactionBytes()); diff --git a/sdk/src/test/java/com/hiero/logger/LoggerTest.java b/sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java similarity index 96% rename from sdk/src/test/java/com/hiero/logger/LoggerTest.java rename to sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java index 80613988c6..6f5ec931a7 100644 --- a/sdk/src/test/java/com/hiero/logger/LoggerTest.java +++ b/sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.logger; +package org.hiero.sdk.logger; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import com.hiero.sdk.logger.LogLevel; -import com.hiero.sdk.logger.Logger; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java index 5ba02dd2b3..dab8378115 100644 --- a/sdk/src/testIntegration/java/module-info.java +++ b/sdk/src/testIntegration/java/module-info.java @@ -18,9 +18,9 @@ * */ -open module com.hiero.sdk.test.integration { +open module org.hiero.sdk.test.integration { requires com.esaulpaugh.headlong; - requires com.hiero.sdk; + requires org.hiero.sdk; requires org.assertj.core; requires org.bouncycastle.provider; requires org.junit.jupiter.api; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java index 58b9f4f6e4..03e4215baa 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountAllowanceApproveTransaction; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountAllowanceApproveTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransferTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java index 891d3ad9f0..52e8a32cac 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Client; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java index c30966667c..cdc4db8b94 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.*; +import org.hiero.sdk.*; import java.time.Duration; import java.time.Instant; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java index 72bb40a1d9..ad954757bc 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.AccountInfoQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountDeleteTransaction; +import org.hiero.sdk.AccountInfoQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.time.Duration; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java index 3c695384b7..4c09c8751e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountIdPopulationIntegrationTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TransactionReceiptQuery; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TransactionReceiptQuery; +import org.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountInfoIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountInfoIntegrationTest.java index 82f79c30b7..9c1cb73d3d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountInfoIntegrationTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountInfoFlow; -import com.hiero.sdk.AccountInfoQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountInfoFlow; +import org.hiero.sdk.AccountInfoQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.Transaction; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -76,7 +76,7 @@ void getCostSmallMaxAccountInfoForClientOperator() throws Exception { .isThrownBy(() -> { info.execute(testEnv.client); }) - .withMessage("com.hiero.sdk.MaxQueryPaymentExceededException: cost for AccountInfoQuery, of " + .withMessage("org.hiero.sdk.MaxQueryPaymentExceededException: cost for AccountInfoQuery, of " + cost.toString() + ", without explicit payment is greater than the maximum allowed payment of 1 tℏ"); } diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java similarity index 87% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java index e751d0dfed..1449c0d7fc 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountRecordsQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountRecordsQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TransferTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountStakersIntegrationTest.java similarity index 83% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountStakersIntegrationTest.java index 80315e6d2c..3b66a2f0d0 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountStakersIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountStakersIntegrationTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountStakersQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.AccountStakersQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java similarity index 90% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java index a1cfe8f14a..038d776338 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountInfoQuery; -import com.hiero.sdk.AccountUpdateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Status; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountInfoQuery; +import org.hiero.sdk.AccountUpdateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.Status; import java.time.Duration; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java index 6705d3f898..87706c3d83 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ClientIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.*; +import org.hiero.sdk.*; import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/Contents.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/Contents.java index f0221ff413..a23d575e3f 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/Contents.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/Contents.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; public class Contents { private Contents() {} diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java index b61363ee89..3ae1939f42 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractByteCodeQuery; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.ContractByteCodeQuery; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MaxQueryPaymentExceededException; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java similarity index 97% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java index ca4b020e7b..911aa93c34 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCallIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractCallQuery; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.ContractCallQuery; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MaxQueryPaymentExceededException; +import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java index 4c62839f5e..3d1ee910f0 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import com.hiero.sdk.*; +import org.hiero.sdk.*; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java index 9140d84125..52a1218f1f 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java @@ -1,18 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractInfoQuery; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractInfoQuery; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java index e68c7fe1fb..43a37257d2 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java @@ -1,18 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractInfoQuery; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractInfoQuery; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java index d18e60d4e8..deb66cf850 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractExecuteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractExecuteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java index f5a1989eb8..2c48c4704b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.abi.Address; -import com.hiero.sdk.ContractCallQuery; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.FileAppendTransaction; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import org.hiero.sdk.ContractCallQuery; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractId; +import org.hiero.sdk.FileAppendTransaction; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileId; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; import java.math.BigInteger; import java.util.Arrays; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java index c5bc55a4ab..475644af28 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractInfoQuery; -import com.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractId; +import org.hiero.sdk.ContractInfoQuery; +import org.hiero.sdk.FileCreateTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java index 64b0fb8b42..7a383b473e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.*; -import com.hiero.sdk.*; +import org.hiero.sdk.*; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java index 88043c20ad..1638d25d2a 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.ContractNonceInfo; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractId; +import org.hiero.sdk.ContractNonceInfo; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java index 141dce31c0..0149fe70a1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractInfoQuery; -import com.hiero.sdk.ContractUpdateTransaction; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractInfoQuery; +import org.hiero.sdk.ContractUpdateTransaction; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java similarity index 93% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java index 713ea90fc0..2aaf6f8bd1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EntityHelper.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.ContractCreateFlow; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.Key; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.ContractCreateFlow; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractId; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.Key; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenId; +import org.hiero.sdk.TokenSupplyType; +import org.hiero.sdk.TokenType; import java.util.concurrent.TimeoutException; /** diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java index c52e51d01d..eec3b17523 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java @@ -1,21 +1,21 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.rlp.RLPEncoder; import com.esaulpaugh.headlong.util.Integers; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractExecuteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.EthereumTransaction; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PrivateKeyECDSA; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractExecuteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.EthereumTransaction; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PrivateKeyECDSA; +import org.hiero.sdk.TransferTransaction; import java.math.BigInteger; import java.util.List; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FeeSchedulesTest.java similarity index 86% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FeeSchedulesTest.java index 922054a3e8..de4146933d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FeeSchedulesTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FeeSchedulesTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; -import com.hiero.sdk.FeeSchedules; -import com.hiero.sdk.FileContentsQuery; -import com.hiero.sdk.FileId; +import org.hiero.sdk.FeeSchedules; +import org.hiero.sdk.FileContentsQuery; +import org.hiero.sdk.FileId; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java index 0d25f12e06..aead5d6bd0 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileAppendIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.FileAppendTransaction; -import com.hiero.sdk.FileContentsQuery; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileInfoQuery; -import com.hiero.sdk.KeyList; +import org.hiero.sdk.FileAppendTransaction; +import org.hiero.sdk.FileContentsQuery; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileInfoQuery; +import org.hiero.sdk.KeyList; import java.time.Duration; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java index cba57659aa..9dd0c5c6a6 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileContentsIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.FileContentsQuery; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.FileContentsQuery; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MaxQueryPaymentExceededException; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java index 28ac9b9c3d..39b43077f9 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileInfoQuery; -import com.hiero.sdk.KeyList; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileInfoQuery; +import org.hiero.sdk.KeyList; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java similarity index 90% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java index a6583c862d..bccd22bd6c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileInfoQuery; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileInfoQuery; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java index 0bd4b72e1b..755aad2918 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileInfoQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import com.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileInfoQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.MaxQueryPaymentExceededException; +import org.hiero.sdk.PrecheckStatusException; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java similarity index 91% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java index 0f495f86bf..0b6fc4e5d8 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/FileUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileId; -import com.hiero.sdk.FileInfoQuery; -import com.hiero.sdk.FileUpdateTransaction; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileId; +import org.hiero.sdk.FileInfoQuery; +import org.hiero.sdk.FileUpdateTransaction; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java index 3ff7d41931..00bde47377 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/IntegrationTestEnv.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Client; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PublicKey; +import org.hiero.sdk.TransferTransaction; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java similarity index 86% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java index adf475f4b4..3cb6ad7b0b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.LiveHashAddTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Status; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.LiveHashAddTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.Status; import java.time.Duration; import java.util.Objects; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java similarity index 84% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java index 732edee28b..d85f5c54ad 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.LiveHashDeleteTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Status; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.LiveHashDeleteTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.Status; import java.util.Objects; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java index 0c002594c2..69fb1d5189 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/LoadIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.fail; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.PrivateKey; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Client; +import org.hiero.sdk.PrivateKey; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java index 1650bb1176..7c8a27bfd8 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java @@ -1,23 +1,23 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import static com.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; +import static org.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.ContractCallQuery; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractExecuteTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.ContractId; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MirrorNodeContractCallQuery; -import com.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import com.hiero.sdk.PrivateKey; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.ContractCallQuery; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractExecuteTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.ContractId; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MirrorNodeContractCallQuery; +import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; +import org.hiero.sdk.PrivateKey; import java.util.Objects; import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java similarity index 83% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java index f07028d1b5..28ca4ed71a 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NetworkVersionInfoIntegrationTest.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import com.hiero.sdk.NetworkVersionInfoQuery; +import org.hiero.sdk.NetworkVersionInfoQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java index ee96c61616..a9af439dbb 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java @@ -1,25 +1,25 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountAllowanceApproveTransaction; -import com.hiero.sdk.AccountAllowanceDeleteTransaction; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenNftInfoQuery; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountAllowanceApproveTransaction; +import org.hiero.sdk.AccountAllowanceDeleteTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.NftId; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenId; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenNftInfoQuery; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransferTransaction; import java.nio.charset.StandardCharsets; import java.util.List; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftMetadataGenerator.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftMetadataGenerator.java index 408588bba2..6cd6c8ff0a 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NftMetadataGenerator.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftMetadataGenerator.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import java.util.ArrayList; import java.util.Collections; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java index b35fd2b934..62a7bd2092 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import static com.hiero.sdk.test.integration.IntegrationTestEnv.LOCAL_CONSENSUS_NODE_ACCOUNT_ID; +import static org.hiero.sdk.test.integration.IntegrationTestEnv.LOCAL_CONSENSUS_NODE_ACCOUNT_ID; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.Endpoint; -import com.hiero.sdk.NodeCreateTransaction; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PrivateKeyECDSA; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Client; +import org.hiero.sdk.Endpoint; +import org.hiero.sdk.NodeCreateTransaction; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PrivateKeyECDSA; import java.util.HashMap; import java.util.List; import org.bouncycastle.util.encoders.Hex; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java index d95965d0a1..7e2f0214c1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ReceiptQueryIntegrationTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TransactionReceiptQuery; -import com.hiero.sdk.TransactionRecordQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TransactionReceiptQuery; +import org.hiero.sdk.TransactionRecordQuery; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java index 8972070d1d..b51ca14211 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java @@ -1,32 +1,32 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountUpdateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.ScheduleCreateTransaction; -import com.hiero.sdk.ScheduleId; -import com.hiero.sdk.ScheduleInfo; -import com.hiero.sdk.ScheduleInfoQuery; -import com.hiero.sdk.ScheduleSignTransaction; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicMessageSubmitTransaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransactionReceipt; -import com.hiero.sdk.TransactionResponse; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountDeleteTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.AccountUpdateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.ScheduleCreateTransaction; +import org.hiero.sdk.ScheduleId; +import org.hiero.sdk.ScheduleInfo; +import org.hiero.sdk.ScheduleInfoQuery; +import org.hiero.sdk.ScheduleSignTransaction; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicMessageSubmitTransaction; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransactionReceipt; +import org.hiero.sdk.TransactionResponse; +import org.hiero.sdk.TransferTransaction; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java index 2bef94a680..be3a609b6e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/SystemIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ContractCreateTransaction; -import com.hiero.sdk.ContractFunctionParameters; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.SystemDeleteTransaction; -import com.hiero.sdk.SystemUndeleteTransaction; +import org.hiero.sdk.ContractCreateTransaction; +import org.hiero.sdk.ContractFunctionParameters; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.SystemDeleteTransaction; +import org.hiero.sdk.SystemUndeleteTransaction; import java.time.Instant; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java index 36dc1a57d7..de7aa6b6f5 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java @@ -1,27 +1,27 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static com.hiero.sdk.test.integration.EntityHelper.mitedNfts; +import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.PendingAirdropId; -import com.hiero.sdk.PendingAirdropRecord; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAirdropTransaction; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCancelAirdropTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenFreezeTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenPauseTransaction; -import com.hiero.sdk.TransactionId; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.PendingAirdropId; +import org.hiero.sdk.PendingAirdropRecord; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAirdropTransaction; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCancelAirdropTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenFreezeTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenPauseTransaction; +import org.hiero.sdk.TransactionId; import java.util.ArrayList; import java.util.Collections; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java index 0dea6fb01d..9605849d2f 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java @@ -1,26 +1,26 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static com.hiero.sdk.test.integration.EntityHelper.mitedNfts; +import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.PendingAirdropId; -import com.hiero.sdk.PendingAirdropRecord; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAirdropTransaction; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenClaimAirdropTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenFreezeTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenPauseTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.PendingAirdropId; +import org.hiero.sdk.PendingAirdropRecord; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAirdropTransaction; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenClaimAirdropTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenFreezeTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenPauseTransaction; import java.util.ArrayList; import java.util.Collections; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java index b1c84217f5..89395143b1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java @@ -1,31 +1,31 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; -import static com.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static com.hiero.sdk.test.integration.EntityHelper.mitedNfts; +import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; -import com.hiero.sdk.AccountAllowanceApproveTransaction; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAirdropTransaction; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountAllowanceApproveTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.CustomFixedFee; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PublicKey; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAirdropTransaction; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenSupplyType; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java similarity index 98% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java index f1bb4aba9a..c4936f074d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountAllowanceApproveTransaction; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountInfoQuery; -import com.hiero.sdk.AccountUpdateTransaction; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountAllowanceApproveTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountInfoQuery; +import org.hiero.sdk.AccountUpdateTransaction; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransferTransaction; import java.util.ArrayList; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java index 115af37269..657c960c38 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenBurnIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java @@ -1,21 +1,21 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenBurnTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenBurnTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java similarity index 97% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java index 6cec9ec68b..b857216e55 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.CustomRoyaltyFee; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenType; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.CustomFee; +import org.hiero.sdk.CustomFixedFee; +import org.hiero.sdk.CustomFractionalFee; +import org.hiero.sdk.CustomRoyaltyFee; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenType; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java similarity index 93% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java index 6b1e2438b1..4f47d9a54c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenDeleteTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java index 6cfb2c0792..bde8d07623 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDissociateTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenDissociateTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java index e5b9604eb7..9edcbf1ce7 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java @@ -1,18 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.CustomFee; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenFeeScheduleUpdateTransaction; -import com.hiero.sdk.TokenInfoQuery; +import org.hiero.sdk.CustomFee; +import org.hiero.sdk.CustomFixedFee; +import org.hiero.sdk.CustomFractionalFee; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenFeeScheduleUpdateTransaction; +import org.hiero.sdk.TokenInfoQuery; import java.util.ArrayList; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java index fadd39edcf..3cfc8c2aac 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenFreezeTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenFreezeTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java index e5f9fec6b9..82fe113239 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenGrantKycTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenGrantKycTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java index 4995bba432..31ecabda76 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenInfoQuery; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MaxQueryPaymentExceededException; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenInfoQuery; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenSupplyType; +import org.hiero.sdk.TokenType; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java index 75369e9b75..1cf28b8845 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java @@ -1,21 +1,21 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountInfoQuery; -import com.hiero.sdk.ContractDeleteTransaction; -import com.hiero.sdk.ContractInfoQuery; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.AccountInfoQuery; +import org.hiero.sdk.ContractDeleteTransaction; +import org.hiero.sdk.ContractInfoQuery; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TransferTransaction; import java.util.ArrayList; import java.util.Collections; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java similarity index 95% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java index 79564f94b2..1e02d9840e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenMintIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenSupplyType; +import org.hiero.sdk.TokenType; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java index 4b4415cb31..7c18048530 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenNftInfoQuery; -import com.hiero.sdk.TokenType; +import org.hiero.sdk.NftId; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenNftInfoQuery; +import org.hiero.sdk.TokenType; import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java similarity index 91% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java index f58e3b598a..1ca3dc0ffe 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java @@ -1,22 +1,22 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenGrantKycTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TokenWipeTransaction; -import com.hiero.sdk.TransactionResponse; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenGrantKycTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TokenWipeTransaction; +import org.hiero.sdk.TransactionResponse; +import org.hiero.sdk.TransferTransaction; import java.util.ArrayList; import java.util.Collections; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java index fb73eb7e17..36bbd656a5 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenPauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenPauseTransaction; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenPauseTransaction; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java index c35e9c4b84..1e40856e90 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenNftInfoQuery; -import com.hiero.sdk.TokenRejectFlow; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenNftInfoQuery; +import org.hiero.sdk.TokenRejectFlow; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java similarity index 98% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java index ad14d4a443..2d21714a4c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRejectIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java @@ -1,26 +1,26 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountAllowanceApproveTransaction; -import com.hiero.sdk.AccountBalanceQuery; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenFreezeTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenNftInfoQuery; -import com.hiero.sdk.TokenPauseTransaction; -import com.hiero.sdk.TokenRejectTransaction; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountAllowanceApproveTransaction; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenFreezeTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenNftInfoQuery; +import org.hiero.sdk.TokenPauseTransaction; +import org.hiero.sdk.TokenRejectTransaction; +import org.hiero.sdk.TokenSupplyType; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Disabled; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java index a43892eb05..e74507f031 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenRevokeKycTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenRevokeKycTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java similarity index 92% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java index 073e8fbd5e..6d7acefb9c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenGrantKycTransaction; -import com.hiero.sdk.TransactionResponse; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.CustomFixedFee; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenGrantKycTransaction; +import org.hiero.sdk.TransactionResponse; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java index 40a300ae3b..c314e829d1 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenUnfreezeTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenUnfreezeTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java similarity index 87% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java index ad8ab8bf9e..ea22223a9d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenUnpauseTransaction; -import com.hiero.sdk.TokenWipeTransaction; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountDeleteTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenUnpauseTransaction; +import org.hiero.sdk.TokenWipeTransaction; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java similarity index 99% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java index 0cd12501d9..f984cb615e 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenInfoQuery; -import com.hiero.sdk.TokenKeyValidation; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TokenUpdateTransaction; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PublicKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenInfoQuery; +import org.hiero.sdk.TokenKeyValidation; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TokenUpdateTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java similarity index 97% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java index 7b74fae076..eb742329ef 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java @@ -1,21 +1,21 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.Client; -import com.hiero.sdk.NftId; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenInfoQuery; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenNftInfoQuery; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TokenUpdateNftsTransaction; +import org.hiero.sdk.Client; +import org.hiero.sdk.NftId; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenId; +import org.hiero.sdk.TokenInfoQuery; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenNftInfoQuery; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TokenUpdateNftsTransaction; import java.util.List; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java index 39bc8e5cff..0977209219 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TokenWipeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java @@ -1,22 +1,22 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenAssociateTransaction; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenGrantKycTransaction; -import com.hiero.sdk.TokenMintTransaction; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TokenWipeTransaction; -import com.hiero.sdk.TransferTransaction; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenAssociateTransaction; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenGrantKycTransaction; +import org.hiero.sdk.TokenMintTransaction; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TokenWipeTransaction; +import org.hiero.sdk.TransferTransaction; import java.util.Collections; import java.util.Objects; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java similarity index 90% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java index 57a6628560..6bcfd9c98b 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicDeleteTransaction; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicDeleteTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java similarity index 89% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java index 2e6214131c..ee51d6c7b8 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicDeleteTransaction; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicDeleteTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java similarity index 94% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java index 8911acea1e..5adca3f407 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.MaxQueryPaymentExceededException; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicDeleteTransaction; -import com.hiero.sdk.TopicInfoQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.MaxQueryPaymentExceededException; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicDeleteTransaction; +import org.hiero.sdk.TopicInfoQuery; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java similarity index 98% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java index 0cd421b23b..c9ca973e1d 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.*; +import org.hiero.sdk.*; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java index d791c0e490..048dc5f06c 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatNoException; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.Status; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicDeleteTransaction; -import com.hiero.sdk.TopicInfoQuery; -import com.hiero.sdk.TopicMessageSubmitTransaction; -import com.hiero.sdk.Transaction; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.Status; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicDeleteTransaction; +import org.hiero.sdk.TopicInfoQuery; +import org.hiero.sdk.TopicMessageSubmitTransaction; +import org.hiero.sdk.Transaction; import java.util.Objects; import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Assumptions; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java similarity index 87% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java index 26aefdcaa9..10101f9ba3 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicDeleteTransaction; -import com.hiero.sdk.TopicInfoQuery; -import com.hiero.sdk.TopicUpdateTransaction; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicDeleteTransaction; +import org.hiero.sdk.TopicInfoQuery; +import org.hiero.sdk.TopicUpdateTransaction; import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java similarity index 96% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java index 7212409316..2fc7db3671 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java @@ -1,41 +1,41 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatNoException; import com.google.protobuf.ByteString; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.FileAppendTransaction; -import com.hiero.sdk.FileContentsQuery; -import com.hiero.sdk.FileCreateTransaction; -import com.hiero.sdk.FileDeleteTransaction; -import com.hiero.sdk.FileInfoQuery; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.TopicCreateTransaction; -import com.hiero.sdk.TopicDeleteTransaction; -import com.hiero.sdk.TopicInfoQuery; -import com.hiero.sdk.TopicMessageSubmitTransaction; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; -import com.hiero.sdk.TransferTransaction; -import com.hiero.sdk.proto.AccountAmount; -import com.hiero.sdk.proto.AccountID; -import com.hiero.sdk.proto.CryptoTransferTransactionBody; -import com.hiero.sdk.proto.Duration; -import com.hiero.sdk.proto.SignatureMap; -import com.hiero.sdk.proto.SignaturePair; -import com.hiero.sdk.proto.SignedTransaction; -import com.hiero.sdk.proto.Timestamp; -import com.hiero.sdk.proto.TransactionBody; -import com.hiero.sdk.proto.TransactionID; -import com.hiero.sdk.proto.TransactionList; -import com.hiero.sdk.proto.TransferList; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountDeleteTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.FileAppendTransaction; +import org.hiero.sdk.FileContentsQuery; +import org.hiero.sdk.FileCreateTransaction; +import org.hiero.sdk.FileDeleteTransaction; +import org.hiero.sdk.FileInfoQuery; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.TopicCreateTransaction; +import org.hiero.sdk.TopicDeleteTransaction; +import org.hiero.sdk.TopicInfoQuery; +import org.hiero.sdk.TopicMessageSubmitTransaction; +import org.hiero.sdk.Transaction; +import org.hiero.sdk.TransactionId; +import org.hiero.sdk.TransferTransaction; +import org.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.AccountID; +import org.hiero.sdk.proto.CryptoTransferTransactionBody; +import org.hiero.sdk.proto.Duration; +import org.hiero.sdk.proto.SignatureMap; +import org.hiero.sdk.proto.SignaturePair; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.TransactionList; +import org.hiero.sdk.proto.TransferList; import java.util.Arrays; import java.util.Objects; import org.junit.jupiter.api.Disabled; @@ -813,7 +813,7 @@ void transactionFromToBytes2() { var byts = signedBuilder.build().toByteString(); byts = TransactionList.newBuilder() - .addTransactionList(com.hiero.sdk.proto.Transaction.newBuilder() + .addTransactionList(org.hiero.sdk.proto.Transaction.newBuilder() .setSignedTransactionBytes(byts) .build()) .build() diff --git a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionResponseTest.java similarity index 88% rename from sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java rename to sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionResponseTest.java index cb87855486..d92c0309d6 100644 --- a/sdk/src/testIntegration/java/com/hiero/sdk/test/integration/TransactionResponseTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionResponseTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.sdk.test.integration; +package org.hiero.sdk.test.integration; import static org.assertj.core.api.Assertions.assertThat; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.PrivateKey; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.PrivateKey; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/settings.gradle.kts b/settings.gradle.kts index f8e73fee97..4435b73aa9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,9 +4,9 @@ plugins { id("org.hiero.gradle.build") version "0.1.1" } rootProject.name = "hiero-sdk-java" javaModules { - module("sdk") { group = "com.hiero" } - module("sdk-full") { group = "com.hiero" } - module("tck") { group = "com.hiero.sdk.tck" } + module("sdk") { group = "org.hiero" } + module("sdk-full") { group = "org.hiero" } + module("tck") { group = "org.hiero.sdk.tck" } } includeBuild("examples") diff --git a/tck/src/main/java/com/hiero/tck/TckServer.java b/tck/src/main/java/org/hiero/tck/TckServer.java similarity index 93% rename from tck/src/main/java/com/hiero/tck/TckServer.java rename to tck/src/main/java/org/hiero/tck/TckServer.java index f5fe7cee7a..6dd4149882 100644 --- a/tck/src/main/java/com/hiero/tck/TckServer.java +++ b/tck/src/main/java/org/hiero/tck/TckServer.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck; +package org.hiero.tck; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java b/tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Controller.java similarity index 94% rename from tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java rename to tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Controller.java index 68551044d3..1945409f5e 100644 --- a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Controller.java +++ b/tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Controller.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.annotation; +package org.hiero.tck.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java b/tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Method.java similarity index 95% rename from tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java rename to tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Method.java index df7a173337..f641b75501 100644 --- a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Method.java +++ b/tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Method.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.annotation; +package org.hiero.tck.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java b/tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Service.java similarity index 92% rename from tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java rename to tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Service.java index 11fc97d744..9af3eaa321 100644 --- a/tck/src/main/java/com/hiero/tck/annotation/JSONRPC2Service.java +++ b/tck/src/main/java/org/hiero/tck/annotation/JSONRPC2Service.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.annotation; +package org.hiero.tck.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/tck/src/main/java/com/hiero/tck/config/BeanConfig.java b/tck/src/main/java/org/hiero/tck/config/BeanConfig.java similarity index 91% rename from tck/src/main/java/com/hiero/tck/config/BeanConfig.java rename to tck/src/main/java/org/hiero/tck/config/BeanConfig.java index 9ed8dfa235..881ea4c52f 100644 --- a/tck/src/main/java/com/hiero/tck/config/BeanConfig.java +++ b/tck/src/main/java/org/hiero/tck/config/BeanConfig.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.config; +package org.hiero.tck.config; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import org.springframework.context.annotation.Bean; diff --git a/tck/src/main/java/com/hiero/tck/config/WebConfig.java b/tck/src/main/java/org/hiero/tck/config/WebConfig.java similarity index 85% rename from tck/src/main/java/com/hiero/tck/config/WebConfig.java rename to tck/src/main/java/org/hiero/tck/config/WebConfig.java index d995ed3f0c..53929487a0 100644 --- a/tck/src/main/java/com/hiero/tck/config/WebConfig.java +++ b/tck/src/main/java/org/hiero/tck/config/WebConfig.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.config; +package org.hiero.tck.config; -import com.hiero.tck.controller.JRPCInterceptor; +import org.hiero.tck.controller.JRPCInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; diff --git a/tck/src/main/java/com/hiero/tck/controller/JRPCController.java b/tck/src/main/java/org/hiero/tck/controller/JRPCController.java similarity index 85% rename from tck/src/main/java/com/hiero/tck/controller/JRPCController.java rename to tck/src/main/java/org/hiero/tck/controller/JRPCController.java index 0eb1249880..6fc9e098b3 100644 --- a/tck/src/main/java/com/hiero/tck/controller/JRPCController.java +++ b/tck/src/main/java/org/hiero/tck/controller/JRPCController.java @@ -1,12 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.controller; +package org.hiero.tck.controller; -import static com.hiero.tck.util.JSONRPC2ServiceScanner.registerServices; - -import com.hiero.tck.annotation.JSONRPC2Controller; +import org.hiero.tck.annotation.JSONRPC2Controller; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import jakarta.servlet.http.HttpServletRequest; +import org.hiero.tck.util.JSONRPC2ServiceScanner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; @@ -19,7 +18,7 @@ public class JRPCController { public JRPCController(final Dispatcher dispatcher, final ApplicationContext applicationContext) { this.dispatcher = dispatcher; - registerServices(dispatcher, applicationContext); + JSONRPC2ServiceScanner.registerServices(dispatcher, applicationContext); } /** diff --git a/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java b/tck/src/main/java/org/hiero/tck/controller/JRPCInterceptor.java similarity index 97% rename from tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java rename to tck/src/main/java/org/hiero/tck/controller/JRPCInterceptor.java index a1c97f2006..944e110895 100644 --- a/tck/src/main/java/com/hiero/tck/controller/JRPCInterceptor.java +++ b/tck/src/main/java/org/hiero/tck/controller/JRPCInterceptor.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.controller; +package org.hiero.tck.controller; import com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; diff --git a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java b/tck/src/main/java/org/hiero/tck/exception/InvalidJSONRPC2ParamsException.java similarity index 94% rename from tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java rename to tck/src/main/java/org/hiero/tck/exception/InvalidJSONRPC2ParamsException.java index 77293b8aed..8144e8e297 100644 --- a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2ParamsException.java +++ b/tck/src/main/java/org/hiero/tck/exception/InvalidJSONRPC2ParamsException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.exception; +package org.hiero.tck.exception; /** * Thrown when the server cannot parse the given parameters. diff --git a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java b/tck/src/main/java/org/hiero/tck/exception/InvalidJSONRPC2RequestException.java similarity index 88% rename from tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java rename to tck/src/main/java/org/hiero/tck/exception/InvalidJSONRPC2RequestException.java index 790ffa0eca..46ad8d6a3d 100644 --- a/tck/src/main/java/com/hiero/tck/exception/InvalidJSONRPC2RequestException.java +++ b/tck/src/main/java/org/hiero/tck/exception/InvalidJSONRPC2RequestException.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.exception; +package org.hiero.tck.exception; /** * Thrown when the server cannot process the request diff --git a/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java b/tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java similarity index 92% rename from tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java rename to tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java index 7d33e9e0f9..b584f358d7 100644 --- a/tck/src/main/java/com/hiero/tck/methods/AbstractJSONRPC2Service.java +++ b/tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods; +package org.hiero.tck.methods; -import static com.hiero.tck.methods.JSONRPC2Error.HEDERA_ERROR; +import static org.hiero.tck.methods.JSONRPC2Error.HEDERA_ERROR; -import com.hiero.sdk.PrecheckStatusException; -import com.hiero.sdk.ReceiptStatusException; -import com.hiero.tck.annotation.JSONRPC2Method; -import com.hiero.tck.exception.InvalidJSONRPC2ParamsException; -import com.hiero.tck.exception.InvalidJSONRPC2RequestException; -import com.hiero.tck.methods.JSONRPC2Error.ErrorData; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.tck.annotation.JSONRPC2Method; +import org.hiero.tck.exception.InvalidJSONRPC2ParamsException; +import org.hiero.tck.exception.InvalidJSONRPC2RequestException; +import org.hiero.tck.methods.JSONRPC2Error.ErrorData; import com.thetransactioncompany.jsonrpc2.JSONRPC2Error; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; diff --git a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java b/tck/src/main/java/org/hiero/tck/methods/JSONRPC2Error.java similarity index 89% rename from tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java rename to tck/src/main/java/org/hiero/tck/methods/JSONRPC2Error.java index 62dd6f8e18..416db69e37 100644 --- a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Error.java +++ b/tck/src/main/java/org/hiero/tck/methods/JSONRPC2Error.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods; +package org.hiero.tck.methods; -import com.hiero.sdk.Status; +import org.hiero.sdk.Status; /** * Custom JSON-RPC error definitions diff --git a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java b/tck/src/main/java/org/hiero/tck/methods/JSONRPC2Param.java similarity index 95% rename from tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java rename to tck/src/main/java/org/hiero/tck/methods/JSONRPC2Param.java index f49fd07514..8738002ea2 100644 --- a/tck/src/main/java/com/hiero/tck/methods/JSONRPC2Param.java +++ b/tck/src/main/java/org/hiero/tck/methods/JSONRPC2Param.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods; +package org.hiero.tck.methods; import java.util.Map; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java similarity index 88% rename from tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java index adeee2b2e1..1d6f8c0b9d 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/AccountService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java @@ -1,23 +1,23 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk; +package org.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountCreateTransaction; -import com.hiero.sdk.AccountDeleteTransaction; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.AccountUpdateTransaction; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.HbarUnit; -import com.hiero.sdk.Status; -import com.hiero.sdk.TransactionReceipt; -import com.hiero.tck.annotation.JSONRPC2Method; -import com.hiero.tck.annotation.JSONRPC2Service; -import com.hiero.tck.methods.AbstractJSONRPC2Service; -import com.hiero.tck.methods.sdk.param.AccountCreateParams; -import com.hiero.tck.methods.sdk.param.AccountDeleteParams; -import com.hiero.tck.methods.sdk.param.AccountUpdateParams; -import com.hiero.tck.methods.sdk.response.AccountResponse; -import com.hiero.tck.util.KeyUtils; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountDeleteTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.AccountUpdateTransaction; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.HbarUnit; +import org.hiero.sdk.Status; +import org.hiero.sdk.TransactionReceipt; +import org.hiero.tck.annotation.JSONRPC2Method; +import org.hiero.tck.annotation.JSONRPC2Service; +import org.hiero.tck.methods.AbstractJSONRPC2Service; +import org.hiero.tck.methods.sdk.param.AccountCreateParams; +import org.hiero.tck.methods.sdk.param.AccountDeleteParams; +import org.hiero.tck.methods.sdk.param.AccountUpdateParams; +import org.hiero.tck.methods.sdk.response.AccountResponse; +import org.hiero.tck.util.KeyUtils; import java.time.Duration; import java.time.Instant; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java similarity index 73% rename from tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java index f8ae8ede5b..13b4dcc114 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/KeyService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java @@ -1,21 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk; - -import static com.hiero.tck.util.KeyUtils.KeyType.*; -import static com.hiero.tck.util.KeyUtils.getKeyFromString; +package org.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.Key; -import com.hiero.sdk.KeyList; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; -import com.hiero.tck.annotation.JSONRPC2Method; -import com.hiero.tck.annotation.JSONRPC2Service; -import com.hiero.tck.exception.InvalidJSONRPC2RequestException; -import com.hiero.tck.methods.AbstractJSONRPC2Service; -import com.hiero.tck.methods.sdk.param.GenerateKeyParams; -import com.hiero.tck.methods.sdk.response.GenerateKeyResponse; +import org.hiero.sdk.Key; +import org.hiero.sdk.KeyList; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PublicKey; +import org.hiero.tck.annotation.JSONRPC2Method; +import org.hiero.tck.annotation.JSONRPC2Service; +import org.hiero.tck.exception.InvalidJSONRPC2RequestException; +import org.hiero.tck.methods.AbstractJSONRPC2Service; +import org.hiero.tck.methods.sdk.param.GenerateKeyParams; +import org.hiero.tck.methods.sdk.response.GenerateKeyResponse; import org.bouncycastle.util.encoders.Hex; +import org.hiero.tck.util.KeyUtils; +import org.hiero.tck.util.KeyUtils.KeyType; @JSONRPC2Service public class KeyService extends AbstractJSONRPC2Service { @@ -25,34 +24,34 @@ public GenerateKeyResponse generateKey(final GenerateKeyParams params) throws Ex // Make sure getFromKey() is only provided for ED25519_PUBLIC_KEY, ECDSA_SECP256k1_PUBLIC_KEY, or // EVM_ADDRESS_KEY if (params.getFromKey().isPresent() - && !params.getType().equals(ED25519_PUBLIC_KEY) - && !params.getType().equals(ECDSA_SECP256K1_PUBLIC_KEY) - && !params.getType().equals(EVM_ADDRESS_KEY)) { + && !params.getType().equals(KeyType.ED25519_PUBLIC_KEY) + && !params.getType().equals(KeyType.ECDSA_SECP256K1_PUBLIC_KEY) + && !params.getType().equals(KeyType.EVM_ADDRESS_KEY)) { throw new InvalidJSONRPC2RequestException( "invalid parameters: fromKey should only be provided for ed25519PublicKey, ecdsaSecp256k1PublicKey, or evmAddress types."); } // Make sure threshold is only provided for THRESHOLD_KEY_TYPE. - if (params.getThreshold().isPresent() && !params.getType().equals(THRESHOLD_KEY)) { + if (params.getThreshold().isPresent() && !params.getType().equals(KeyType.THRESHOLD_KEY)) { throw new InvalidJSONRPC2RequestException( "invalid parameters: threshold should only be provided for thresholdKey types."); } // Make sure keys is only provided for LIST_KEY_TYPE or THRESHOLD_KEY_TYPE if (params.getKeys().isPresent() - && !params.getType().equals(LIST_KEY) - && !params.getType().equals(THRESHOLD_KEY)) { + && !params.getType().equals(KeyType.LIST_KEY) + && !params.getType().equals(KeyType.THRESHOLD_KEY)) { throw new InvalidJSONRPC2RequestException( "invalid parameters: keys should only be provided for keyList or thresholdKey types."); } - if ((params.getType().equals(THRESHOLD_KEY) || params.getType().equals(LIST_KEY)) + if ((params.getType().equals(KeyType.THRESHOLD_KEY) || params.getType().equals(KeyType.LIST_KEY)) && params.getKeys().isEmpty()) { throw new InvalidJSONRPC2RequestException( "invalid request: keys list is required for generating a KeyList type."); } - if (params.getType().equals(THRESHOLD_KEY) && params.getThreshold().isEmpty()) { + if (params.getType().equals(KeyType.THRESHOLD_KEY) && params.getThreshold().isEmpty()) { throw new InvalidJSONRPC2RequestException( "invalid request: threshold is required for generating a ThresholdKey type."); } @@ -69,7 +68,7 @@ private String processKeyRecursively( PrivateKey privateKey; switch (params.getType()) { case ED25519_PRIVATE_KEY, ECDSA_SECP256K1_PRIVATE_KEY: - privateKeyString = params.getType().equals(ED25519_PRIVATE_KEY) + privateKeyString = params.getType().equals(KeyType.ED25519_PRIVATE_KEY) ? PrivateKey.generateED25519().toStringDER() : PrivateKey.generateECDSA().toStringDER(); if (isList) { @@ -84,7 +83,7 @@ private String processKeyRecursively( .getPublicKey() .toStringDER(); } - privateKey = params.getType().equals(ED25519_PUBLIC_KEY) + privateKey = params.getType().equals(KeyType.ED25519_PUBLIC_KEY) ? PrivateKey.generateED25519() : PrivateKey.generateECDSA(); if (isList) { @@ -97,13 +96,13 @@ private String processKeyRecursively( KeyList keyList = new KeyList(); params.getKeys().get().forEach(keyParams -> { try { - keyList.add(getKeyFromString(processKeyRecursively(keyParams, response, true))); + keyList.add(KeyUtils.getKeyFromString(processKeyRecursively(keyParams, response, true))); } catch (Exception e) { throw new IllegalArgumentException(e); } }); - if (params.getType().equals(THRESHOLD_KEY)) { + if (params.getType().equals(KeyType.THRESHOLD_KEY)) { keyList.setThreshold(params.getThreshold().get().intValue()); } @@ -111,7 +110,7 @@ private String processKeyRecursively( case EVM_ADDRESS_KEY: if (params.getFromKey().isPresent()) { - Key hederaKey = getKeyFromString(params.getFromKey().get()); + Key hederaKey = KeyUtils.getKeyFromString(params.getFromKey().get()); if (hederaKey instanceof PrivateKey pk) { return pk.getPublicKey().toEvmAddress().toString(); } else if (hederaKey instanceof PublicKey pk) { diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java similarity index 82% rename from tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java index 9d56928daf..d6615547b9 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/SdkService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk; +package org.hiero.tck.methods.sdk; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.Client; -import com.hiero.sdk.PrivateKey; -import com.hiero.tck.annotation.JSONRPC2Method; -import com.hiero.tck.annotation.JSONRPC2Service; -import com.hiero.tck.methods.AbstractJSONRPC2Service; -import com.hiero.tck.methods.sdk.param.SetupParams; -import com.hiero.tck.methods.sdk.response.SetupResponse; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Client; +import org.hiero.sdk.PrivateKey; +import org.hiero.tck.annotation.JSONRPC2Method; +import org.hiero.tck.annotation.JSONRPC2Service; +import org.hiero.tck.methods.AbstractJSONRPC2Service; +import org.hiero.tck.methods.sdk.param.SetupParams; +import org.hiero.tck.methods.sdk.response.SetupResponse; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java similarity index 93% rename from tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java index 8e0b673df8..f29e37bf88 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/TokenService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java @@ -1,27 +1,27 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk; +package org.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.AccountId; -import com.hiero.sdk.CustomFixedFee; -import com.hiero.sdk.CustomFractionalFee; -import com.hiero.sdk.CustomRoyaltyFee; -import com.hiero.sdk.Status; -import com.hiero.sdk.TokenCreateTransaction; -import com.hiero.sdk.TokenDeleteTransaction; -import com.hiero.sdk.TokenId; -import com.hiero.sdk.TokenSupplyType; -import com.hiero.sdk.TokenType; -import com.hiero.sdk.TokenUpdateTransaction; -import com.hiero.sdk.TransactionReceipt; -import com.hiero.tck.annotation.JSONRPC2Method; -import com.hiero.tck.annotation.JSONRPC2Service; -import com.hiero.tck.methods.AbstractJSONRPC2Service; -import com.hiero.tck.methods.sdk.param.TokenCreateParams; -import com.hiero.tck.methods.sdk.param.TokenDeleteParams; -import com.hiero.tck.methods.sdk.param.TokenUpdateParams; -import com.hiero.tck.methods.sdk.response.TokenResponse; -import com.hiero.tck.util.KeyUtils; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.CustomFixedFee; +import org.hiero.sdk.CustomFractionalFee; +import org.hiero.sdk.CustomRoyaltyFee; +import org.hiero.sdk.Status; +import org.hiero.sdk.TokenCreateTransaction; +import org.hiero.sdk.TokenDeleteTransaction; +import org.hiero.sdk.TokenId; +import org.hiero.sdk.TokenSupplyType; +import org.hiero.sdk.TokenType; +import org.hiero.sdk.TokenUpdateTransaction; +import org.hiero.sdk.TransactionReceipt; +import org.hiero.tck.annotation.JSONRPC2Method; +import org.hiero.tck.annotation.JSONRPC2Service; +import org.hiero.tck.methods.AbstractJSONRPC2Service; +import org.hiero.tck.methods.sdk.param.TokenCreateParams; +import org.hiero.tck.methods.sdk.param.TokenDeleteParams; +import org.hiero.tck.methods.sdk.param.TokenUpdateParams; +import org.hiero.tck.methods.sdk.response.TokenResponse; +import org.hiero.tck.util.KeyUtils; import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -154,7 +154,7 @@ public TokenResponse createToken(final TokenCreateParams params) throws Exceptio params.getMaxSupply().ifPresent(maxSupply -> tokenCreateTransaction.setMaxSupply(Long.valueOf(maxSupply))); params.getCustomFees().ifPresent(customFees -> { - List customFeeList = new ArrayList<>(); + List customFeeList = new ArrayList<>(); for (var customFee : customFees) { // set fixed fees customFee.getFixedFee().ifPresent(fixedFee -> { diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java similarity index 97% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java index 7990247738..3b4b977a05 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountCreateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java similarity index 94% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java index 5ca547c239..adc8c7eaa6 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountDeleteParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java similarity index 97% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java index 61b58a46de..3c7467c448 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/AccountUpdateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java similarity index 93% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java index 50609cc352..86fd9ce9b9 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CommonTransactionParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.sdk.Client; -import com.hiero.sdk.Hbar; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.Transaction; -import com.hiero.sdk.TransactionId; +import org.hiero.sdk.Client; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.Transaction; +import org.hiero.sdk.TransactionId; import java.time.Duration; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java similarity index 97% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java index 8cb6dfc43e..9a124f39cc 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/CustomFee.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java similarity index 92% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java index 5fb98a1563..237921e31f 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/GenerateKeyParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; -import com.hiero.tck.util.KeyUtils.KeyType; +import org.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.util.KeyUtils.KeyType; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java similarity index 94% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java index e2b044d845..4f3e5eb04e 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/SetupParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java similarity index 98% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java index fcc5205312..10c5756b78 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenCreateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java similarity index 92% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java index 778072573d..6cceea5300 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenDeleteParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java similarity index 97% rename from tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java index e69f8462f8..efd51f9fb6 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/param/TokenUpdateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; -import com.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java b/tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java similarity index 69% rename from tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java index 1e84f87ccf..f083102177 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/AccountResponse.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.response; +package org.hiero.tck.methods.sdk.response; -import com.hiero.sdk.Status; +import org.hiero.sdk.Status; import lombok.Data; @Data diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java b/tck/src/main/java/org/hiero/tck/methods/sdk/response/GenerateKeyResponse.java similarity index 84% rename from tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/response/GenerateKeyResponse.java index a5bcf9cff5..9098104605 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/GenerateKeyResponse.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/response/GenerateKeyResponse.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.response; +package org.hiero.tck.methods.sdk.response; import java.util.ArrayList; import java.util.List; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java b/tck/src/main/java/org/hiero/tck/methods/sdk/response/SetupResponse.java similarity index 88% rename from tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/response/SetupResponse.java index 66c7e81b65..d0988aebdf 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/SetupResponse.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/response/SetupResponse.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.response; +package org.hiero.tck.methods.sdk.response; import lombok.Data; diff --git a/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java b/tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java similarity index 69% rename from tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java rename to tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java index 23a6116655..8353550843 100644 --- a/tck/src/main/java/com/hiero/tck/methods/sdk/response/TokenResponse.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.response; +package org.hiero.tck.methods.sdk.response; -import com.hiero.sdk.Status; +import org.hiero.sdk.Status; import lombok.Data; @Data diff --git a/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java b/tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java similarity index 91% rename from tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java rename to tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java index 136d8f4bc4..38d624aa98 100644 --- a/tck/src/main/java/com/hiero/tck/util/JSONRPC2ServiceScanner.java +++ b/tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.util; +package org.hiero.tck.util; -import com.hiero.tck.annotation.JSONRPC2Service; +import org.hiero.tck.annotation.JSONRPC2Service; import com.thetransactioncompany.jsonrpc2.server.*; import org.springframework.context.ApplicationContext; diff --git a/tck/src/main/java/com/hiero/tck/util/KeyUtils.java b/tck/src/main/java/org/hiero/tck/util/KeyUtils.java similarity index 92% rename from tck/src/main/java/com/hiero/tck/util/KeyUtils.java rename to tck/src/main/java/org/hiero/tck/util/KeyUtils.java index 457ee40940..1609a55786 100644 --- a/tck/src/main/java/com/hiero/tck/util/KeyUtils.java +++ b/tck/src/main/java/org/hiero/tck/util/KeyUtils.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.util; +package org.hiero.tck.util; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import com.hiero.sdk.Key; -import com.hiero.sdk.PrivateKey; -import com.hiero.sdk.PublicKey; +import org.hiero.sdk.Key; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PublicKey; public final class KeyUtils { diff --git a/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java b/tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java similarity index 96% rename from tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java rename to tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java index 9c660bd547..2a3ac2b0f0 100644 --- a/tck/src/test/java/com/hiero/tck/controller/JRPCControllerTest.java +++ b/tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.controller; +package org.hiero.tck.controller; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; @@ -11,6 +11,7 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import jakarta.servlet.http.HttpServletRequest; +import org.hiero.tck.controller.JRPCController; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java b/tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java similarity index 96% rename from tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java rename to tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java index eefdde92b2..debcf765b4 100644 --- a/tck/src/test/java/com/hiero/tck/controller/JRPCInterceptorTest.java +++ b/tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.controller; +package org.hiero.tck.controller; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; @@ -9,6 +9,7 @@ import jakarta.servlet.http.HttpServletResponse; import java.io.BufferedReader; import java.io.StringReader; +import org.hiero.tck.controller.JRPCInterceptor; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java similarity index 95% rename from tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java index b52963f722..1895880dd9 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/KeyServiceTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk; +package org.hiero.tck.methods.sdk; -import static com.hiero.tck.util.KeyUtils.KeyType.*; +import static org.hiero.tck.util.KeyUtils.KeyType.*; import static org.junit.jupiter.api.Assertions.*; -import com.hiero.tck.exception.InvalidJSONRPC2RequestException; -import com.hiero.tck.methods.sdk.param.GenerateKeyParams; -import com.hiero.tck.methods.sdk.response.GenerateKeyResponse; +import org.hiero.tck.exception.InvalidJSONRPC2RequestException; +import org.hiero.tck.methods.sdk.param.GenerateKeyParams; +import org.hiero.tck.methods.sdk.response.GenerateKeyResponse; import java.util.Collections; import java.util.Optional; import org.junit.jupiter.api.Assertions; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java similarity index 89% rename from tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java index dd59ece596..e9454ad8fe 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/SdkServiceTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java @@ -1,12 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk; +package org.hiero.tck.methods.sdk; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import com.hiero.tck.methods.sdk.param.SetupParams; -import com.hiero.tck.methods.sdk.response.SetupResponse; +import org.hiero.tck.methods.sdk.SdkService; +import org.hiero.tck.methods.sdk.param.SetupParams; +import org.hiero.tck.methods.sdk.response.SetupResponse; import java.util.Optional; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java similarity index 97% rename from tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java index bc8cee83e9..302eb01f15 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; @@ -9,6 +9,8 @@ import java.util.Optional; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.sdk.param.AccountCreateParams; +import org.hiero.tck.methods.sdk.param.CommonTransactionParams; import org.junit.jupiter.api.Test; class AccountCreateParamsTest { diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java similarity index 93% rename from tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java index cdb4d86222..939580a1a8 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; @@ -8,6 +8,7 @@ import java.util.Map; import java.util.Optional; import net.minidev.json.JSONArray; +import org.hiero.tck.methods.sdk.param.CommonTransactionParams; import org.junit.jupiter.api.Test; class CommonTransactionParamsTest { diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java similarity index 96% rename from tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java index eb04759ca8..8527939073 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java @@ -1,9 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.*; -import com.hiero.tck.util.KeyUtils.KeyType; +import org.hiero.tck.methods.sdk.param.GenerateKeyParams; +import org.hiero.tck.util.KeyUtils.KeyType; import java.util.HashMap; import java.util.Map; import java.util.Optional; diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java similarity index 92% rename from tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java index 88176e2116..56b78df897 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/param/SetupParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java @@ -1,11 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.param; +package org.hiero.tck.methods.sdk.param; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.HashMap; import java.util.Map; import java.util.Optional; +import org.hiero.tck.methods.sdk.param.SetupParams; import org.junit.jupiter.api.Test; class SetupParamsTest { diff --git a/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java similarity index 93% rename from tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java rename to tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java index ddc8d29e3f..e0c491ec66 100644 --- a/tck/src/test/java/com/hiero/tck/methods/sdk/response/SetupResponseTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java @@ -1,9 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -package com.hiero.tck.methods.sdk.response; +package org.hiero.tck.methods.sdk.response; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import org.hiero.tck.methods.sdk.response.SetupResponse; import org.junit.jupiter.api.Test; class SetupResponseTest { From d4a4af8fdbe00b6873b7caa41d358ba159d91825 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 16:34:56 +0200 Subject: [PATCH 09/15] chore: spotless apply Signed-off-by: Ivan Ivanov --- sdk/src/main/java/module-info.java | 1 + .../AccountAllowanceAdjustTransaction.java | 6 ++-- .../AccountAllowanceApproveTransaction.java | 10 +++--- .../AccountAllowanceDeleteTransaction.java | 12 +++---- .../java/org/hiero/sdk/AccountBalance.java | 4 +-- .../org/hiero/sdk/AccountBalanceQuery.java | 6 ++-- .../hiero/sdk/AccountCreateTransaction.java | 10 +++--- .../hiero/sdk/AccountDeleteTransaction.java | 8 ++--- .../main/java/org/hiero/sdk/AccountId.java | 2 +- .../main/java/org/hiero/sdk/AccountInfo.java | 2 +- .../java/org/hiero/sdk/AccountInfoQuery.java | 8 ++--- .../org/hiero/sdk/AccountRecordsQuery.java | 10 +++--- .../org/hiero/sdk/AccountStakersQuery.java | 10 +++--- .../hiero/sdk/AccountUpdateTransaction.java | 10 +++--- .../java/org/hiero/sdk/AddressBookQuery.java | 2 +- .../org/hiero/sdk/ChunkedTransaction.java | 8 ++--- sdk/src/main/java/org/hiero/sdk/Client.java | 4 +-- .../org/hiero/sdk/ContractByteCodeQuery.java | 6 ++-- .../java/org/hiero/sdk/ContractCallQuery.java | 10 +++--- .../hiero/sdk/ContractCreateTransaction.java | 10 +++--- .../hiero/sdk/ContractDeleteTransaction.java | 8 ++--- .../hiero/sdk/ContractExecuteTransaction.java | 8 ++--- .../org/hiero/sdk/ContractFunctionResult.java | 2 +- .../main/java/org/hiero/sdk/ContractId.java | 2 +- .../main/java/org/hiero/sdk/ContractInfo.java | 2 +- .../java/org/hiero/sdk/ContractInfoQuery.java | 8 ++--- .../java/org/hiero/sdk/ContractLogInfo.java | 2 +- .../hiero/sdk/ContractUpdateTransaction.java | 10 +++--- .../java/org/hiero/sdk/CustomFixedFee.java | 2 +- .../org/hiero/sdk/CustomFractionalFee.java | 2 +- .../java/org/hiero/sdk/CustomRoyaltyFee.java | 4 +-- .../org/hiero/sdk/DelegateContractId.java | 2 +- sdk/src/main/java/org/hiero/sdk/Endpoint.java | 2 +- .../org/hiero/sdk/EthereumTransaction.java | 10 +++--- .../main/java/org/hiero/sdk/Executable.java | 4 +-- .../main/java/org/hiero/sdk/FeeSchedules.java | 2 +- .../org/hiero/sdk/FileAppendTransaction.java | 8 ++--- .../java/org/hiero/sdk/FileContentsQuery.java | 8 ++--- .../org/hiero/sdk/FileCreateTransaction.java | 10 +++--- .../org/hiero/sdk/FileDeleteTransaction.java | 8 ++--- sdk/src/main/java/org/hiero/sdk/FileId.java | 2 +- sdk/src/main/java/org/hiero/sdk/FileInfo.java | 2 +- .../java/org/hiero/sdk/FileInfoQuery.java | 8 ++--- .../org/hiero/sdk/FileUpdateTransaction.java | 10 +++--- .../java/org/hiero/sdk/FreezeTransaction.java | 10 +++--- .../java/org/hiero/sdk/HbarAllowance.java | 4 +-- .../java/org/hiero/sdk/InstantConverter.java | 4 +-- sdk/src/main/java/org/hiero/sdk/KeyList.java | 2 +- .../org/hiero/sdk/LiveHashAddTransaction.java | 12 +++---- .../hiero/sdk/LiveHashDeleteTransaction.java | 10 +++--- .../java/org/hiero/sdk/LiveHashQuery.java | 8 ++--- sdk/src/main/java/org/hiero/sdk/Mnemonic.java | 2 +- .../hiero/sdk/NetworkVersionInfoQuery.java | 2 +- sdk/src/main/java/org/hiero/sdk/NftId.java | 2 +- .../main/java/org/hiero/sdk/NodeAddress.java | 2 +- .../org/hiero/sdk/NodeCreateTransaction.java | 10 +++--- .../org/hiero/sdk/NodeDeleteTransaction.java | 4 +-- .../org/hiero/sdk/NodeUpdateTransaction.java | 10 +++--- .../java/org/hiero/sdk/PrivateKeyECDSA.java | 2 +- .../java/org/hiero/sdk/PrivateKeyED25519.java | 2 +- .../java/org/hiero/sdk/PrngTransaction.java | 4 +-- .../main/java/org/hiero/sdk/PublicKey.java | 2 +- .../java/org/hiero/sdk/PublicKeyECDSA.java | 2 +- .../java/org/hiero/sdk/PublicKeyED25519.java | 2 +- sdk/src/main/java/org/hiero/sdk/Query.java | 12 +++---- .../hiero/sdk/ScheduleCreateTransaction.java | 10 +++--- .../hiero/sdk/ScheduleDeleteTransaction.java | 8 ++--- .../main/java/org/hiero/sdk/ScheduleId.java | 2 +- .../main/java/org/hiero/sdk/ScheduleInfo.java | 2 +- .../java/org/hiero/sdk/ScheduleInfoQuery.java | 8 ++--- .../hiero/sdk/ScheduleSignTransaction.java | 8 ++--- sdk/src/main/java/org/hiero/sdk/Status.java | 2 +- .../hiero/sdk/SystemDeleteTransaction.java | 12 +++---- .../hiero/sdk/SystemUndeleteTransaction.java | 10 +++--- .../hiero/sdk/TokenAirdropTransaction.java | 4 +-- .../java/org/hiero/sdk/TokenAllowance.java | 2 +- .../hiero/sdk/TokenAssociateTransaction.java | 10 +++--- .../org/hiero/sdk/TokenBurnTransaction.java | 12 +++---- .../sdk/TokenCancelAirdropTransaction.java | 4 +-- .../sdk/TokenClaimAirdropTransaction.java | 4 +-- .../org/hiero/sdk/TokenCreateTransaction.java | 10 +++--- .../org/hiero/sdk/TokenDeleteTransaction.java | 8 ++--- .../hiero/sdk/TokenDissociateTransaction.java | 10 +++--- .../TokenFeeScheduleUpdateTransaction.java | 10 +++--- .../org/hiero/sdk/TokenFreezeTransaction.java | 8 ++--- .../hiero/sdk/TokenGrantKycTransaction.java | 8 ++--- sdk/src/main/java/org/hiero/sdk/TokenId.java | 2 +- .../main/java/org/hiero/sdk/TokenInfo.java | 8 ++--- .../java/org/hiero/sdk/TokenInfoQuery.java | 8 ++--- .../org/hiero/sdk/TokenMintTransaction.java | 12 +++---- .../java/org/hiero/sdk/TokenNftAllowance.java | 4 +-- .../java/org/hiero/sdk/TokenNftInfoQuery.java | 12 +++---- .../java/org/hiero/sdk/TokenNftTransfer.java | 6 ++-- .../org/hiero/sdk/TokenPauseTransaction.java | 8 ++--- .../org/hiero/sdk/TokenRejectTransaction.java | 12 +++---- .../java/org/hiero/sdk/TokenRelationship.java | 2 +- .../hiero/sdk/TokenRevokeKycTransaction.java | 8 ++--- .../java/org/hiero/sdk/TokenTransfer.java | 2 +- .../java/org/hiero/sdk/TokenTransferList.java | 4 +-- .../hiero/sdk/TokenUnfreezeTransaction.java | 8 ++--- .../hiero/sdk/TokenUnpauseTransaction.java | 8 ++--- .../hiero/sdk/TokenUpdateNftsTransaction.java | 10 +++--- .../org/hiero/sdk/TokenUpdateTransaction.java | 10 +++--- .../org/hiero/sdk/TokenWipeTransaction.java | 10 +++--- .../org/hiero/sdk/TopicCreateTransaction.java | 10 +++--- .../org/hiero/sdk/TopicDeleteTransaction.java | 8 ++--- sdk/src/main/java/org/hiero/sdk/TopicId.java | 2 +- .../main/java/org/hiero/sdk/TopicInfo.java | 4 +-- .../java/org/hiero/sdk/TopicInfoQuery.java | 6 ++-- .../main/java/org/hiero/sdk/TopicMessage.java | 2 +- .../java/org/hiero/sdk/TopicMessageChunk.java | 2 +- .../java/org/hiero/sdk/TopicMessageQuery.java | 10 +++--- .../sdk/TopicMessageSubmitTransaction.java | 8 ++--- .../org/hiero/sdk/TopicUpdateTransaction.java | 10 +++--- .../main/java/org/hiero/sdk/Transaction.java | 12 +++---- .../java/org/hiero/sdk/TransactionId.java | 2 +- .../org/hiero/sdk/TransactionReceipt.java | 4 +-- .../hiero/sdk/TransactionReceiptQuery.java | 10 +++--- .../java/org/hiero/sdk/TransactionRecord.java | 8 ++--- .../org/hiero/sdk/TransactionRecordQuery.java | 10 +++--- .../org/hiero/sdk/TransferTransaction.java | 12 +++---- ...ccountAllowanceApproveTransactionTest.java | 4 +-- ...AccountAllowanceDeleteTransactionTest.java | 4 +-- .../hiero/sdk/AccountBalanceQueryTest.java | 2 +- .../sdk/AccountCreateTransactionTest.java | 4 +-- .../sdk/AccountDeleteTransactionTest.java | 4 +-- .../org/hiero/sdk/AccountInfoQueryTest.java | 2 +- .../java/org/hiero/sdk/AccountInfoTest.java | 6 ++-- .../hiero/sdk/AccountRecordsQueryTest.java | 2 +- .../hiero/sdk/AccountStakersQueryTest.java | 2 +- .../sdk/AccountUpdateTransactionTest.java | 4 +-- .../hiero/sdk/AddressBookQueryMockTest.java | 4 +-- .../org/hiero/sdk/BaseNodeAddressTest.java | 4 +-- .../test/java/org/hiero/sdk/ClientTest.java | 2 +- .../hiero/sdk/ContractByteCodeQueryTest.java | 2 +- .../org/hiero/sdk/ContractCallQueryTest.java | 2 +- .../sdk/ContractCreateTransactionTest.java | 4 +-- .../sdk/ContractDeleteTransactionTest.java | 4 +-- .../sdk/ContractExecuteTransactionTest.java | 4 +-- .../org/hiero/sdk/ContractInfoQueryTest.java | 2 +- .../java/org/hiero/sdk/ContractInfoTest.java | 2 +- .../org/hiero/sdk/ContractLogInfoTest.java | 2 +- .../sdk/ContractUpdateTransactionTest.java | 4 +-- .../sdk/CryptoTransferTransactionTest.java | 6 ++-- .../org/hiero/sdk/CustomFixedFeeTest.java | 2 +- .../hiero/sdk/CustomFractionalFeeTest.java | 2 +- .../org/hiero/sdk/CustomRoyaltyFeeTest.java | 2 +- .../org/hiero/sdk/ECDSAPrivateKeyTest.java | 2 +- .../org/hiero/sdk/ECDSAPublicKeyTest.java | 1 - .../org/hiero/sdk/Ed25519PublicKeyTest.java | 1 - .../org/hiero/sdk/EthereumFlowMockTest.java | 6 ++-- .../java/org/hiero/sdk/ExecutableTest.java | 22 +++++------- .../hiero/sdk/FeeAssessmentMethodTest.java | 1 - .../hiero/sdk/FileAppendTransactionTest.java | 4 +-- .../org/hiero/sdk/FileContentsQueryTest.java | 2 +- .../hiero/sdk/FileCreateTransactionTest.java | 4 +-- .../hiero/sdk/FileDeleteTransactionTest.java | 4 +-- .../java/org/hiero/sdk/FileInfoQueryTest.java | 2 +- .../test/java/org/hiero/sdk/FileInfoTest.java | 4 +-- .../hiero/sdk/FileUpdateTransactionTest.java | 4 +-- .../org/hiero/sdk/FreezeTransactionTest.java | 8 ++--- .../test/java/org/hiero/sdk/KeyListTest.java | 2 +- sdk/src/test/java/org/hiero/sdk/KeyTest.java | 8 ++--- .../java/org/hiero/sdk/LiveHashQueryTest.java | 2 +- .../sdk/MessageSubmitTransactionTest.java | 4 +-- .../test/java/org/hiero/sdk/MnemonicTest.java | 2 +- sdk/src/test/java/org/hiero/sdk/Mocker.java | 14 ++++---- .../test/java/org/hiero/sdk/MockingTest.java | 22 ++++++------ .../sdk/NetworkVersionInfoQueryTest.java | 2 +- .../hiero/sdk/NodeCreateTransactionTest.java | 6 ++-- .../hiero/sdk/NodeDeleteTransactionTest.java | 6 ++-- .../hiero/sdk/NodeUpdateTransactionTest.java | 6 ++-- .../java/org/hiero/sdk/ProxyStakerTest.java | 2 +- .../hiero/sdk/ReceiptStatusExceptionTest.java | 2 +- .../sdk/RegenerateTransactionIdsTest.java | 10 +++--- .../java/org/hiero/sdk/RequestTypeTest.java | 2 +- .../sdk/ScheduleDeleteTransactionTest.java | 4 +-- .../org/hiero/sdk/ScheduleInfoQueryTest.java | 2 +- .../java/org/hiero/sdk/ScheduleInfoTest.java | 4 +-- .../sdk/SystemDeleteTransactionTest.java | 6 ++-- .../sdk/SystemUndeleteTransactionTest.java | 4 +-- .../test/java/org/hiero/sdk/TestResponse.java | 4 +-- .../test/java/org/hiero/sdk/TestService.java | 8 ++--- .../sdk/TokenAirdropTransactionTest.java | 6 ++-- .../sdk/TokenAssociateTransactionTest.java | 6 ++-- .../hiero/sdk/TokenBurnTransactionTest.java | 6 ++-- .../TokenCancelAirdropTransactionTest.java | 8 ++--- .../sdk/TokenClaimAirdropTransactionTest.java | 8 ++--- .../hiero/sdk/TokenCreateTransactionTest.java | 8 ++--- .../hiero/sdk/TokenDeleteTransactionTest.java | 6 ++-- .../sdk/TokenDissociateTransactionTest.java | 6 ++-- ...TokenFeeScheduleUpdateTransactionTest.java | 4 +-- .../hiero/sdk/TokenFreezeTransactionTest.java | 4 +-- .../sdk/TokenGrantKycTransactionTest.java | 6 ++-- .../org/hiero/sdk/TokenInfoQueryTest.java | 2 +- .../hiero/sdk/TokenMintTransactionTest.java | 6 ++-- .../org/hiero/sdk/TokenNftInfoQueryTest.java | 2 +- .../hiero/sdk/TokenPauseTransactionTest.java | 6 ++-- .../hiero/sdk/TokenRejectTransactionTest.java | 8 ++--- .../sdk/TokenRevokeKycTransactionTest.java | 6 ++-- .../org/hiero/sdk/TokenSupplyTypeTest.java | 2 +- .../java/org/hiero/sdk/TokenTypeTest.java | 2 +- .../sdk/TokenUnfreezeTransactionTest.java | 4 +-- .../sdk/TokenUnpauseTransactionTest.java | 6 ++-- .../sdk/TokenUpdateNftsTransactionTest.java | 6 ++-- .../hiero/sdk/TokenUpdateTransactionTest.java | 8 ++--- .../hiero/sdk/TokenWipeTransactionTest.java | 6 ++-- .../hiero/sdk/TopicCreateTransactionTest.java | 4 +-- .../hiero/sdk/TopicDeleteTransactionTest.java | 4 +-- .../org/hiero/sdk/TopicInfoQueryTest.java | 2 +- .../java/org/hiero/sdk/TopicInfoTest.java | 4 +-- .../org/hiero/sdk/TopicMessageChunkTest.java | 2 +- .../org/hiero/sdk/TopicMessageQueryTest.java | 36 ++++++++++++------- .../TopicMessageSubmitTransactionTest.java | 6 ++-- .../java/org/hiero/sdk/TopicMessageTest.java | 4 +-- .../hiero/sdk/TopicUpdateTransactionTest.java | 8 ++--- .../sdk/TransactionReceiptQueryTest.java | 2 +- .../hiero/sdk/TransactionRecordQueryTest.java | 2 +- .../org/hiero/sdk/TransactionRecordTest.java | 2 +- .../java/org/hiero/sdk/TransactionTest.java | 8 ++--- .../java/org/hiero/sdk/logger/LoggerTest.java | 2 -- sdk/src/testIntegration/java/module-info.java | 2 +- .../AccountAllowanceIntegrationTest.java | 2 +- .../AccountBalanceIntegrationTest.java | 4 +-- .../AccountCreateIntegrationTest.java | 2 +- .../AccountDeleteIntegrationTest.java | 4 +-- .../AccountRecordsIntegrationTest.java | 2 +- .../AccountUpdateIntegrationTest.java | 4 +-- .../integration/ClientIntegrationTest.java | 2 +- .../ContractBytecodeIntegrationTest.java | 2 +- .../ContractCallIntegrationTest.java | 2 +- .../ContractCreateFlowIntegrationTest.java | 2 +- .../ContractCreateIntegrationTest.java | 2 +- .../ContractDeleteIntegrationTest.java | 2 +- .../ContractExecuteIntegrationTest.java | 2 +- ...ractFunctionParametersIntegrationTest.java | 6 ++-- .../ContractIdPopulationIntegrationTest.java | 2 +- .../ContractInfoIntegrationTest.java | 2 +- .../ContractNonceInfoIntegrationTest.java | 2 +- .../ContractUpdateIntegrationTest.java | 2 +- .../sdk/test/integration/EntityHelper.java | 2 +- .../EthereumTransactionIntegrationTest.java | 8 ++--- .../FileAppendIntegrationTest.java | 4 +-- .../FileContentsIntegrationTest.java | 2 +- .../FileCreateIntegrationTest.java | 2 +- .../FileDeleteIntegrationTest.java | 2 +- .../integration/FileInfoIntegrationTest.java | 2 +- .../FileUpdateIntegrationTest.java | 2 +- .../test/integration/IntegrationTestEnv.java | 16 ++++----- .../LiveHashAddIntegrationTest.java | 6 ++-- .../LiveHashDeleteIntegrationTest.java | 4 +-- .../test/integration/LoadIntegrationTest.java | 6 ++-- ...irrorNodeContractQueryIntegrationTest.java | 6 ++-- .../NftAllowancesIntegrationTest.java | 4 +-- .../NodeCreateTransactionIntegrationTest.java | 6 ++-- .../ScheduleCreateIntegrationTest.java | 10 +++--- .../integration/SystemIntegrationTest.java | 4 +-- .../TokenAirdropCancelIntegrationTest.java | 6 ++-- .../TokenAirdropClaimIntegrationTest.java | 6 ++-- ...okenAirdropTransactionIntegrationTest.java | 6 ++-- ...enAutomaticAssociationIntegrationTest.java | 2 +- .../integration/TokenBurnIntegrationTest.java | 4 +-- .../TokenCreateIntegrationTest.java | 8 ++--- .../TokenDeleteIntegrationTest.java | 2 +- .../TokenDissociateIntegrationTest.java | 4 +-- ...TokenFeeScheduleUpdateIntegrationTest.java | 4 +-- .../TokenFreezeIntegrationTest.java | 4 +-- .../TokenGrantKycIntegrationTest.java | 4 +-- .../integration/TokenInfoIntegrationTest.java | 2 +- ...TokenManualAssociationIntegrationTest.java | 6 ++-- .../integration/TokenMintIntegrationTest.java | 2 +- .../TokenNftInfoIntegrationTest.java | 6 ++-- .../TokenNftTransferIntegrationTest.java | 4 +-- .../TokenPauseIntegrationTest.java | 2 +- .../TokenRejectFlowIntegrationTest.java | 4 +-- .../TokenRejectIntegrationTest.java | 4 +-- .../TokenRevokeKycIntegrationTest.java | 4 +-- .../TokenTransferIntegrationTest.java | 2 +- .../TokenUnfreezeIntegrationTest.java | 4 +-- .../TokenUnpauseIntegrationTest.java | 2 +- .../TokenUpdateIntegrationTest.java | 2 +- .../TokenUpdateNftsIntegrationTest.java | 4 +-- .../integration/TokenWipeIntegrationTest.java | 4 +-- .../TopicCreateIntegrationTest.java | 2 +- .../TopicDeleteIntegrationTest.java | 2 +- .../integration/TopicInfoIntegrationTest.java | 2 +- .../TopicMessageIntegrationTest.java | 2 +- .../TopicMessageSubmitIntegrationTest.java | 4 +-- .../TopicUpdateIntegrationTest.java | 2 +- .../TransactionIntegrationTest.java | 4 +-- .../hiero/tck/controller/JRPCController.java | 2 +- .../tck/methods/AbstractJSONRPC2Service.java | 12 +++---- .../hiero/tck/methods/sdk/AccountService.java | 4 +-- .../org/hiero/tck/methods/sdk/KeyService.java | 8 +++-- .../org/hiero/tck/methods/sdk/SdkService.java | 8 ++--- .../hiero/tck/methods/sdk/TokenService.java | 6 ++-- .../sdk/param/AccountCreateParams.java | 2 +- .../sdk/param/AccountDeleteParams.java | 2 +- .../sdk/param/AccountUpdateParams.java | 2 +- .../sdk/param/CommonTransactionParams.java | 10 +++--- .../tck/methods/sdk/param/CustomFee.java | 2 +- .../methods/sdk/param/GenerateKeyParams.java | 4 +-- .../tck/methods/sdk/param/SetupParams.java | 2 +- .../methods/sdk/param/TokenCreateParams.java | 2 +- .../methods/sdk/param/TokenDeleteParams.java | 2 +- .../methods/sdk/param/TokenUpdateParams.java | 2 +- .../methods/sdk/response/AccountResponse.java | 2 +- .../methods/sdk/response/TokenResponse.java | 2 +- .../tck/util/JSONRPC2ServiceScanner.java | 2 +- .../tck/controller/JRPCControllerTest.java | 1 - .../tck/controller/JRPCInterceptorTest.java | 1 - .../hiero/tck/methods/sdk/KeyServiceTest.java | 4 +-- .../hiero/tck/methods/sdk/SdkServiceTest.java | 3 +- .../sdk/param/AccountCreateParamsTest.java | 2 -- .../param/CommonTransactionParamsTest.java | 1 - .../sdk/param/GenerateKeyParamsTest.java | 3 +- .../methods/sdk/param/SetupParamsTest.java | 1 - .../sdk/response/SetupResponseTest.java | 1 - 318 files changed, 805 insertions(+), 808 deletions(-) diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java index bd51141775..a5ca83e2cf 100644 --- a/sdk/src/main/java/module-info.java +++ b/sdk/src/main/java/module-info.java @@ -37,5 +37,6 @@ exports org.hiero.sdk.proto; opens org.hiero.sdk; + exports org.hiero.sdk.logger; } diff --git a/sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java index e3db66d9c9..fa42fa9662 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceAdjustTransaction.java @@ -2,9 +2,6 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.Collections; @@ -15,6 +12,9 @@ import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * @deprecated with no replacement diff --git a/sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java index bd87b2154b..b5653b19fa 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceApproveTransaction.java @@ -2,11 +2,6 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.Collections; @@ -16,6 +11,11 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * This transaction type is for approving account allowance. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java index 1a49f9c535..13fe306667 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountAllowanceDeleteTransaction.java @@ -2,12 +2,6 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.Transaction; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.HashMap; @@ -16,6 +10,12 @@ import java.util.Map; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * This transaction type is for deleting an account allowance. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountBalance.java b/sdk/src/main/java/org/hiero/sdk/AccountBalance.java index 61033984c3..be92c66a1c 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountBalance.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountBalance.java @@ -4,12 +4,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoGetAccountBalanceResponse; -import org.hiero.sdk.proto.TokenBalance; import java.util.HashMap; import java.util.Map; import java.util.Objects; import javax.annotation.Nonnegative; +import org.hiero.sdk.proto.CryptoGetAccountBalanceResponse; +import org.hiero.sdk.proto.TokenBalance; /** * This class represents the account balance object diff --git a/sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java index c440795e11..bd3f9fc263 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountBalanceQuery.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.CryptoGetAccountBalanceQuery; import org.hiero.sdk.proto.CryptoServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import javax.annotation.Nullable; /** * Get the balance of a Hedera™ crypto-currency account. This returns only the balance, so it is a diff --git a/sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java index 87468472be..bb324e992f 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountCreateTransaction.java @@ -3,16 +3,16 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoCreateTransactionBody; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoCreateTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Create a new Hedera™ account. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java index aea978e8ae..1890d9d043 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountDeleteTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.CryptoDeleteTransactionBody; import org.hiero.sdk.proto.CryptoServiceGrpc; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Marks an account as deleted, moving all its current hbars to another account. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountId.java b/sdk/src/main/java/org/hiero/sdk/AccountId.java index fcb38e2c44..cc35b48a01 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountId.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountId.java @@ -3,7 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.AccountID; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -12,6 +11,7 @@ import javax.annotation.Nonnegative; import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.AccountID; /** * The ID for a cryptocurrency account on Hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountInfo.java b/sdk/src/main/java/org/hiero/sdk/AccountInfo.java index d97637d31e..e4c416fd39 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountInfo.java @@ -5,7 +5,6 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoGetInfoResponse; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -14,6 +13,7 @@ import java.util.List; import java.util.Map; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoGetInfoResponse; /** * Current information about an account, including the balance. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java index db047af868..28db512ed8 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountInfoQuery.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.CryptoGetInfoQuery; import org.hiero.sdk.proto.CryptoServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * Get all the information about an account, including the balance. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java index f844e5f1ca..f14815cc92 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountRecordsQuery.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.CryptoGetAccountRecordsQuery; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoGetAccountRecordsQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; /** * Get all the records for an account for any transfers into it and out of it, diff --git a/sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java b/sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java index e7626a4fe7..1d013f4e2f 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountStakersQuery.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.CryptoGetStakersQuery; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoGetStakersQuery; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; /** * Get all the accounts that are proxy staking to this account. diff --git a/sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java index 9b3fd546b7..35415f8d89 100644 --- a/sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/AccountUpdateTransaction.java @@ -5,17 +5,17 @@ import com.google.protobuf.Int32Value; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.CryptoUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.CryptoUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Change properties for the given account. diff --git a/sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java b/sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java index e2bfc23d9e..fb7bf1ec5b 100644 --- a/sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/AddressBookQuery.java @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Deadline; @@ -17,6 +16,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.mirror.NetworkServiceGrpc; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java b/sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java index 4bc3d4f91b..9e549eb9b8 100644 --- a/sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ChunkedTransaction.java @@ -3,10 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SignatureMap; -import org.hiero.sdk.proto.SignedTransaction; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionID; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; @@ -22,6 +18,10 @@ import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SignatureMap; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionID; /** * A common base for file and topic message transactions. diff --git a/sdk/src/main/java/org/hiero/sdk/Client.java b/sdk/src/main/java/org/hiero/sdk/Client.java index 3598374303..16d86222ee 100644 --- a/sdk/src/main/java/org/hiero/sdk/Client.java +++ b/sdk/src/main/java/org/hiero/sdk/Client.java @@ -8,8 +8,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; -import org.hiero.sdk.logger.LogLevel; -import org.hiero.sdk.logger.Logger; import java.io.File; import java.io.IOException; import java.io.Reader; @@ -39,6 +37,8 @@ import java.util.function.Supplier; import java.util.function.UnaryOperator; import javax.annotation.Nullable; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; /** * Managed client for use on the Hedera Hashgraph network. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java b/sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java index f8bef9b868..a37b1b35ec 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractByteCodeQuery.java @@ -2,14 +2,14 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ContractGetBytecodeQuery; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; import org.hiero.sdk.proto.SmartContractServiceGrpc; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import javax.annotation.Nullable; /** * Get the bytecode for a smart contract instance. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java b/sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java index 6cadf89320..eafbcab7b2 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractCallQuery.java @@ -2,16 +2,16 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.ContractCallLocalQuery; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; -import org.hiero.sdk.proto.SmartContractServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ContractCallLocalQuery; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.SmartContractServiceGrpc; /** * Call a function of the given smart contract instance, giving it functionParameters as its inputs. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java index 428bffe59d..c767450714 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractCreateTransaction.java @@ -3,17 +3,17 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractCreateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.SmartContractServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; import org.bouncycastle.util.Arrays; +import org.hiero.sdk.proto.ContractCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Start a new smart contract instance. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java index a94dd5b7db..e7b7077d57 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractDeleteTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ContractDeleteTransactionBody; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.SmartContractServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Marks a contract as deleted, moving all its current hbars to another account. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java index c31488a246..68f0b90855 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractExecuteTransaction.java @@ -3,15 +3,15 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ContractCallTransactionBody; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.SmartContractServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Call a function of the given smart contract instance, giving it parameters as its inputs. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java b/sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java index 8a346983e1..7304abbd24 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractFunctionResult.java @@ -7,7 +7,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.Int64Value; -import org.hiero.sdk.proto.ContractFunctionResultOrBuilder; import java.math.BigInteger; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -16,6 +15,7 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ContractFunctionResultOrBuilder; /** * Result of invoking a contract via {@link ContractCallQuery}, or {@link ContractExecuteTransaction}, or the result of diff --git a/sdk/src/main/java/org/hiero/sdk/ContractId.java b/sdk/src/main/java/org/hiero/sdk/ContractId.java index 7b0706c89a..816e7e4421 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractId.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractId.java @@ -3,7 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractID; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -12,6 +11,7 @@ import javax.annotation.Nonnegative; import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ContractID; /** * The ID for a smart contract instance on Hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractInfo.java b/sdk/src/main/java/org/hiero/sdk/ContractInfo.java index 0183042db5..b28f5d301d 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractInfo.java @@ -3,12 +3,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractGetInfoResponse; import java.time.Duration; import java.time.Instant; import java.util.HashMap; import java.util.Map; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ContractGetInfoResponse; /** * Current information on the smart contract instance, including its balance. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java index f484758d1b..3507d251c7 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractInfoQuery.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ContractGetInfoQuery; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; import org.hiero.sdk.proto.SmartContractServiceGrpc; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * Get information about a smart contract instance. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java b/sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java index 30c450ac41..8ee06e0150 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractLogInfo.java @@ -4,10 +4,10 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractLoginfo; import java.util.ArrayList; import java.util.List; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ContractLoginfo; /** * The log information for an event returned by a smart contract function call. diff --git a/sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java index c82e0424e9..8c57a0a6be 100644 --- a/sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ContractUpdateTransaction.java @@ -5,17 +5,17 @@ import com.google.protobuf.Int32Value; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.ContractUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.SmartContractServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ContractUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Modify a smart contract instance to have the given parameter values. diff --git a/sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java b/sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java index 958d51457f..05bb6fb65e 100644 --- a/sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomFixedFee.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.FixedFee; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FixedFee; /** * Custom fixed fee utility class. diff --git a/sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java b/sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java index 872f623de0..73ec348e3a 100644 --- a/sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomFractionalFee.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import java.util.Objects; import org.hiero.sdk.proto.Fraction; import org.hiero.sdk.proto.FractionalFee; -import java.util.Objects; /** * Custom fractional fee utility class. diff --git a/sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java b/sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java index 707d539cde..98a26e1a50 100644 --- a/sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java +++ b/sdk/src/main/java/org/hiero/sdk/CustomRoyaltyFee.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.Fraction; -import org.hiero.sdk.proto.RoyaltyFee; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.Fraction; +import org.hiero.sdk.proto.RoyaltyFee; /** * Custom royalty fee utility class. diff --git a/sdk/src/main/java/org/hiero/sdk/DelegateContractId.java b/sdk/src/main/java/org/hiero/sdk/DelegateContractId.java index ee95febe07..7817b2d2e0 100644 --- a/sdk/src/main/java/org/hiero/sdk/DelegateContractId.java +++ b/sdk/src/main/java/org/hiero/sdk/DelegateContractId.java @@ -2,9 +2,9 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractID; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ContractID; /** * The ID for a smart contract instance on Hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/Endpoint.java b/sdk/src/main/java/org/hiero/sdk/Endpoint.java index 23f24d419d..fcf5b04dfe 100644 --- a/sdk/src/main/java/org/hiero/sdk/Endpoint.java +++ b/sdk/src/main/java/org/hiero/sdk/Endpoint.java @@ -2,8 +2,8 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.ServiceEndpoint; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ServiceEndpoint; /** * Utility class used internally by the sdk. diff --git a/sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java b/sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java index 61ce6c6c51..8196fdda34 100644 --- a/sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/EthereumTransaction.java @@ -3,16 +3,16 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.EthereumTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.SmartContractServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.EthereumTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Execute an Ethereum transaction on Hedera diff --git a/sdk/src/main/java/org/hiero/sdk/Executable.java b/sdk/src/main/java/org/hiero/sdk/Executable.java index 74733d45c7..bc5b7f00de 100644 --- a/sdk/src/main/java/org/hiero/sdk/Executable.java +++ b/sdk/src/main/java/org/hiero/sdk/Executable.java @@ -5,8 +5,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.MessageLite; -import org.hiero.sdk.logger.LogLevel; -import org.hiero.sdk.logger.Logger; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.MethodDescriptor; @@ -31,6 +29,8 @@ import java.util.regex.Pattern; import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; /** * Abstract base utility class. diff --git a/sdk/src/main/java/org/hiero/sdk/FeeSchedules.java b/sdk/src/main/java/org/hiero/sdk/FeeSchedules.java index d27d651530..cb0a8043ad 100644 --- a/sdk/src/main/java/org/hiero/sdk/FeeSchedules.java +++ b/sdk/src/main/java/org/hiero/sdk/FeeSchedules.java @@ -3,8 +3,8 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CurrentAndNextFeeSchedule; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CurrentAndNextFeeSchedule; /** * This contains two Fee Schedules with expiry timestamp. diff --git a/sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java index 71fa7447bf..8191beec2b 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileAppendTransaction.java @@ -3,16 +3,16 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.FileAppendTransactionBody; import org.hiero.sdk.proto.FileServiceGrpc; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionID; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** *

A transaction specifically to append data to a file on the network. diff --git a/sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java b/sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java index 5de53fe5e0..31f0d3483d 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/FileContentsQuery.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.FileGetContentsQuery; import org.hiero.sdk.proto.FileServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * Get the contents of a file. The content field is empty (no bytes) if the diff --git a/sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java index 39d0791973..e509aa9856 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileCreateTransaction.java @@ -3,11 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.FileCreateTransactionBody; -import org.hiero.sdk.proto.FileServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.nio.charset.StandardCharsets; import java.time.Instant; @@ -17,6 +12,11 @@ import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FileCreateTransactionBody; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Creates a file with the content by submitting the transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java index 36ece2e283..1371dde176 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileDeleteTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.FileDeleteTransactionBody; import org.hiero.sdk.proto.FileServiceGrpc; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** *

A transaction to delete a file on the Hedera network. diff --git a/sdk/src/main/java/org/hiero/sdk/FileId.java b/sdk/src/main/java/org/hiero/sdk/FileId.java index f51a116bf7..7fc22889aa 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileId.java +++ b/sdk/src/main/java/org/hiero/sdk/FileId.java @@ -2,10 +2,10 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.FileID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FileID; /** * The ID for a file on Hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/FileInfo.java b/sdk/src/main/java/org/hiero/sdk/FileInfo.java index 8ec912f564..b502046517 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/FileInfo.java @@ -3,9 +3,9 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.FileGetInfoResponse; import java.time.Instant; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FileGetInfoResponse; /** * Current information for a file, including its size. diff --git a/sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java index e45bf5ef77..8942890132 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/FileInfoQuery.java @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.FileGetInfoQuery; import org.hiero.sdk.proto.FileServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * Get all of the information about a file, except for its contents. diff --git a/sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java index 38fbcf890f..cf51ff1650 100644 --- a/sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FileUpdateTransaction.java @@ -4,11 +4,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.FileServiceGrpc; -import org.hiero.sdk.proto.FileUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.nio.charset.StandardCharsets; import java.time.Instant; @@ -18,6 +13,11 @@ import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.FileUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Updates a file by submitting the transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java b/sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java index 14a04c9af3..1dfe4654dd 100644 --- a/sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/FreezeTransaction.java @@ -3,11 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.FreezeServiceGrpc; -import org.hiero.sdk.proto.FreezeTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.time.OffsetTime; @@ -16,6 +11,11 @@ import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FreezeServiceGrpc; +import org.hiero.sdk.proto.FreezeTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Set the freezing period in which the platform will stop creating events and accepting transactions. diff --git a/sdk/src/main/java/org/hiero/sdk/HbarAllowance.java b/sdk/src/main/java/org/hiero/sdk/HbarAllowance.java index cf92e16248..97644a6afc 100644 --- a/sdk/src/main/java/org/hiero/sdk/HbarAllowance.java +++ b/sdk/src/main/java/org/hiero/sdk/HbarAllowance.java @@ -3,10 +3,10 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoAllowance; -import org.hiero.sdk.proto.GrantedCryptoAllowance; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoAllowance; +import org.hiero.sdk.proto.GrantedCryptoAllowance; /** * An approved allowance of hbar transfers for a spender. diff --git a/sdk/src/main/java/org/hiero/sdk/InstantConverter.java b/sdk/src/main/java/org/hiero/sdk/InstantConverter.java index 855c49b883..830e46355e 100644 --- a/sdk/src/main/java/org/hiero/sdk/InstantConverter.java +++ b/sdk/src/main/java/org/hiero/sdk/InstantConverter.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.Timestamp; -import org.hiero.sdk.proto.TimestampSeconds; import java.time.Duration; import java.time.Instant; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TimestampSeconds; /** * Instance in time utilities. diff --git a/sdk/src/main/java/org/hiero/sdk/KeyList.java b/sdk/src/main/java/org/hiero/sdk/KeyList.java index 191ef87266..b5d6f193af 100644 --- a/sdk/src/main/java/org/hiero/sdk/KeyList.java +++ b/sdk/src/main/java/org/hiero/sdk/KeyList.java @@ -2,7 +2,6 @@ package org.hiero.sdk; import com.google.common.base.MoreObjects; -import org.hiero.sdk.proto.ThresholdKey; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -10,6 +9,7 @@ import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ThresholdKey; /** * A list of keys that are required to sign in unison, with an optional threshold controlling how many keys of diff --git a/sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java b/sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java index 148388ebcf..823c678552 100644 --- a/sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHashAddTransaction.java @@ -3,12 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoAddLiveHashTransactionBody; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.LiveHash; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.Arrays; @@ -17,6 +11,12 @@ import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoAddLiveHashTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.LiveHash; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * A hash---presumably of some kind of credential or certificate---along with a list of keys, diff --git a/sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java index 26c96f2d96..17ad457f49 100644 --- a/sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHashDeleteTransaction.java @@ -3,16 +3,16 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoDeleteLiveHashTransactionBody; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoDeleteLiveHashTransactionBody; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * At consensus, deletes a livehash associated to the given account. The transaction must be signed diff --git a/sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java b/sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java index 8034a59495..1db89fe2c3 100644 --- a/sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/LiveHashQuery.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; +import io.grpc.MethodDescriptor; +import java.util.Arrays; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.CryptoGetLiveHashQuery; import org.hiero.sdk.proto.CryptoServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; -import java.util.Arrays; -import java.util.Objects; -import javax.annotation.Nullable; /** * Requests a livehash associated to an account. diff --git a/sdk/src/main/java/org/hiero/sdk/Mnemonic.java b/sdk/src/main/java/org/hiero/sdk/Mnemonic.java index 63c3e9467d..1375f5e98d 100644 --- a/sdk/src/main/java/org/hiero/sdk/Mnemonic.java +++ b/sdk/src/main/java/org/hiero/sdk/Mnemonic.java @@ -4,7 +4,6 @@ import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.base.Joiner; -import org.hiero.sdk.utils.Bip32Utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -28,6 +27,7 @@ import org.bouncycastle.crypto.digests.SHA512Digest; import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator; import org.bouncycastle.crypto.params.KeyParameter; +import org.hiero.sdk.utils.Bip32Utils; /** * BIP-39 24-word mnemonic phrases compatible with the Android and iOS mobile wallets. diff --git a/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java index d1067cb3fc..84b1899cfc 100644 --- a/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/NetworkVersionInfoQuery.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; import org.hiero.sdk.proto.NetworkGetVersionInfoQuery; import org.hiero.sdk.proto.NetworkServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; /** * Information about the versions of protobuf and hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/NftId.java b/sdk/src/main/java/org/hiero/sdk/NftId.java index 00c176b77f..f0043d4e94 100644 --- a/sdk/src/main/java/org/hiero/sdk/NftId.java +++ b/sdk/src/main/java/org/hiero/sdk/NftId.java @@ -2,9 +2,9 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.NftID; import java.util.Objects; import javax.annotation.Nonnegative; +import org.hiero.sdk.proto.NftID; /** * The (non-fungible) token of which this NFT is an instance diff --git a/sdk/src/main/java/org/hiero/sdk/NodeAddress.java b/sdk/src/main/java/org/hiero/sdk/NodeAddress.java index 454e6bbf84..e996d1ba73 100644 --- a/sdk/src/main/java/org/hiero/sdk/NodeAddress.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeAddress.java @@ -3,12 +3,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.ServiceEndpoint; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ServiceEndpoint; /** * The metadata for a Node – including IP Address, and the crypto account associated with the Node. diff --git a/sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java index e25c01aae8..6cfb030759 100644 --- a/sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeCreateTransaction.java @@ -3,17 +3,17 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.AddressBookServiceGrpc; -import org.hiero.sdk.proto.NodeCreateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.AddressBookServiceGrpc; +import org.hiero.sdk.proto.NodeCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * A transaction to create a new node in the network address book. diff --git a/sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java index c27047b373..23b9e48303 100644 --- a/sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeDeleteTransaction.java @@ -2,13 +2,13 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; import org.hiero.sdk.proto.AddressBookServiceGrpc; import org.hiero.sdk.proto.NodeDeleteTransactionBody; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; /** * A transaction to delete a node from the network address book. diff --git a/sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java index e2c52907eb..08f1dc6a94 100644 --- a/sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/NodeUpdateTransaction.java @@ -5,17 +5,17 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.AddressBookServiceGrpc; -import org.hiero.sdk.proto.NodeUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.AddressBookServiceGrpc; +import org.hiero.sdk.proto.NodeUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * A transaction to modify address book node attributes. diff --git a/sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java b/sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java index 17886ad428..576f4ca4dd 100644 --- a/sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java +++ b/sdk/src/main/java/org/hiero/sdk/PrivateKeyECDSA.java @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import java.math.BigInteger; import java.nio.ByteBuffer; @@ -22,6 +21,7 @@ import org.bouncycastle.crypto.signers.ECDSASigner; import org.bouncycastle.crypto.signers.HMacDSAKCalculator; import org.bouncycastle.util.Arrays; +import org.hiero.sdk.utils.Bip32Utils; /** * Encapsulate the ECDSA private key. diff --git a/sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java b/sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java index 13c201a45a..e1c015cab7 100644 --- a/sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java +++ b/sdk/src/main/java/org/hiero/sdk/PrivateKeyED25519.java @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -17,6 +16,7 @@ import org.bouncycastle.crypto.macs.HMac; import org.bouncycastle.crypto.params.KeyParameter; import org.bouncycastle.math.ec.rfc8032.Ed25519; +import org.hiero.sdk.utils.Bip32Utils; /** * Encapsulate the ED25519 private key. diff --git a/sdk/src/main/java/org/hiero/sdk/PrngTransaction.java b/sdk/src/main/java/org/hiero/sdk/PrngTransaction.java index c24cb94f27..f08894162d 100644 --- a/sdk/src/main/java/org/hiero/sdk/PrngTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/PrngTransaction.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.*; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import javax.annotation.Nullable; +import org.hiero.sdk.proto.*; +import org.hiero.sdk.proto.TransactionResponse; /** * Random Number Generator Transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/PublicKey.java b/sdk/src/main/java/org/hiero/sdk/PublicKey.java index efefae8db8..9c25a644a6 100644 --- a/sdk/src/main/java/org/hiero/sdk/PublicKey.java +++ b/sdk/src/main/java/org/hiero/sdk/PublicKey.java @@ -3,13 +3,13 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SignaturePair; import javax.annotation.Nonnegative; import javax.annotation.Nullable; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.math.ec.rfc8032.Ed25519; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.SignaturePair; /** * A public key on the Hedera™ network. diff --git a/sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java b/sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java index c1fc712229..74488f6bb9 100644 --- a/sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java +++ b/sdk/src/main/java/org/hiero/sdk/PublicKeyECDSA.java @@ -4,7 +4,6 @@ import static org.hiero.sdk.Crypto.calcKeccak256; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.SignaturePair; import java.io.IOException; import java.math.BigInteger; import java.util.Arrays; @@ -12,6 +11,7 @@ import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.crypto.params.ECPublicKeyParameters; import org.bouncycastle.crypto.signers.ECDSASigner; +import org.hiero.sdk.proto.SignaturePair; /** * Encapsulate the ECDSA public key. diff --git a/sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java b/sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java index 32e4067cf7..1f1e615286 100644 --- a/sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java +++ b/sdk/src/main/java/org/hiero/sdk/PublicKeyED25519.java @@ -2,13 +2,13 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.SignaturePair; import java.io.IOException; import java.util.Arrays; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.crypto.params.Ed25519PublicKeyParameters; import org.bouncycastle.math.ec.rfc8032.Ed25519; +import org.hiero.sdk.proto.SignaturePair; /** * Encapsulate the ED25519 public key. diff --git a/sdk/src/main/java/org/hiero/sdk/Query.java b/sdk/src/main/java/org/hiero/sdk/Query.java index 8b26e40aa1..b11f43b1b4 100644 --- a/sdk/src/main/java/org/hiero/sdk/Query.java +++ b/sdk/src/main/java/org/hiero/sdk/Query.java @@ -3,12 +3,6 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; -import org.hiero.sdk.proto.ResponseType; -import org.hiero.sdk.proto.Transaction; -import org.hiero.sdk.proto.TransactionBody; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -21,6 +15,12 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; import javax.annotation.Nullable; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.ResponseType; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; /** * Base class for all queries that can be submitted to Hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java index b3b17bf294..2cf14e5871 100644 --- a/sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleCreateTransaction.java @@ -2,16 +2,16 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.ScheduleCreateTransactionBody; -import org.hiero.sdk.proto.ScheduleServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ScheduleCreateTransactionBody; +import org.hiero.sdk.proto.ScheduleServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Create a scheduled transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java index 6487fcbd5a..11b59902af 100644 --- a/sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleDeleteTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.ScheduleDeleteTransactionBody; import org.hiero.sdk.proto.ScheduleServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Delete a scheduled transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/ScheduleId.java b/sdk/src/main/java/org/hiero/sdk/ScheduleId.java index 117b130bc0..270814dfba 100644 --- a/sdk/src/main/java/org/hiero/sdk/ScheduleId.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleId.java @@ -2,10 +2,10 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ScheduleID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ScheduleID; /** * The entity ID of a schedule transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java b/sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java index e216977a61..70514d5d49 100644 --- a/sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleInfo.java @@ -3,9 +3,9 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; import java.time.Instant; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; /** * A query that returns information about the current state of a scheduled diff --git a/sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java index 28fb3909f2..0e9e1fa037 100644 --- a/sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleInfoQuery.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.Query; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; import org.hiero.sdk.proto.ScheduleGetInfoQuery; import org.hiero.sdk.proto.ScheduleServiceGrpc; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * A query that returns information about the current state of a schedule diff --git a/sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java b/sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java index b50e3f704c..ff9f4d72df 100644 --- a/sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/ScheduleSignTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.ScheduleServiceGrpc; import org.hiero.sdk.proto.ScheduleSignTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * A transaction that appends signatures to a schedule transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/Status.java b/sdk/src/main/java/org/hiero/sdk/Status.java index 502989f4b9..b981f24cf6 100644 --- a/sdk/src/main/java/org/hiero/sdk/Status.java +++ b/sdk/src/main/java/org/hiero/sdk/Status.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.ResponseCodeEnum; import java.util.Objects; +import org.hiero.sdk.proto.ResponseCodeEnum; /** * Returned in {@link TransactionReceipt}, {@link PrecheckStatusException} diff --git a/sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java index 379bddc4db..33c4b94a69 100644 --- a/sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/SystemDeleteTransaction.java @@ -2,18 +2,18 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.FileServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.SmartContractServiceGrpc; -import org.hiero.sdk.proto.SystemDeleteTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Instant; import java.util.LinkedHashMap; import java.util.Objects; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.SystemDeleteTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Delete a file or smart contract - can only be done with a Hedera admin. diff --git a/sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java index 42ad91c3a5..973cde3c41 100644 --- a/sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/SystemUndeleteTransaction.java @@ -2,17 +2,17 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.FileServiceGrpc; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.SmartContractServiceGrpc; import org.hiero.sdk.proto.SystemUndeleteTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * Undelete a file or smart contract that was deleted by AdminDelete. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java index a14f49338f..2a023af712 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAirdropTransaction.java @@ -2,13 +2,13 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenAirdropTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; /** * Token Airdrop diff --git a/sdk/src/main/java/org/hiero/sdk/TokenAllowance.java b/sdk/src/main/java/org/hiero/sdk/TokenAllowance.java index ed812b4be6..23ed563cef 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenAllowance.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAllowance.java @@ -3,9 +3,9 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.GrantedTokenAllowance; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.GrantedTokenAllowance; /** * An approved allowance of token transfers for a spender. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java index 312a6b1412..3d1019eac3 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenAssociateTransaction.java @@ -2,17 +2,17 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenAssociateTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAssociateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * The transaction that will associate accounts to a token id. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java index ce10feda60..8976ae3ea8 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenBurnTransaction.java @@ -2,12 +2,6 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenBurnTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.Transaction; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -15,6 +9,12 @@ import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenBurnTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Burns fungible and non-fungible tokens owned by the Treasury Account. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java index 11240435bd..3383adb7cd 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenCancelAirdropTransaction.java @@ -2,13 +2,13 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenCancelAirdropTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody.Builder; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; public class TokenCancelAirdropTransaction extends PendingAirdropLogic { diff --git a/sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java index 8ff13d41d1..79ca0fcc8c 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenClaimAirdropTransaction.java @@ -2,13 +2,13 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenClaimAirdropTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody.Builder; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; public class TokenClaimAirdropTransaction extends PendingAirdropLogic { diff --git a/sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java index 3e33a03479..082289624a 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenCreateTransaction.java @@ -3,11 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenCreateTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; @@ -17,6 +12,11 @@ import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenCreateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Create a new fungible or non-fungible token (NFT) on the Hedera network. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java index 7abf771607..7e5e20f61f 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenDeleteTransaction.java @@ -2,16 +2,16 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenDeleteTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.Transaction; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Deleting a token marks a token as deleted, though it will remain in the diff --git a/sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java index ee1693b1fb..3a01dd5798 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenDissociateTransaction.java @@ -2,17 +2,17 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenDissociateTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDissociateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Disassociates the provided Hedera account from the provided Hedera tokens. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java index a2f0a9d4df..83ae65ec37 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenFeeScheduleUpdateTransaction.java @@ -2,17 +2,17 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Update the custom fees for a given token. If the token does not have a diff --git a/sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java index aee1b8b6fc..6d755dad17 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenFreezeTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenFreezeAccountTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Freezes transfers of the specified token for the account. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java index 24d9bfb0d1..21692fe2ee 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenGrantKycTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenGrantKycTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Grants KYC to the Hedera accounts for the given Hedera token. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenId.java b/sdk/src/main/java/org/hiero/sdk/TokenId.java index dc906dbf15..465c91a431 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenId.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenId.java @@ -2,10 +2,10 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.TokenID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.TokenID; /** * Constructs a TokenId. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenInfo.java b/sdk/src/main/java/org/hiero/sdk/TokenInfo.java index bb42bd133b..402315e2b3 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenInfo.java @@ -4,15 +4,15 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.TokenFreezeStatus; -import org.hiero.sdk.proto.TokenGetInfoResponse; -import org.hiero.sdk.proto.TokenKycStatus; -import org.hiero.sdk.proto.TokenPauseStatus; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; +import org.hiero.sdk.proto.TokenFreezeStatus; +import org.hiero.sdk.proto.TokenGetInfoResponse; +import org.hiero.sdk.proto.TokenKycStatus; +import org.hiero.sdk.proto.TokenPauseStatus; /** * Gets information about a fungible or non-fungible token instance. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java index 4c85feb7c7..05fddbe403 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenInfoQuery.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nullable; import org.hiero.sdk.proto.Query; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; import org.hiero.sdk.proto.TokenGetInfoQuery; import org.hiero.sdk.proto.TokenServiceGrpc; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import javax.annotation.Nullable; /** * Initializes the TokenInfoQuery object. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java index cd09423abb..4b63bd0b7c 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenMintTransaction.java @@ -3,12 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenMintTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.Transaction; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -16,6 +10,12 @@ import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenMintTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Minting fungible token allows you to increase the total supply of the diff --git a/sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java b/sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java index 83ce7efbc7..89e1575bae 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftAllowance.java @@ -4,13 +4,13 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.BoolValue; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.NftAllowance; -import org.hiero.sdk.proto.NftRemoveAllowance; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.NftAllowance; +import org.hiero.sdk.proto.NftRemoveAllowance; /** * Class to encapsulate the nft methods for token allowance's. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java index 0f49b3f3ff..72be36b23a 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftInfoQuery.java @@ -1,12 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.Query; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; -import org.hiero.sdk.proto.TokenGetNftInfoQuery; -import org.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import java.util.Collections; import java.util.List; @@ -14,6 +8,12 @@ import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TokenGetNftInfoQuery; +import org.hiero.sdk.proto.TokenServiceGrpc; /** * A query that returns information about a non-fungible token (NFT). diff --git a/sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java b/sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java index c00a3912b2..2b9c7e4969 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenNftTransfer.java @@ -3,12 +3,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.NftTransfer; -import org.hiero.sdk.proto.TokenID; -import org.hiero.sdk.proto.TokenTransferList; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.hiero.sdk.proto.NftTransfer; +import org.hiero.sdk.proto.TokenID; +import org.hiero.sdk.proto.TokenTransferList; /** * Internal utility class. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java index a63d949fde..a7cde94938 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenPauseTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenPauseTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * A token pause transaction prevents the token from being involved in any diff --git a/sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java index cac8c216f7..aca81e0c18 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRejectTransaction.java @@ -2,18 +2,18 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenReference; -import org.hiero.sdk.proto.TokenRejectTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenReference; +import org.hiero.sdk.proto.TokenRejectTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Reject undesired token(s).
diff --git a/sdk/src/main/java/org/hiero/sdk/TokenRelationship.java b/sdk/src/main/java/org/hiero/sdk/TokenRelationship.java index d03bded4fe..0d3fc0d6ba 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenRelationship.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRelationship.java @@ -3,9 +3,9 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; +import javax.annotation.Nullable; import org.hiero.sdk.proto.TokenFreezeStatus; import org.hiero.sdk.proto.TokenKycStatus; -import javax.annotation.Nullable; /** * Token's information related to the given Account. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java index bcce4e789a..b834e20c59 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenRevokeKycTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenRevokeKycTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Revokes the KYC flag to the Hedera account for the given Hedera token. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenTransfer.java b/sdk/src/main/java/org/hiero/sdk/TokenTransfer.java index 331d9210c2..6fda552f87 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenTransfer.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenTransfer.java @@ -2,10 +2,10 @@ package org.hiero.sdk; import com.google.common.base.MoreObjects; -import org.hiero.sdk.proto.AccountAmount; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; +import org.hiero.sdk.proto.AccountAmount; /** * A token transfer record. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenTransferList.java b/sdk/src/main/java/org/hiero/sdk/TokenTransferList.java index 6ecbcf4795..b4b55434b6 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenTransferList.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenTransferList.java @@ -2,11 +2,11 @@ package org.hiero.sdk; import com.google.protobuf.UInt32Value; -import org.hiero.sdk.proto.AccountAmount; -import org.hiero.sdk.proto.NftTransfer; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; +import org.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.NftTransfer; class TokenTransferList { final TokenId tokenId; diff --git a/sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java index 807954f637..8e2fb0fa1a 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUnfreezeTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Unfreezes transfers of the specified token for the account. diff --git a/sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java index a4d0e0a1a3..a421506615 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUnpauseTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TokenServiceGrpc; import org.hiero.sdk.proto.TokenUnpauseTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * A token unpause transaction is a transaction that unpauses the token diff --git a/sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java index da313609f9..7edd42ad2d 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUpdateNftsTransaction.java @@ -4,11 +4,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TokenUpdateNftsTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -16,6 +11,11 @@ import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenUpdateNftsTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; public class TokenUpdateNftsTransaction extends Transaction { diff --git a/sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java index 5a1feb02c6..c0a9054c10 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenUpdateTransaction.java @@ -5,17 +5,17 @@ import com.google.protobuf.BytesValue; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TokenUpdateTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenUpdateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * A transaction that updates the properties of an existing token. The admin diff --git a/sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java b/sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java index 52cca6b5f8..e75457e9e9 100644 --- a/sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TokenWipeTransaction.java @@ -2,11 +2,6 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TokenWipeAccountTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -14,6 +9,11 @@ import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TokenWipeAccountTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Wipes the provided amount of fungible or non-fungible tokens from the diff --git a/sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java index ed0c908183..dd7f0e3ec7 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicCreateTransaction.java @@ -2,16 +2,16 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; -import org.hiero.sdk.proto.ConsensusServiceGrpc; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Create a topic to be used for consensus. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java index ac8b4a8228..b6fda2f6c6 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicDeleteTransaction.java @@ -2,15 +2,15 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; import org.hiero.sdk.proto.ConsensusServiceGrpc; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Delete a topic. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicId.java b/sdk/src/main/java/org/hiero/sdk/TopicId.java index 6665bc032e..aa4139e2ba 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicId.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicId.java @@ -2,10 +2,10 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.TopicID; import java.util.Objects; import javax.annotation.Nonnegative; import javax.annotation.Nullable; +import org.hiero.sdk.proto.TopicID; /** * Unique identifier for a topic (used by the consensus service). diff --git a/sdk/src/main/java/org/hiero/sdk/TopicInfo.java b/sdk/src/main/java/org/hiero/sdk/TopicInfo.java index 34f8232fac..fafa245f1d 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicInfo.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicInfo.java @@ -4,11 +4,11 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ConsensusGetTopicInfoResponse; -import org.hiero.sdk.proto.ConsensusTopicInfo; import java.time.Duration; import java.time.Instant; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ConsensusGetTopicInfoResponse; +import org.hiero.sdk.proto.ConsensusTopicInfo; /** * Current state of a topic. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java b/sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java index 49108865c4..d729ec4372 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicInfoQuery.java @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.MethodDescriptor; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ConsensusGetTopicInfoQuery; import org.hiero.sdk.proto.ConsensusServiceGrpc; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseHeader; -import io.grpc.MethodDescriptor; -import java.util.Objects; -import javax.annotation.Nullable; /** * Retrieve the latest state of a topic. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicMessage.java b/sdk/src/main/java/org/hiero/sdk/TopicMessage.java index 004bfc0eb6..f989e82de3 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicMessage.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessage.java @@ -3,12 +3,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.List; import javax.annotation.Nullable; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; /** * Topic message records. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java b/sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java index e1f4771223..803a6b85bf 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessageChunk.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import java.time.Instant; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; /** * A chunk of the topic message. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java b/sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java index 2d876963a5..36d845b032 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessageQuery.java @@ -1,11 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.Timestamp; -import org.hiero.sdk.proto.TransactionID; -import org.hiero.sdk.proto.mirror.ConsensusServiceGrpc; -import org.hiero.sdk.proto.mirror.ConsensusTopicQuery; -import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import io.grpc.CallOptions; import io.grpc.ClientCall; import io.grpc.Status; @@ -22,6 +17,11 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Predicate; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.mirror.ConsensusServiceGrpc; +import org.hiero.sdk.proto.mirror.ConsensusTopicQuery; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java index fad962780b..191a88a494 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicMessageSubmitTransaction.java @@ -3,6 +3,10 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.LinkedHashMap; +import java.util.Objects; +import javax.annotation.Nullable; import org.hiero.sdk.proto.ConsensusMessageChunkInfo; import org.hiero.sdk.proto.ConsensusServiceGrpc; import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; @@ -10,10 +14,6 @@ import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionID; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.MethodDescriptor; -import java.util.LinkedHashMap; -import java.util.Objects; -import javax.annotation.Nullable; /** * Submit a message for consensus. diff --git a/sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java b/sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java index b0bc71fccb..ff984375f8 100644 --- a/sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TopicUpdateTransaction.java @@ -3,17 +3,17 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.ConsensusServiceGrpc; -import org.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.MethodDescriptor; import java.time.Duration; import java.time.Instant; import java.util.LinkedHashMap; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; /** * Update a topic. diff --git a/sdk/src/main/java/org/hiero/sdk/Transaction.java b/sdk/src/main/java/org/hiero/sdk/Transaction.java index 7b2850a7ef..7ce5299afd 100644 --- a/sdk/src/main/java/org/hiero/sdk/Transaction.java +++ b/sdk/src/main/java/org/hiero/sdk/Transaction.java @@ -3,12 +3,6 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.SignatureMap; -import org.hiero.sdk.proto.SignaturePair; -import org.hiero.sdk.proto.SignedTransaction; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionList; import java.lang.reflect.Modifier; import java.time.Duration; import java.time.Instant; @@ -26,6 +20,12 @@ import java.util.function.UnaryOperator; import javax.annotation.Nullable; import org.bouncycastle.crypto.digests.SHA384Digest; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SignatureMap; +import org.hiero.sdk.proto.SignaturePair; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionList; /** * Base class for all transactions that may be built and submitted to Hedera. diff --git a/sdk/src/main/java/org/hiero/sdk/TransactionId.java b/sdk/src/main/java/org/hiero/sdk/TransactionId.java index 5c3de01878..95a4be7366 100644 --- a/sdk/src/main/java/org/hiero/sdk/TransactionId.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionId.java @@ -5,7 +5,6 @@ import static java.util.concurrent.CompletableFuture.failedFuture; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.TransactionID; import java.time.Duration; import java.time.Instant; import java.util.Objects; @@ -16,6 +15,7 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; import javax.annotation.Nullable; +import org.hiero.sdk.proto.TransactionID; /** * The client-generated ID for a transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java b/sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java index 11a703ca6a..8d646b1f82 100644 --- a/sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionReceipt.java @@ -4,12 +4,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ExchangeRateSet; -import org.hiero.sdk.proto.TimestampSeconds; import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ExchangeRateSet; +import org.hiero.sdk.proto.TimestampSeconds; /** * The consensus result for a transaction, which might not be currently diff --git a/sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java b/sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java index 2279463952..eb01de9368 100644 --- a/sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionReceiptQuery.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; -import org.hiero.sdk.proto.TransactionGetReceiptQuery; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TransactionGetReceiptQuery; /** * Get the receipt of a transaction, given its transaction ID. diff --git a/sdk/src/main/java/org/hiero/sdk/TransactionRecord.java b/sdk/src/main/java/org/hiero/sdk/TransactionRecord.java index ced18d4ca4..1d719ab6a2 100644 --- a/sdk/src/main/java/org/hiero/sdk/TransactionRecord.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionRecord.java @@ -4,10 +4,6 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.AccountAmount; -import org.hiero.sdk.proto.NftTransfer; -import org.hiero.sdk.proto.TokenTransferList; -import org.hiero.sdk.proto.TransferList; import java.time.Instant; import java.util.ArrayList; import java.util.Collections; @@ -17,6 +13,10 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.AccountAmount; +import org.hiero.sdk.proto.NftTransfer; +import org.hiero.sdk.proto.TokenTransferList; +import org.hiero.sdk.proto.TransferList; /** * The complete record for a transaction on Hedera that has reached consensus. diff --git a/sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java b/sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java index a6c202fef3..beb15e1e86 100644 --- a/sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java +++ b/sdk/src/main/java/org/hiero/sdk/TransactionRecordQuery.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseHeader; -import org.hiero.sdk.proto.TransactionGetRecordQuery; import io.grpc.MethodDescriptor; import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.annotation.Nullable; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseHeader; +import org.hiero.sdk.proto.TransactionGetRecordQuery; /** * Get the record for a transaction. diff --git a/sdk/src/main/java/org/hiero/sdk/TransferTransaction.java b/sdk/src/main/java/org/hiero/sdk/TransferTransaction.java index a816251327..1ee38bd956 100644 --- a/sdk/src/main/java/org/hiero/sdk/TransferTransaction.java +++ b/sdk/src/main/java/org/hiero/sdk/TransferTransaction.java @@ -3,6 +3,12 @@ import com.google.common.base.MoreObjects; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.MethodDescriptor; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; import org.hiero.sdk.proto.AccountAmount; import org.hiero.sdk.proto.CryptoServiceGrpc; import org.hiero.sdk.proto.CryptoTransferTransactionBody; @@ -10,12 +16,6 @@ import org.hiero.sdk.proto.TransactionBody; import org.hiero.sdk.proto.TransactionResponse; import org.hiero.sdk.proto.TransferList; -import io.grpc.MethodDescriptor; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; /** * A transaction that transfers hbars and tokens between Hedera accounts. You can enter multiple transfers in a single diff --git a/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java index a37959eb57..47d0ca3c4c 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceApproveTransactionTest.java @@ -7,11 +7,11 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java index 7074b1495e..87b544937b 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountAllowanceDeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java index c5a6d42f14..5e771f938c 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountBalanceQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java index b5b0b4aeb3..669b8ac1eb 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountCreateTransactionTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.CryptoCreateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.CryptoCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java index 6987bd166a..ca01402d0e 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountDeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.CryptoDeleteTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.CryptoDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java index e96edc9e07..678dbbf178 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountInfoQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java b/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java index fcaf0280a6..7bb520e541 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountInfoTest.java @@ -3,12 +3,12 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoGetInfoResponse; -import org.hiero.sdk.proto.KeyList; -import org.hiero.sdk.proto.LiveHash; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; +import org.hiero.sdk.proto.CryptoGetInfoResponse; +import org.hiero.sdk.proto.KeyList; +import org.hiero.sdk.proto.LiveHash; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java index 9305f01835..d28d3a72bb 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountRecordsQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java b/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java index 724748dcc9..3ae5778a5c 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountStakersQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java index 66cda0fa0b..a1fbbbd743 100644 --- a/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AccountUpdateTransactionTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.CryptoUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.CryptoUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java b/sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java index a135890b1c..8f5990e267 100644 --- a/sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java +++ b/sdk/src/test/java/org/hiero/sdk/AddressBookQueryMockTest.java @@ -1,11 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatException; +import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; -import org.hiero.sdk.proto.mirror.NetworkServiceGrpc; import io.grpc.Server; import io.grpc.Status; import io.grpc.inprocess.InProcessServerBuilder; @@ -15,6 +14,7 @@ import java.util.Collections; import java.util.List; import java.util.Queue; +import org.hiero.sdk.proto.mirror.NetworkServiceGrpc; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java b/sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java index c50d74fd39..bdeeb4ae0a 100644 --- a/sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java +++ b/sdk/src/test/java/org/hiero/sdk/BaseNodeAddressTest.java @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.hiero.sdk.BaseNodeAddress.PORT_MIRROR_TLS; import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_TLS; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ClientTest.java b/sdk/src/test/java/org/hiero/sdk/ClientTest.java index c16eec5b5f..df90b4dc7b 100644 --- a/sdk/src/test/java/org/hiero/sdk/ClientTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ClientTest.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.hiero.sdk.BaseNodeAddress.PORT_NODE_PLAIN; import com.google.protobuf.ByteString; import java.io.File; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java index 54ce7c3cf0..50197a16f3 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractByteCodeQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java index e0e838e302..e574d7055c 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractCallQueryTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java index 9a49ea1934..94c440fc86 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractCreateTransactionTest.java @@ -3,13 +3,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ContractCreateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ContractCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java index aabd97ac3a..140ce31c54 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractDeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ContractDeleteTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ContractDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java index 600b4c4b6e..6a871f6330 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractExecuteTransactionTest.java @@ -4,11 +4,11 @@ import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.ContractCallTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ContractCallTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java index 8f07e4ec8c..08ae102684 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractInfoQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java index 65167304d8..8998f7cc66 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractInfoTest.java @@ -2,11 +2,11 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractGetInfoResponse; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ContractGetInfoResponse; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java index f7516514f7..ddfcdb186b 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractLogInfoTest.java @@ -3,10 +3,10 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ContractLoginfo; import io.github.jsonSnapshot.SnapshotMatcher; import java.nio.charset.StandardCharsets; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ContractLoginfo; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java index 6aad465c91..5255676894 100644 --- a/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ContractUpdateTransactionTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ContractUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ContractUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java index 4b024109b1..404dea8dbb 100644 --- a/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CryptoTransferTransactionTest.java @@ -5,12 +5,12 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.CryptoTransferTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionList; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.CryptoTransferTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionList; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java b/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java index b1ce76b994..757d945779 100644 --- a/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomFixedFeeTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.FixedFee; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.FixedFee; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java b/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java index 820026e2f6..277c56ae59 100644 --- a/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomFractionalFeeTest.java @@ -3,9 +3,9 @@ import static org.assertj.core.api.Assertions.assertThat; +import io.github.jsonSnapshot.SnapshotMatcher; import org.hiero.sdk.proto.Fraction; import org.hiero.sdk.proto.FractionalFee; -import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java b/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java index 2f7ea27527..0f65ad0202 100644 --- a/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/CustomRoyaltyFeeTest.java @@ -3,10 +3,10 @@ import static org.assertj.core.api.Assertions.assertThat; +import io.github.jsonSnapshot.SnapshotMatcher; import org.hiero.sdk.proto.FixedFee; import org.hiero.sdk.proto.Fraction; import org.hiero.sdk.proto.RoyaltyFee; -import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java b/sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java index 2e81d3fe28..72e1c40268 100644 --- a/sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ECDSAPrivateKeyTest.java @@ -3,9 +3,9 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.utils.Bip32Utils; import java.io.IOException; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.utils.Bip32Utils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java b/sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java index 55b378fd9e..4e763bde06 100644 --- a/sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ECDSAPublicKeyTest.java @@ -4,7 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import java.math.BigDecimal; import java.util.Collections; diff --git a/sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java b/sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java index 7f4106a877..f5e52c75c8 100644 --- a/sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/Ed25519PublicKeyTest.java @@ -4,7 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import java.math.BigDecimal; import java.util.Collections; diff --git a/sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java b/sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java index 6ec6406c14..351ede100e 100644 --- a/sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java +++ b/sdk/src/test/java/org/hiero/sdk/EthereumFlowMockTest.java @@ -4,6 +4,9 @@ import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; import org.hiero.sdk.proto.FileID; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.ResponseCodeEnum; @@ -13,9 +16,6 @@ import org.hiero.sdk.proto.TransactionGetReceiptResponse; import org.hiero.sdk.proto.TransactionReceipt; import org.hiero.sdk.proto.TransactionResponse; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; diff --git a/sdk/src/test/java/org/hiero/sdk/ExecutableTest.java b/sdk/src/test/java/org/hiero/sdk/ExecutableTest.java index 1227e7cefe..16ee180f84 100644 --- a/sdk/src/test/java/org/hiero/sdk/ExecutableTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ExecutableTest.java @@ -4,18 +4,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import org.hiero.sdk.Executable.GrpcRequest; -import org.hiero.sdk.logger.LogLevel; -import org.hiero.sdk.logger.Logger; -import org.hiero.sdk.proto.QueryHeader; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.ResponseCodeEnum; -import org.hiero.sdk.proto.ResponseHeader; import io.grpc.MethodDescriptor; import io.grpc.StatusRuntimeException; import java.time.Duration; @@ -28,7 +20,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import javax.annotation.Nullable; -import org.assertj.core.api.Assertions; +import org.hiero.sdk.Executable.GrpcRequest; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; +import org.hiero.sdk.proto.QueryHeader; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.ResponseHeader; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -504,12 +502,10 @@ void shouldRetryReturnsCorrectStates() { assertThat(tx.getExecutionState(Status.PLATFORM_TRANSACTION_NOT_CREATED, null)) .isEqualTo(ExecutionState.SERVER_ERROR); - assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)) - .isEqualTo(ExecutionState.SERVER_ERROR); + assertThat(tx.getExecutionState(Status.PLATFORM_NOT_ACTIVE, null)).isEqualTo(ExecutionState.SERVER_ERROR); assertThat(tx.getExecutionState(Status.BUSY, null)).isEqualTo(ExecutionState.RETRY); assertThat(tx.getExecutionState(Status.OK, null)).isEqualTo(ExecutionState.SUCCESS); - assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)) - .isEqualTo(ExecutionState.REQUEST_ERROR); + assertThat(tx.getExecutionState(Status.ACCOUNT_DELETED, null)).isEqualTo(ExecutionState.REQUEST_ERROR); } @Test diff --git a/sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java b/sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java index 4dfbc00487..6a5b3270f3 100644 --- a/sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FeeAssessmentMethodTest.java @@ -3,7 +3,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; class FeeAssessmentMethodTest { diff --git a/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java index 6cf499be17..cf4466c23c 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileAppendTransactionTest.java @@ -4,8 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import org.hiero.sdk.proto.FileAppendTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; @@ -13,6 +11,8 @@ import java.util.List; import java.util.Map; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.FileAppendTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java b/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java index a5578e6295..8f640c3071 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileContentsQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java index 12a5acaf0b..55c3a7948b 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileCreateTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.FileCreateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.FileCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java index f8f7e50ff1..50f885f9d8 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileDeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.FileDeleteTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.FileDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java index dc2e8a6778..5956569a0a 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileInfoQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FileInfoTest.java b/sdk/src/test/java/org/hiero/sdk/FileInfoTest.java index 930480d5cc..59e2d7f009 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileInfoTest.java @@ -2,11 +2,11 @@ package org.hiero.sdk; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.FileGetInfoResponse; -import org.hiero.sdk.proto.KeyList; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.FileGetInfoResponse; +import org.hiero.sdk.proto.KeyList; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java index d82b96b3fc..ffbcc1e4f8 100644 --- a/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FileUpdateTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.FileUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.FileUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java index 1e68976039..0541b117f1 100644 --- a/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/FreezeTransactionTest.java @@ -6,14 +6,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.FreezeTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.Timestamp; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.FreezeTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/KeyListTest.java b/sdk/src/test/java/org/hiero/sdk/KeyListTest.java index 500e4b24c9..e0751cfdb8 100644 --- a/sdk/src/test/java/org/hiero/sdk/KeyListTest.java +++ b/sdk/src/test/java/org/hiero/sdk/KeyListTest.java @@ -6,8 +6,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.Key; import java.util.List; +import org.hiero.sdk.proto.Key; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/KeyTest.java b/sdk/src/test/java/org/hiero/sdk/KeyTest.java index 560adc5efa..4a5e522ec7 100644 --- a/sdk/src/test/java/org/hiero/sdk/KeyTest.java +++ b/sdk/src/test/java/org/hiero/sdk/KeyTest.java @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import static org.hiero.sdk.Key.fromBytes; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatNoException; +import static org.hiero.sdk.Key.fromBytes; import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.Key; -import org.hiero.sdk.proto.KeyList; -import org.hiero.sdk.proto.ThresholdKey; import java.math.BigInteger; import java.util.List; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.Key; +import org.hiero.sdk.proto.KeyList; +import org.hiero.sdk.proto.ThresholdKey; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java b/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java index d567e09f0f..6a908cf7c1 100644 --- a/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/LiveHashQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java index e1828e1b94..97e38ca298 100644 --- a/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MessageSubmitTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/MnemonicTest.java b/sdk/src/test/java/org/hiero/sdk/MnemonicTest.java index 93ba649b31..222e37df1e 100644 --- a/sdk/src/test/java/org/hiero/sdk/MnemonicTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MnemonicTest.java @@ -4,9 +4,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import org.hiero.sdk.utils.Bip32Utils; import java.util.Arrays; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.utils.Bip32Utils; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/sdk/src/test/java/org/hiero/sdk/Mocker.java b/sdk/src/test/java/org/hiero/sdk/Mocker.java index 36cd8ad70a..3a7310fe4b 100644 --- a/sdk/src/test/java/org/hiero/sdk/Mocker.java +++ b/sdk/src/test/java/org/hiero/sdk/Mocker.java @@ -1,13 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.logger.LogLevel; -import org.hiero.sdk.logger.Logger; -import org.hiero.sdk.proto.ConsensusServiceGrpc; -import org.hiero.sdk.proto.CryptoServiceGrpc; -import org.hiero.sdk.proto.FileServiceGrpc; -import org.hiero.sdk.proto.SmartContractServiceGrpc; -import org.hiero.sdk.proto.TokenServiceGrpc; import io.grpc.MethodDescriptor; import io.grpc.Server; import io.grpc.ServerMethodDefinition; @@ -23,6 +16,13 @@ import java.util.List; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; +import org.hiero.sdk.logger.LogLevel; +import org.hiero.sdk.logger.Logger; +import org.hiero.sdk.proto.ConsensusServiceGrpc; +import org.hiero.sdk.proto.CryptoServiceGrpc; +import org.hiero.sdk.proto.FileServiceGrpc; +import org.hiero.sdk.proto.SmartContractServiceGrpc; +import org.hiero.sdk.proto.TokenServiceGrpc; public class Mocker implements AutoCloseable { private static final PrivateKey PRIVATE_KEY = PrivateKey.fromString( diff --git a/sdk/src/test/java/org/hiero/sdk/MockingTest.java b/sdk/src/test/java/org/hiero/sdk/MockingTest.java index dabf41b3e3..20868f4bea 100644 --- a/sdk/src/test/java/org/hiero/sdk/MockingTest.java +++ b/sdk/src/test/java/org/hiero/sdk/MockingTest.java @@ -3,6 +3,17 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeoutException; +import java.util.function.Supplier; import org.hiero.sdk.proto.AccountID; import org.hiero.sdk.proto.CryptoGetAccountBalanceResponse; import org.hiero.sdk.proto.CryptoGetInfoResponse; @@ -21,17 +32,6 @@ import org.hiero.sdk.proto.TransactionReceipt; import org.hiero.sdk.proto.TransactionRecord; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.Status; -import io.grpc.stub.StreamObserver; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; -import java.util.concurrent.TimeoutException; -import java.util.function.Supplier; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; diff --git a/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java index 969de04a13..b06f5773d5 100644 --- a/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NetworkVersionInfoQueryTest.java @@ -2,9 +2,9 @@ package org.hiero.sdk; import com.google.protobuf.ByteString; +import io.github.jsonSnapshot.SnapshotMatcher; import org.hiero.sdk.proto.QueryHeader; import org.hiero.sdk.proto.Transaction; -import io.github.jsonSnapshot.SnapshotMatcher; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java index 7bd3abfc32..fc1a48593c 100644 --- a/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NodeCreateTransactionTest.java @@ -5,13 +5,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.NodeCreateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.NodeCreateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java index 645df525bd..b8ced65711 100644 --- a/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NodeDeleteTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.NodeDeleteTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.NodeDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java index dddfacbaa6..35eb9269f7 100644 --- a/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/NodeUpdateTransactionTest.java @@ -7,13 +7,13 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.NodeUpdateTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.NodeUpdateTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java b/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java index 65ca28f439..a727306af8 100644 --- a/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ProxyStakerTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.ProxyStaker; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.ProxyStaker; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java b/sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java index bd184a4e22..2c36d90ca1 100644 --- a/sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ReceiptStatusExceptionTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ResponseCodeEnum; import java.time.Instant; +import org.hiero.sdk.proto.ResponseCodeEnum; import org.junit.jupiter.api.Test; class ReceiptStatusExceptionTest { diff --git a/sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java b/sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java index 494c15ef8d..7865468065 100644 --- a/sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java +++ b/sdk/src/test/java/org/hiero/sdk/RegenerateTransactionIdsTest.java @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.ResponseCodeEnum; -import org.hiero.sdk.proto.SignedTransaction; -import org.hiero.sdk.proto.Transaction; -import org.hiero.sdk.proto.TransactionBody; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.Status; import java.util.HashSet; import java.util.List; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; +import org.hiero.sdk.proto.ResponseCodeEnum; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionBody; +import org.hiero.sdk.proto.TransactionResponse; import org.junit.jupiter.api.Test; public class RegenerateTransactionIdsTest { diff --git a/sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java b/sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java index 17c3e0a6ee..dcd03e2a8d 100644 --- a/sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/RequestTypeTest.java @@ -3,10 +3,10 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.HederaFunctionality; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.IntStream; +import org.hiero.sdk.proto.HederaFunctionality; import org.junit.jupiter.api.Test; class RequestTypeTest { diff --git a/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java index aea3bd9836..a310741cb0 100644 --- a/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleDeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.ScheduleDeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.ScheduleDeleteTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java index 309e1dab58..01574b189f 100644 --- a/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java index 0c246d0a1f..c9cef88193 100644 --- a/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/ScheduleInfoTest.java @@ -3,10 +3,10 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.CryptoDeleteTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; +import org.hiero.sdk.proto.CryptoDeleteTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java index ede697646b..b84e341843 100644 --- a/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/SystemDeleteTransactionTest.java @@ -6,13 +6,13 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Instant; +import java.util.Arrays; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.SystemDeleteTransactionBody; import org.hiero.sdk.proto.TimestampSeconds; import org.hiero.sdk.proto.TransactionBody; -import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Instant; -import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java index b92dc18645..83f9995d58 100644 --- a/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/SystemUndeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.SystemUndeleteTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.SystemUndeleteTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TestResponse.java b/sdk/src/test/java/org/hiero/sdk/TestResponse.java index c5a3ecba8a..4dc0684fcc 100644 --- a/sdk/src/test/java/org/hiero/sdk/TestResponse.java +++ b/sdk/src/test/java/org/hiero/sdk/TestResponse.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import io.grpc.StatusRuntimeException; +import javax.annotation.Nullable; import org.hiero.sdk.proto.Response; import org.hiero.sdk.proto.TransactionGetReceiptResponse; import org.hiero.sdk.proto.TransactionReceipt; import org.hiero.sdk.proto.TransactionResponse; -import io.grpc.StatusRuntimeException; -import javax.annotation.Nullable; public class TestResponse { @Nullable diff --git a/sdk/src/test/java/org/hiero/sdk/TestService.java b/sdk/src/test/java/org/hiero/sdk/TestService.java index aa569fc4ca..c0ab8b7190 100644 --- a/sdk/src/test/java/org/hiero/sdk/TestService.java +++ b/sdk/src/test/java/org/hiero/sdk/TestService.java @@ -1,10 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.Query; -import org.hiero.sdk.proto.Response; -import org.hiero.sdk.proto.Transaction; -import org.hiero.sdk.proto.TransactionResponse; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; import java.util.ArrayDeque; @@ -12,6 +8,10 @@ import java.util.List; import java.util.Queue; import javax.annotation.Nullable; +import org.hiero.sdk.proto.Query; +import org.hiero.sdk.proto.Response; +import org.hiero.sdk.proto.Transaction; +import org.hiero.sdk.proto.TransactionResponse; public interface TestService { diff --git a/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java index ae5c46ca04..6f113ad07a 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenAirdropTransactionTest.java @@ -7,14 +7,14 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenAirdropTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; import java.util.Map; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java index 09ffef2d17..cbf6baf635 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenAssociateTransactionTest.java @@ -4,14 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenAssociateTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenAssociateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java index 1dc3743c2b..671d0517e5 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenBurnTransactionTest.java @@ -4,14 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenBurnTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenBurnTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java index 888c3dac3d..0c1d656268 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenCancelAirdropTransactionTest.java @@ -3,15 +3,15 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenCancelAirdropTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenCancelAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java index f74be20f59..f6553c23df 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenClaimAirdropTransactionTest.java @@ -3,15 +3,15 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenClaimAirdropTransactionBody; -import org.hiero.sdk.proto.TokenServiceGrpc; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenClaimAirdropTransactionBody; +import org.hiero.sdk.proto.TokenServiceGrpc; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java index da1c15673b..d1d466e330 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenCreateTransactionTest.java @@ -6,16 +6,16 @@ import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.Timestamp; -import org.hiero.sdk.proto.TokenCreateTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TokenCreateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java index 7d812026a6..a3469fc052 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenDeleteTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenDeleteTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDeleteTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java index 3340d569dc..7ef4b1e9aa 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenDissociateTransactionTest.java @@ -4,13 +4,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenDissociateTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenDissociateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java index fe642442c3..1df5b19452 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenFeeScheduleUpdateTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFeeScheduleUpdateTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java index c73b6afb33..1a85e52a1e 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenFreezeTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenFreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenFreezeAccountTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java index d35c76ff9c..e19d470e6b 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenGrantKycTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenGrantKycTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenGrantKycTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java index 284f8c4bda..1febaeb6ad 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenInfoQueryTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java index b46f651ff7..1f95f2dcbb 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenMintTransactionTest.java @@ -6,13 +6,13 @@ import com.google.common.collect.Iterables; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenMintTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenMintTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java index 80ac561e8c..60a6cb91f2 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenNftInfoQueryTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java index ad752db6c1..90a5c23cbd 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenPauseTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenPauseTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenPauseTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java index dcd4d8dfe1..dd35096ee1 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenRejectTransactionTest.java @@ -4,14 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenReference; -import org.hiero.sdk.proto.TokenRejectTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenReference; +import org.hiero.sdk.proto.TokenRejectTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java index 36aaeba800..866c9d8139 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenRevokeKycTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenRevokeKycTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenRevokeKycTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java b/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java index 7ef09e2f6f..68450aca6e 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenSupplyTypeTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.TokenSupplyType; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.TokenSupplyType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java b/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java index 050b9aea69..d8a2449062 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenTypeTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.TokenType; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.TokenType; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java index bae73e4ebc..778fc687af 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUnfreezeTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenUnfreezeAccountTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java index 500accf521..dda0450545 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUnpauseTransactionTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenUnpauseTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenUnpauseTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java index 96ffe5659e..6679cb0af2 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUpdateNftsTransactionTest.java @@ -6,13 +6,13 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenUpdateNftsTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenUpdateNftsTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java index 16dae26747..f7025f27d7 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenUpdateTransactionTest.java @@ -7,14 +7,14 @@ import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; import com.google.protobuf.StringValue; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.Timestamp; -import org.hiero.sdk.proto.TokenUpdateTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TokenUpdateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java index 45615fec59..ffb0c19492 100644 --- a/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TokenWipeTransactionTest.java @@ -4,14 +4,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TokenWipeAccountTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TokenWipeAccountTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java index ddb170ed2f..034f51bc89 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicCreateTransactionTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ConsensusCreateTopicTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java index c9ee4e3b0d..d7e0ad9fa2 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicDeleteTransactionTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ConsensusDeleteTopicTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java index 72e9e83563..7a2af98627 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicInfoQueryTest.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java b/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java index dac75a7507..2c8886eae7 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicInfoTest.java @@ -3,12 +3,12 @@ import com.google.protobuf.ByteString; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.ConsensusGetTopicInfoResponse; -import org.hiero.sdk.proto.ConsensusTopicInfo; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Duration; import java.time.Instant; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.ConsensusGetTopicInfoResponse; +import org.hiero.sdk.proto.ConsensusTopicInfo; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java index d20752ea22..2393c635ac 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageChunkTest.java @@ -4,10 +4,10 @@ import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; +import java.time.Instant; import org.hiero.sdk.proto.ConsensusMessageChunkInfo; import org.hiero.sdk.proto.Timestamp; import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; -import java.time.Instant; import org.junit.jupiter.api.Test; public class TopicMessageChunkTest { diff --git a/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java index 384d436c4c..085b9b8a83 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageQueryTest.java @@ -8,14 +8,6 @@ import com.google.common.primitives.Longs; import com.google.common.util.concurrent.Uninterruptibles; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.AccountID; -import org.hiero.sdk.proto.ConsensusMessageChunkInfo; -import org.hiero.sdk.proto.Timestamp; -import org.hiero.sdk.proto.TopicID; -import org.hiero.sdk.proto.TransactionID; -import org.hiero.sdk.proto.mirror.ConsensusServiceGrpc; -import org.hiero.sdk.proto.mirror.ConsensusTopicQuery; -import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import io.github.jsonSnapshot.SnapshotMatcher; import io.grpc.Server; import io.grpc.Status; @@ -35,6 +27,14 @@ import java.util.function.Consumer; import org.assertj.core.api.Assertions; import org.assertj.core.api.InstanceOfAssertFactories; +import org.hiero.sdk.proto.AccountID; +import org.hiero.sdk.proto.ConsensusMessageChunkInfo; +import org.hiero.sdk.proto.Timestamp; +import org.hiero.sdk.proto.TopicID; +import org.hiero.sdk.proto.TransactionID; +import org.hiero.sdk.proto.mirror.ConsensusServiceGrpc; +import org.hiero.sdk.proto.mirror.ConsensusTopicQuery; +import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; @@ -177,7 +177,10 @@ void subscribe() { subscribeToMirror(received::add); assertThat(errors).isEmpty(); - Assertions.assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); + Assertions.assertThat(received) + .hasSize(2) + .extracting(t -> t.sequenceNumber) + .containsExactly(1L, 2L); } @Test @@ -260,7 +263,10 @@ void retryRecovers(Status.Code code, String description) { subscribeToMirror(received::add); - Assertions.assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); + Assertions.assertThat(received) + .hasSize(2) + .extracting(t -> t.sequenceNumber) + .containsExactly(1L, 2L); assertThat(errors).isEmpty(); } @@ -295,7 +301,10 @@ void customRetry() { subscribeToMirror(received::add); - Assertions.assertThat(received).hasSize(1).extracting(t -> t.sequenceNumber).containsExactly(1L); + Assertions.assertThat(received) + .hasSize(1) + .extracting(t -> t.sequenceNumber) + .containsExactly(1L); assertThat(errors).isEmpty(); } @@ -317,7 +326,10 @@ void retryWithLimit() { subscribeToMirror(received::add); - Assertions.assertThat(received).hasSize(2).extracting(t -> t.sequenceNumber).containsExactly(1L, 2L); + Assertions.assertThat(received) + .hasSize(2) + .extracting(t -> t.sequenceNumber) + .containsExactly(1L, 2L); assertThat(errors).isEmpty(); } diff --git a/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java index f0c9e209e9..12da4ecda1 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageSubmitTransactionTest.java @@ -5,12 +5,12 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.ByteString; -import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; -import org.hiero.sdk.proto.SchedulableTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; import java.util.Arrays; +import org.hiero.sdk.proto.ConsensusSubmitMessageTransactionBody; +import org.hiero.sdk.proto.SchedulableTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java b/sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java index e437ddf3be..7cfbd83d8c 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicMessageTest.java @@ -4,11 +4,11 @@ import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; +import java.time.Instant; +import java.util.List; import org.hiero.sdk.proto.ConsensusMessageChunkInfo; import org.hiero.sdk.proto.Timestamp; import org.hiero.sdk.proto.mirror.ConsensusTopicResponse; -import java.time.Instant; -import java.util.List; import org.junit.jupiter.api.Test; public class TopicMessageTest { diff --git a/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java index 9ffe24d2b8..1749304c14 100644 --- a/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TopicUpdateTransactionTest.java @@ -5,15 +5,15 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.protobuf.StringValue; +import io.github.jsonSnapshot.SnapshotMatcher; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; import org.hiero.sdk.proto.ConsensusUpdateTopicTransactionBody; import org.hiero.sdk.proto.CryptoDeleteTransactionBody; import org.hiero.sdk.proto.SchedulableTransactionBody; import org.hiero.sdk.proto.Timestamp; import org.hiero.sdk.proto.TransactionBody; -import io.github.jsonSnapshot.SnapshotMatcher; -import java.time.Duration; -import java.time.Instant; -import java.util.Arrays; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java index c6db5bdd60..72b7c365a6 100644 --- a/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionReceiptQueryTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java index ee236bfb67..f9ce024c62 100644 --- a/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionRecordQueryTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import org.hiero.sdk.proto.QueryHeader; import io.github.jsonSnapshot.SnapshotMatcher; import java.time.Instant; +import org.hiero.sdk.proto.QueryHeader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java index e0198d6952..338e1fb788 100644 --- a/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionRecordTest.java @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; +import static org.assertj.core.api.Assertions.assertThat; import static org.hiero.sdk.ContractFunctionResultTest.CALL_RESULT_HEX; import static org.hiero.sdk.TransactionReceiptTest.spawnReceiptExample; -import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.ByteString; import com.google.protobuf.BytesValue; diff --git a/sdk/src/test/java/org/hiero/sdk/TransactionTest.java b/sdk/src/test/java/org/hiero/sdk/TransactionTest.java index b4ca347c90..d0900572a8 100644 --- a/sdk/src/test/java/org/hiero/sdk/TransactionTest.java +++ b/sdk/src/test/java/org/hiero/sdk/TransactionTest.java @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk; -import static org.hiero.sdk.Transaction.fromBytes; import static org.assertj.core.api.Assertions.assertThat; +import static org.hiero.sdk.Transaction.fromBytes; import com.google.protobuf.InvalidProtocolBufferException; -import org.hiero.sdk.proto.SignedTransaction; -import org.hiero.sdk.proto.TokenAssociateTransactionBody; -import org.hiero.sdk.proto.TransactionBody; import java.time.Instant; import java.util.Arrays; import java.util.List; import org.bouncycastle.util.encoders.Hex; +import org.hiero.sdk.proto.SignedTransaction; +import org.hiero.sdk.proto.TokenAssociateTransactionBody; +import org.hiero.sdk.proto.TransactionBody; import org.junit.jupiter.api.Test; public class TransactionTest { diff --git a/sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java b/sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java index 6f5ec931a7..880252ca7e 100644 --- a/sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java +++ b/sdk/src/test/java/org/hiero/sdk/logger/LoggerTest.java @@ -6,8 +6,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import org.hiero.sdk.logger.LogLevel; -import org.hiero.sdk.logger.Logger; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java index dab8378115..e4fb4fd780 100644 --- a/sdk/src/testIntegration/java/module-info.java +++ b/sdk/src/testIntegration/java/module-info.java @@ -19,8 +19,8 @@ */ open module org.hiero.sdk.test.integration { - requires com.esaulpaugh.headlong; requires org.hiero.sdk; + requires com.esaulpaugh.headlong; requires org.assertj.core; requires org.bouncycastle.provider; requires org.junit.jupiter.api; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java index 03e4215baa..f32255a18b 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountAllowanceIntegrationTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.AccountAllowanceApproveTransaction; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountDeleteTransaction; @@ -10,7 +11,6 @@ import org.hiero.sdk.PrivateKey; import org.hiero.sdk.TransactionId; import org.hiero.sdk.TransferTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java index 52e8a32cac..3657ba3180 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountBalanceIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.AccountId; import org.hiero.sdk.Client; @@ -11,8 +13,6 @@ import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.Status; import org.hiero.sdk.TokenCreateTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java index cdc4db8b94..ae0724598c 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountCreateIntegrationTest.java @@ -4,10 +4,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import org.hiero.sdk.*; import java.time.Duration; import java.time.Instant; import java.util.Objects; +import org.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java index ad954757bc..abb217c01f 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountDeleteIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.time.Duration; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountDeleteTransaction; import org.hiero.sdk.AccountInfoQuery; @@ -12,8 +14,6 @@ import org.hiero.sdk.PrivateKey; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.time.Duration; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java index 1449c0d7fc..47404ace3d 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountRecordsIntegrationTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountRecordsQuery; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.TransferTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java index 038d776338..86ab81b2c3 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/AccountUpdateIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.time.Duration; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountInfoQuery; import org.hiero.sdk.AccountUpdateTransaction; @@ -11,8 +13,6 @@ import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.Status; -import java.time.Duration; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java index 87706c3d83..288ba3e981 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ClientIntegrationTest.java @@ -4,12 +4,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import org.hiero.sdk.*; import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java index 3ae1939f42..74e25aa24c 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractBytecodeIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ContractByteCodeQuery; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; @@ -14,7 +15,6 @@ import org.hiero.sdk.MaxQueryPaymentExceededException; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java index 911aa93c34..f6e131ee9e 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCallIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ContractCallQuery; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; @@ -15,7 +16,6 @@ import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java index 3d1ee910f0..45417df3ac 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateFlowIntegrationTest.java @@ -4,8 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.hiero.sdk.*; import java.util.Objects; +import org.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java index 52a1218f1f..047fdec986 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractCreateIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; import org.hiero.sdk.ContractFunctionParameters; @@ -13,7 +14,6 @@ import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java index 43a37257d2..e9ce11947e 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractDeleteIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; import org.hiero.sdk.ContractFunctionParameters; @@ -13,7 +14,6 @@ import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java index deb66cf850..89fb629a26 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractExecuteIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; import org.hiero.sdk.ContractExecuteTransaction; @@ -14,7 +15,6 @@ import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java index 2c48c4704b..1df3af4626 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractFunctionParametersIntegrationTest.java @@ -4,6 +4,9 @@ import static org.assertj.core.api.Assertions.assertThat; import com.esaulpaugh.headlong.abi.Address; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Objects; import org.hiero.sdk.ContractCallQuery; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; @@ -15,9 +18,6 @@ import org.hiero.sdk.FileId; import org.hiero.sdk.Hbar; import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; -import java.math.BigInteger; -import java.util.Arrays; -import java.util.Objects; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java index 475644af28..72c87aca10 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractIdPopulationIntegrationTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractFunctionParameters; import org.hiero.sdk.ContractId; import org.hiero.sdk.ContractInfoQuery; import org.hiero.sdk.FileCreateTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java index 7a383b473e..70ddf340ce 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractInfoIntegrationTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.*; -import org.hiero.sdk.*; import java.util.Objects; +import org.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java index 1638d25d2a..0fc9f5d7e3 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractNonceInfoIntegrationTest.java @@ -3,13 +3,13 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; import org.hiero.sdk.ContractId; import org.hiero.sdk.ContractNonceInfo; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java index 0149fe70a1..a5716c5fc4 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ContractUpdateIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; import org.hiero.sdk.ContractFunctionParameters; @@ -14,7 +15,6 @@ import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java index 2aaf6f8bd1..63893a7529 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EntityHelper.java @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk.test.integration; +import java.util.concurrent.TimeoutException; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountId; import org.hiero.sdk.ContractCreateFlow; @@ -14,7 +15,6 @@ import org.hiero.sdk.TokenId; import org.hiero.sdk.TokenSupplyType; import org.hiero.sdk.TokenType; -import java.util.concurrent.TimeoutException; /** * The EntityCreator class provides static methods for creating different entities in a Hedera network, such as token, account, and contract. diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java index eec3b17523..cf10993258 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/EthereumTransactionIntegrationTest.java @@ -5,6 +5,10 @@ import com.esaulpaugh.headlong.rlp.RLPEncoder; import com.esaulpaugh.headlong.util.Integers; +import java.math.BigInteger; +import java.util.List; +import java.util.Objects; +import org.bouncycastle.util.encoders.Hex; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractDeleteTransaction; import org.hiero.sdk.ContractExecuteTransaction; @@ -16,10 +20,6 @@ import org.hiero.sdk.PrivateKey; import org.hiero.sdk.PrivateKeyECDSA; import org.hiero.sdk.TransferTransaction; -import java.math.BigInteger; -import java.util.List; -import java.util.Objects; -import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java index aead5d6bd0..b49453c236 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileAppendIntegrationTest.java @@ -3,14 +3,14 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.time.Duration; +import java.util.Objects; import org.hiero.sdk.FileAppendTransaction; import org.hiero.sdk.FileContentsQuery; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; import org.hiero.sdk.FileInfoQuery; import org.hiero.sdk.KeyList; -import java.time.Duration; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java index 9dd0c5c6a6..ffb2d6915a 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileContentsIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.FileContentsQuery; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; @@ -11,7 +12,6 @@ import org.hiero.sdk.MaxQueryPaymentExceededException; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java index 39b43077f9..bed1bb4cf3 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileCreateIntegrationTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; import org.hiero.sdk.FileInfoQuery; import org.hiero.sdk.KeyList; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java index bccd22bd6c..29e39f6719 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileDeleteIntegrationTest.java @@ -4,13 +4,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; import org.hiero.sdk.FileInfoQuery; import org.hiero.sdk.KeyList; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java index 755aad2918..b2d08c9519 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileInfoIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; import org.hiero.sdk.FileInfoQuery; @@ -11,7 +12,6 @@ import org.hiero.sdk.KeyList; import org.hiero.sdk.MaxQueryPaymentExceededException; import org.hiero.sdk.PrecheckStatusException; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java index 0b6fc4e5d8..8f6d72c9b0 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/FileUpdateIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.AccountId; import org.hiero.sdk.FileCreateTransaction; import org.hiero.sdk.FileDeleteTransaction; @@ -15,7 +16,6 @@ import org.hiero.sdk.PrivateKey; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java index 00bde47377..36fa20163c 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/IntegrationTestEnv.java @@ -3,14 +3,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.AccountBalanceQuery; -import org.hiero.sdk.AccountCreateTransaction; -import org.hiero.sdk.AccountId; -import org.hiero.sdk.Client; -import org.hiero.sdk.Hbar; -import org.hiero.sdk.PrivateKey; -import org.hiero.sdk.PublicKey; -import org.hiero.sdk.TransferTransaction; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -19,6 +11,14 @@ import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.hiero.sdk.AccountBalanceQuery; +import org.hiero.sdk.AccountCreateTransaction; +import org.hiero.sdk.AccountId; +import org.hiero.sdk.Client; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.PublicKey; +import org.hiero.sdk.TransferTransaction; import org.junit.jupiter.api.Assumptions; public class IntegrationTestEnv implements AutoCloseable { diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java index 3cb6ad7b0b..023fba5f14 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashAddIntegrationTest.java @@ -3,15 +3,15 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.time.Duration; +import java.util.Objects; +import org.bouncycastle.util.encoders.Hex; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.LiveHashAddTransaction; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.Status; -import java.time.Duration; -import java.util.Objects; -import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java index d85f5c54ad..10b93fb0af 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LiveHashDeleteIntegrationTest.java @@ -3,14 +3,14 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; +import org.bouncycastle.util.encoders.Hex; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.LiveHashDeleteTransaction; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.Status; -import java.util.Objects; -import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java index 69fb1d5189..9908678452 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/LoadIntegrationTest.java @@ -3,13 +3,13 @@ import static org.junit.jupiter.api.Assertions.fail; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountId; import org.hiero.sdk.Client; import org.hiero.sdk.PrivateKey; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java index 7c8a27bfd8..5d02331670 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/MirrorNodeContractQueryIntegrationTest.java @@ -1,10 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk.test.integration; -import static org.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.hiero.sdk.EntityIdHelper.getEvmAddressFromMirrorNodeAsync; +import java.util.Objects; +import java.util.concurrent.ExecutionException; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.ContractCallQuery; import org.hiero.sdk.ContractCreateTransaction; @@ -18,8 +20,6 @@ import org.hiero.sdk.MirrorNodeContractCallQuery; import org.hiero.sdk.MirrorNodeContractEstimateGasQuery; import org.hiero.sdk.PrivateKey; -import java.util.Objects; -import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java index a9af439dbb..324f0cd459 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NftAllowancesIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.nio.charset.StandardCharsets; +import java.util.List; import org.hiero.sdk.AccountAllowanceApproveTransaction; import org.hiero.sdk.AccountAllowanceDeleteTransaction; import org.hiero.sdk.AccountCreateTransaction; @@ -20,8 +22,6 @@ import org.hiero.sdk.TokenType; import org.hiero.sdk.TransactionId; import org.hiero.sdk.TransferTransaction; -import java.nio.charset.StandardCharsets; -import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java index 62a7bd2092..c572a18fde 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/NodeCreateTransactionIntegrationTest.java @@ -3,15 +3,15 @@ import static org.hiero.sdk.test.integration.IntegrationTestEnv.LOCAL_CONSENSUS_NODE_ACCOUNT_ID; +import java.util.HashMap; +import java.util.List; +import org.bouncycastle.util.encoders.Hex; import org.hiero.sdk.AccountId; import org.hiero.sdk.Client; import org.hiero.sdk.Endpoint; import org.hiero.sdk.NodeCreateTransaction; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.PrivateKeyECDSA; -import java.util.HashMap; -import java.util.List; -import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java index b51ca14211..bb1893840b 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/ScheduleCreateIntegrationTest.java @@ -4,6 +4,11 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountDeleteTransaction; @@ -27,11 +32,6 @@ import org.hiero.sdk.TransactionReceipt; import org.hiero.sdk.TransactionResponse; import org.hiero.sdk.TransferTransaction; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.time.Instant; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java index be3a609b6e..f2846b71c0 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/SystemIntegrationTest.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.time.Instant; +import java.util.Objects; import org.hiero.sdk.ContractCreateTransaction; import org.hiero.sdk.ContractFunctionParameters; import org.hiero.sdk.FileCreateTransaction; @@ -10,8 +12,6 @@ import org.hiero.sdk.Status; import org.hiero.sdk.SystemDeleteTransaction; import org.hiero.sdk.SystemUndeleteTransaction; -import java.time.Instant; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java index de7aa6b6f5..13d71dd43a 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropCancelIntegrationTest.java @@ -1,12 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk.test.integration; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; -import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import java.util.ArrayList; +import java.util.Collections; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.PendingAirdropId; import org.hiero.sdk.PendingAirdropRecord; @@ -22,8 +24,6 @@ import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TokenPauseTransaction; import org.hiero.sdk.TransactionId; -import java.util.ArrayList; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java index 9605849d2f..96da7546bb 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropClaimIntegrationTest.java @@ -1,12 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk.test.integration; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import java.util.ArrayList; +import java.util.Collections; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.PendingAirdropId; import org.hiero.sdk.PendingAirdropRecord; @@ -21,8 +23,6 @@ import org.hiero.sdk.TokenFreezeTransaction; import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TokenPauseTransaction; -import java.util.ArrayList; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java index 89395143b1..715831b94f 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAirdropTransactionIntegrationTest.java @@ -1,14 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.sdk.test.integration; -import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; -import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.hiero.sdk.test.integration.EntityHelper.fungibleInitialBalance; +import static org.hiero.sdk.test.integration.EntityHelper.mitedNfts; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; +import java.util.Collections; import org.hiero.sdk.AccountAllowanceApproveTransaction; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.AccountCreateTransaction; @@ -26,7 +27,6 @@ import org.hiero.sdk.TokenSupplyType; import org.hiero.sdk.TransactionId; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java index c4936f074d..50da6d2339 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenAutomaticAssociationIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.ArrayList; import org.hiero.sdk.AccountAllowanceApproveTransaction; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.AccountCreateTransaction; @@ -14,7 +15,6 @@ import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TransactionId; import org.hiero.sdk.TransferTransaction; -import java.util.ArrayList; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java index 657c960c38..13d9a92919 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenBurnIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -16,8 +18,6 @@ import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TokenType; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java index b857216e55..580059e55e 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenCreateIntegrationTest.java @@ -3,6 +3,10 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; import org.hiero.sdk.AccountId; import org.hiero.sdk.CustomFee; import org.hiero.sdk.CustomFixedFee; @@ -15,10 +19,6 @@ import org.hiero.sdk.Status; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java index 4f47d9a54c..d035cacdd6 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDeleteIntegrationTest.java @@ -3,13 +3,13 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenDeleteTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java index bde8d07623..cfc1b588b4 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenDissociateIntegrationTest.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -12,8 +14,6 @@ import org.hiero.sdk.TokenAssociateTransaction; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenDissociateTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java index 9edcbf1ce7..ab2479c671 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFeeScheduleUpdateIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.ArrayList; +import java.util.Objects; import org.hiero.sdk.CustomFee; import org.hiero.sdk.CustomFixedFee; import org.hiero.sdk.CustomFractionalFee; @@ -13,8 +15,6 @@ import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenFeeScheduleUpdateTransaction; import org.hiero.sdk.TokenInfoQuery; -import java.util.ArrayList; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java index 3cfc8c2aac..4d49fb3692 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenFreezeIntegrationTest.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -12,8 +14,6 @@ import org.hiero.sdk.TokenAssociateTransaction; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenFreezeTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java index 82fe113239..9bee000db9 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenGrantKycIntegrationTest.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -12,8 +14,6 @@ import org.hiero.sdk.TokenAssociateTransaction; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenGrantKycTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java index 31ecabda76..7d12b8a269 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenInfoIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.Hbar; import org.hiero.sdk.MaxQueryPaymentExceededException; import org.hiero.sdk.PrecheckStatusException; @@ -14,7 +15,6 @@ import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TokenSupplyType; import org.hiero.sdk.TokenType; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java index 1cf28b8845..ce6391501e 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenManualAssociationIntegrationTest.java @@ -4,6 +4,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.AccountId; import org.hiero.sdk.AccountInfoQuery; @@ -16,9 +19,6 @@ import org.hiero.sdk.TokenAssociateTransaction; import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TransferTransaction; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java index 1e02d9840e..8982bd7fa5 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenMintIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -14,7 +15,6 @@ import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TokenSupplyType; import org.hiero.sdk.TokenType; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java index 7c18048530..22b91e42a4 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftInfoIntegrationTest.java @@ -4,6 +4,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; import org.hiero.sdk.NftId; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.Status; @@ -11,9 +14,6 @@ import org.hiero.sdk.TokenMintTransaction; import org.hiero.sdk.TokenNftInfoQuery; import org.hiero.sdk.TokenType; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java index 1ca3dc0ffe..c70904a559 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenNftTransferIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.ArrayList; +import java.util.Collections; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrivateKey; @@ -17,8 +19,6 @@ import org.hiero.sdk.TokenWipeTransaction; import org.hiero.sdk.TransactionResponse; import org.hiero.sdk.TransferTransaction; -import java.util.ArrayList; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java index 36bbd656a5..49305b45b5 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenPauseIntegrationTest.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.Collections; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -12,7 +13,6 @@ import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenPauseTransaction; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java index 1e40856e90..0db1e378a7 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectFlowIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.List; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.PrivateKey; import org.hiero.sdk.TokenAssociateTransaction; @@ -12,8 +14,6 @@ import org.hiero.sdk.TokenNftInfoQuery; import org.hiero.sdk.TokenRejectFlow; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; -import java.util.List; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java index 2d21714a4c..5c34888ac9 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRejectIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.List; import org.hiero.sdk.AccountAllowanceApproveTransaction; import org.hiero.sdk.AccountBalanceQuery; import org.hiero.sdk.AccountCreateTransaction; @@ -21,8 +23,6 @@ import org.hiero.sdk.TokenType; import org.hiero.sdk.TransactionId; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; -import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java index e74507f031..cc9c93e623 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenRevokeKycIntegrationTest.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -12,8 +14,6 @@ import org.hiero.sdk.TokenAssociateTransaction; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenRevokeKycTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java index 6d7acefb9c..2712f9cf57 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenTransferIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.CustomFixedFee; import org.hiero.sdk.Hbar; @@ -15,7 +16,6 @@ import org.hiero.sdk.TokenGrantKycTransaction; import org.hiero.sdk.TransactionResponse; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java index c314e829d1..467bba2815 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnfreezeIntegrationTest.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -12,8 +14,6 @@ import org.hiero.sdk.TokenAssociateTransaction; import org.hiero.sdk.TokenCreateTransaction; import org.hiero.sdk.TokenUnfreezeTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java index ea22223a9d..7f3588b98a 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUnpauseIntegrationTest.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.Collections; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountDeleteTransaction; import org.hiero.sdk.Hbar; @@ -14,7 +15,6 @@ import org.hiero.sdk.TokenUnpauseTransaction; import org.hiero.sdk.TokenWipeTransaction; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java index f984cb615e..e48adce5bc 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateIntegrationTest.java @@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.KeyList; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.PrivateKey; @@ -15,7 +16,6 @@ import org.hiero.sdk.TokenKeyValidation; import org.hiero.sdk.TokenType; import org.hiero.sdk.TokenUpdateTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java index eb742329ef..15f4251667 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenUpdateNftsIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.List; +import java.util.Objects; import org.hiero.sdk.Client; import org.hiero.sdk.NftId; import org.hiero.sdk.PrivateKey; @@ -16,8 +18,6 @@ import org.hiero.sdk.TokenNftInfoQuery; import org.hiero.sdk.TokenType; import org.hiero.sdk.TokenUpdateNftsTransaction; -import java.util.List; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java index 0977209219..f802a9312e 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TokenWipeIntegrationTest.java @@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Collections; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.Hbar; import org.hiero.sdk.PrecheckStatusException; @@ -17,8 +19,6 @@ import org.hiero.sdk.TokenType; import org.hiero.sdk.TokenWipeTransaction; import org.hiero.sdk.TransferTransaction; -import java.util.Collections; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java index 6bcfd9c98b..6ac12eec8b 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicCreateIntegrationTest.java @@ -3,9 +3,9 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.TopicCreateTransaction; import org.hiero.sdk.TopicDeleteTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java index ee51d6c7b8..1e90624d6e 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicDeleteIntegrationTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.ReceiptStatusException; import org.hiero.sdk.Status; import org.hiero.sdk.TopicCreateTransaction; import org.hiero.sdk.TopicDeleteTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java index 5adca3f407..41ba5d6ae5 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicInfoIntegrationTest.java @@ -4,13 +4,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import java.util.Objects; import org.hiero.sdk.Hbar; import org.hiero.sdk.MaxQueryPaymentExceededException; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.TopicCreateTransaction; import org.hiero.sdk.TopicDeleteTransaction; import org.hiero.sdk.TopicInfoQuery; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java index c9ca973e1d..eaabe3ff29 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageIntegrationTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.hiero.sdk.*; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; import java.util.Objects; +import org.hiero.sdk.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java index 048dc5f06c..43612a0378 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicMessageSubmitIntegrationTest.java @@ -5,6 +5,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatNoException; +import java.util.Objects; +import org.bouncycastle.util.encoders.Hex; import org.hiero.sdk.PrecheckStatusException; import org.hiero.sdk.Status; import org.hiero.sdk.TopicCreateTransaction; @@ -12,8 +14,6 @@ import org.hiero.sdk.TopicInfoQuery; import org.hiero.sdk.TopicMessageSubmitTransaction; import org.hiero.sdk.Transaction; -import java.util.Objects; -import org.bouncycastle.util.encoders.Hex; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java index 10101f9ba3..53b3d6f3c0 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TopicUpdateIntegrationTest.java @@ -3,11 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.Objects; import org.hiero.sdk.TopicCreateTransaction; import org.hiero.sdk.TopicDeleteTransaction; import org.hiero.sdk.TopicInfoQuery; import org.hiero.sdk.TopicUpdateTransaction; -import java.util.Objects; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java index 2fc7db3671..fef283dba0 100644 --- a/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/org/hiero/sdk/test/integration/TransactionIntegrationTest.java @@ -6,6 +6,8 @@ import static org.assertj.core.api.Assertions.assertThatNoException; import com.google.protobuf.ByteString; +import java.util.Arrays; +import java.util.Objects; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountDeleteTransaction; import org.hiero.sdk.AccountId; @@ -36,8 +38,6 @@ import org.hiero.sdk.proto.TransactionID; import org.hiero.sdk.proto.TransactionList; import org.hiero.sdk.proto.TransferList; -import java.util.Arrays; -import java.util.Objects; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/tck/src/main/java/org/hiero/tck/controller/JRPCController.java b/tck/src/main/java/org/hiero/tck/controller/JRPCController.java index 6fc9e098b3..434f55c822 100644 --- a/tck/src/main/java/org/hiero/tck/controller/JRPCController.java +++ b/tck/src/main/java/org/hiero/tck/controller/JRPCController.java @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.controller; -import org.hiero.tck.annotation.JSONRPC2Controller; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import jakarta.servlet.http.HttpServletRequest; +import org.hiero.tck.annotation.JSONRPC2Controller; import org.hiero.tck.util.JSONRPC2ServiceScanner; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java b/tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java index b584f358d7..6e805d4dd4 100644 --- a/tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java +++ b/tck/src/main/java/org/hiero/tck/methods/AbstractJSONRPC2Service.java @@ -3,12 +3,6 @@ import static org.hiero.tck.methods.JSONRPC2Error.HEDERA_ERROR; -import org.hiero.sdk.PrecheckStatusException; -import org.hiero.sdk.ReceiptStatusException; -import org.hiero.tck.annotation.JSONRPC2Method; -import org.hiero.tck.exception.InvalidJSONRPC2ParamsException; -import org.hiero.tck.exception.InvalidJSONRPC2RequestException; -import org.hiero.tck.methods.JSONRPC2Error.ErrorData; import com.thetransactioncompany.jsonrpc2.JSONRPC2Error; import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; @@ -20,6 +14,12 @@ import java.util.HashMap; import java.util.Map; import net.minidev.json.JSONObject; +import org.hiero.sdk.PrecheckStatusException; +import org.hiero.sdk.ReceiptStatusException; +import org.hiero.tck.annotation.JSONRPC2Method; +import org.hiero.tck.exception.InvalidJSONRPC2ParamsException; +import org.hiero.tck.exception.InvalidJSONRPC2RequestException; +import org.hiero.tck.methods.JSONRPC2Error.ErrorData; /** * Implements RequestHandler and overrides some of the Dispatcher logic, diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java index 1d6f8c0b9d..0280b00ab3 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/AccountService.java @@ -2,6 +2,8 @@ package org.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import java.time.Duration; +import java.time.Instant; import org.hiero.sdk.AccountCreateTransaction; import org.hiero.sdk.AccountDeleteTransaction; import org.hiero.sdk.AccountId; @@ -18,8 +20,6 @@ import org.hiero.tck.methods.sdk.param.AccountUpdateParams; import org.hiero.tck.methods.sdk.response.AccountResponse; import org.hiero.tck.util.KeyUtils; -import java.time.Duration; -import java.time.Instant; /** * AccountService for account related methods diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java index 13b4dcc114..584d8ea8f5 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/KeyService.java @@ -2,6 +2,7 @@ package org.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import org.bouncycastle.util.encoders.Hex; import org.hiero.sdk.Key; import org.hiero.sdk.KeyList; import org.hiero.sdk.PrivateKey; @@ -12,7 +13,6 @@ import org.hiero.tck.methods.AbstractJSONRPC2Service; import org.hiero.tck.methods.sdk.param.GenerateKeyParams; import org.hiero.tck.methods.sdk.response.GenerateKeyResponse; -import org.bouncycastle.util.encoders.Hex; import org.hiero.tck.util.KeyUtils; import org.hiero.tck.util.KeyUtils.KeyType; @@ -51,7 +51,8 @@ public GenerateKeyResponse generateKey(final GenerateKeyParams params) throws Ex "invalid request: keys list is required for generating a KeyList type."); } - if (params.getType().equals(KeyType.THRESHOLD_KEY) && params.getThreshold().isEmpty()) { + if (params.getType().equals(KeyType.THRESHOLD_KEY) + && params.getThreshold().isEmpty()) { throw new InvalidJSONRPC2RequestException( "invalid request: threshold is required for generating a ThresholdKey type."); } @@ -110,7 +111,8 @@ private String processKeyRecursively( case EVM_ADDRESS_KEY: if (params.getFromKey().isPresent()) { - Key hederaKey = KeyUtils.getKeyFromString(params.getFromKey().get()); + Key hederaKey = + KeyUtils.getKeyFromString(params.getFromKey().get()); if (hederaKey instanceof PrivateKey pk) { return pk.getPublicKey().toEvmAddress().toString(); } else if (hederaKey instanceof PublicKey pk) { diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java index d6615547b9..84f069a0d3 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/SdkService.java @@ -1,6 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; import org.hiero.sdk.AccountId; import org.hiero.sdk.Client; import org.hiero.sdk.PrivateKey; @@ -9,10 +13,6 @@ import org.hiero.tck.methods.AbstractJSONRPC2Service; import org.hiero.tck.methods.sdk.param.SetupParams; import org.hiero.tck.methods.sdk.response.SetupResponse; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Executors; /** * SdkService for managing the {@link Client} setup and reset diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java b/tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java index f29e37bf88..2a3e42763c 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/TokenService.java @@ -2,6 +2,9 @@ package org.hiero.tck.methods.sdk; import com.google.protobuf.InvalidProtocolBufferException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; import org.hiero.sdk.AccountId; import org.hiero.sdk.CustomFixedFee; import org.hiero.sdk.CustomFractionalFee; @@ -22,9 +25,6 @@ import org.hiero.tck.methods.sdk.param.TokenUpdateParams; import org.hiero.tck.methods.sdk.response.TokenResponse; import org.hiero.tck.util.KeyUtils; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; /** * TokenService for token related methods diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java index 3b4b977a05..b99c9c7a20 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountCreateParams.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; /** * AccountCreateParams for account create method diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java index adc8c7eaa6..f3770f2d17 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountDeleteParams.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; /** * AccountDeleteParams for account delete method diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java index 3c7467c448..381cd411a6 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/AccountUpdateParams.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; /** * AccountUpdateParams for account update method diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java index 86fd9ce9b9..a9d005fab9 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CommonTransactionParams.java @@ -1,11 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.sdk.Client; -import org.hiero.sdk.Hbar; -import org.hiero.sdk.PrivateKey; -import org.hiero.sdk.Transaction; -import org.hiero.sdk.TransactionId; import java.time.Duration; import java.util.List; import java.util.Map; @@ -15,6 +10,11 @@ import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONArray; +import org.hiero.sdk.Client; +import org.hiero.sdk.Hbar; +import org.hiero.sdk.PrivateKey; +import org.hiero.sdk.Transaction; +import org.hiero.sdk.TransactionId; /** * CommonTransactionParams diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java index 9a124f39cc..13ddae55b0 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/CustomFee.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; @Getter @AllArgsConstructor diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java index 237921e31f..dce8179358 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/GenerateKeyParams.java @@ -1,8 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; -import org.hiero.tck.util.KeyUtils.KeyType; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -12,6 +10,8 @@ import lombok.NoArgsConstructor; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; +import org.hiero.tck.util.KeyUtils.KeyType; @SuppressWarnings("OptionalUsedAsFieldOrParameterType") @Getter diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java index 4f3e5eb04e..9d62568be8 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/SetupParams.java @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hiero.tck.methods.JSONRPC2Param; /** * SetupParams for SDK client diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java index 10c5756b78..c0025653a7 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenCreateParams.java @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -11,6 +10,7 @@ import lombok.NoArgsConstructor; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; /** * TokenCreateParams for token create method diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java index 6cceea5300..b8fc459bff 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenDeleteParams.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; /** * TokenDeleteParams for token delete method diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java index efd51f9fb6..745ff30e13 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/param/TokenUpdateParams.java @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.param; -import org.hiero.tck.methods.JSONRPC2Param; import java.util.Map; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import net.minidev.json.JSONObject; +import org.hiero.tck.methods.JSONRPC2Param; /** * TokenUpdateParams for token update method diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java b/tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java index f083102177..b2eef2f95d 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/response/AccountResponse.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.response; -import org.hiero.sdk.Status; import lombok.Data; +import org.hiero.sdk.Status; @Data public class AccountResponse { diff --git a/tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java b/tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java index 8353550843..6dfc12013f 100644 --- a/tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java +++ b/tck/src/main/java/org/hiero/tck/methods/sdk/response/TokenResponse.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.methods.sdk.response; -import org.hiero.sdk.Status; import lombok.Data; +import org.hiero.sdk.Status; @Data public class TokenResponse { diff --git a/tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java b/tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java index 38d624aa98..1d2585d299 100644 --- a/tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java +++ b/tck/src/main/java/org/hiero/tck/util/JSONRPC2ServiceScanner.java @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 package org.hiero.tck.util; -import org.hiero.tck.annotation.JSONRPC2Service; import com.thetransactioncompany.jsonrpc2.server.*; +import org.hiero.tck.annotation.JSONRPC2Service; import org.springframework.context.ApplicationContext; /** diff --git a/tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java b/tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java index 2a3ac2b0f0..2a0f9a31c2 100644 --- a/tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java +++ b/tck/src/test/java/org/hiero/tck/controller/JRPCControllerTest.java @@ -11,7 +11,6 @@ import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; import com.thetransactioncompany.jsonrpc2.server.Dispatcher; import jakarta.servlet.http.HttpServletRequest; -import org.hiero.tck.controller.JRPCController; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java b/tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java index debcf765b4..9a2cc61f46 100644 --- a/tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java +++ b/tck/src/test/java/org/hiero/tck/controller/JRPCInterceptorTest.java @@ -9,7 +9,6 @@ import jakarta.servlet.http.HttpServletResponse; import java.io.BufferedReader; import java.io.StringReader; -import org.hiero.tck.controller.JRPCInterceptor; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java index 1895880dd9..287796d045 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/KeyServiceTest.java @@ -4,11 +4,11 @@ import static org.hiero.tck.util.KeyUtils.KeyType.*; import static org.junit.jupiter.api.Assertions.*; +import java.util.Collections; +import java.util.Optional; import org.hiero.tck.exception.InvalidJSONRPC2RequestException; import org.hiero.tck.methods.sdk.param.GenerateKeyParams; import org.hiero.tck.methods.sdk.response.GenerateKeyResponse; -import java.util.Collections; -import java.util.Optional; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java index e9454ad8fe..38593b8b6f 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/SdkServiceTest.java @@ -5,10 +5,9 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.hiero.tck.methods.sdk.SdkService; +import java.util.Optional; import org.hiero.tck.methods.sdk.param.SetupParams; import org.hiero.tck.methods.sdk.response.SetupResponse; -import java.util.Optional; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java index 302eb01f15..ee0d8eda00 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/AccountCreateParamsTest.java @@ -9,8 +9,6 @@ import java.util.Optional; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; -import org.hiero.tck.methods.sdk.param.AccountCreateParams; -import org.hiero.tck.methods.sdk.param.CommonTransactionParams; import org.junit.jupiter.api.Test; class AccountCreateParamsTest { diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java index 939580a1a8..64528d99a2 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/CommonTransactionParamsTest.java @@ -8,7 +8,6 @@ import java.util.Map; import java.util.Optional; import net.minidev.json.JSONArray; -import org.hiero.tck.methods.sdk.param.CommonTransactionParams; import org.junit.jupiter.api.Test; class CommonTransactionParamsTest { diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java index 8527939073..8a3776f391 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/GenerateKeyParamsTest.java @@ -3,13 +3,12 @@ import static org.junit.jupiter.api.Assertions.*; -import org.hiero.tck.methods.sdk.param.GenerateKeyParams; -import org.hiero.tck.util.KeyUtils.KeyType; import java.util.HashMap; import java.util.Map; import java.util.Optional; import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; +import org.hiero.tck.util.KeyUtils.KeyType; import org.junit.jupiter.api.Test; class GenerateKeyParamsTest { diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java index 56b78df897..e56e6a0782 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/param/SetupParamsTest.java @@ -6,7 +6,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.hiero.tck.methods.sdk.param.SetupParams; import org.junit.jupiter.api.Test; class SetupParamsTest { diff --git a/tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java b/tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java index e0c491ec66..018ce388d8 100644 --- a/tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java +++ b/tck/src/test/java/org/hiero/tck/methods/sdk/response/SetupResponseTest.java @@ -4,7 +4,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.hiero.tck.methods.sdk.response.SetupResponse; import org.junit.jupiter.api.Test; class SetupResponseTest { From 6c81d159dd692ce2518ef0e9caf041c71f4e0c21 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 17:35:57 +0200 Subject: [PATCH 10/15] chore: change licenses Signed-off-by: Ivan Ivanov --- example-android/app/build.gradle.kts | 20 +------------------ .../hedera/android_example/MainActivity.kt | 20 +------------------ .../ui/main/AccountBalanceFragment.kt | 20 +------------------ .../ui/main/CryptoTransferFragment.kt | 20 +------------------ .../ui/main/PrivateKeyFragment.kt | 20 +------------------ .../ui/main/SectionsPagerAdapter.kt | 20 +------------------ example-android/build.gradle.kts | 20 +------------------ example-android/settings.gradle.kts | 20 +------------------ .../sdk/examples/ContractHelper.java | 20 +------------------ .../examples/SolidityPrecompileExample.java | 20 +------------------ examples/src/main/java/module-info.java | 20 +------------------ sdk/src/main/java/module-info.java | 20 +------------------ 12 files changed, 12 insertions(+), 228 deletions(-) diff --git a/example-android/app/build.gradle.kts b/example-android/app/build.gradle.kts index afca29380e..fc46e3df53 100644 --- a/example-android/app/build.gradle.kts +++ b/example-android/app/build.gradle.kts @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 plugins { id("com.android.application") diff --git a/example-android/app/src/main/java/com/hedera/android_example/MainActivity.kt b/example-android/app/src/main/java/com/hedera/android_example/MainActivity.kt index b367b12886..64c81df301 100644 --- a/example-android/app/src/main/java/com/hedera/android_example/MainActivity.kt +++ b/example-android/app/src/main/java/com/hedera/android_example/MainActivity.kt @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.android_example import android.os.Bundle diff --git a/example-android/app/src/main/java/com/hedera/android_example/ui/main/AccountBalanceFragment.kt b/example-android/app/src/main/java/com/hedera/android_example/ui/main/AccountBalanceFragment.kt index d872270144..ced61c3ddd 100644 --- a/example-android/app/src/main/java/com/hedera/android_example/ui/main/AccountBalanceFragment.kt +++ b/example-android/app/src/main/java/com/hedera/android_example/ui/main/AccountBalanceFragment.kt @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.android_example.ui.main import android.os.Bundle diff --git a/example-android/app/src/main/java/com/hedera/android_example/ui/main/CryptoTransferFragment.kt b/example-android/app/src/main/java/com/hedera/android_example/ui/main/CryptoTransferFragment.kt index b2b08de330..d5916527cb 100644 --- a/example-android/app/src/main/java/com/hedera/android_example/ui/main/CryptoTransferFragment.kt +++ b/example-android/app/src/main/java/com/hedera/android_example/ui/main/CryptoTransferFragment.kt @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.android_example.ui.main import android.os.Bundle diff --git a/example-android/app/src/main/java/com/hedera/android_example/ui/main/PrivateKeyFragment.kt b/example-android/app/src/main/java/com/hedera/android_example/ui/main/PrivateKeyFragment.kt index b3153f97e8..73d443816a 100644 --- a/example-android/app/src/main/java/com/hedera/android_example/ui/main/PrivateKeyFragment.kt +++ b/example-android/app/src/main/java/com/hedera/android_example/ui/main/PrivateKeyFragment.kt @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.android_example.ui.main import android.widget.TextView diff --git a/example-android/app/src/main/java/com/hedera/android_example/ui/main/SectionsPagerAdapter.kt b/example-android/app/src/main/java/com/hedera/android_example/ui/main/SectionsPagerAdapter.kt index 90dc07fee1..1a13004187 100644 --- a/example-android/app/src/main/java/com/hedera/android_example/ui/main/SectionsPagerAdapter.kt +++ b/example-android/app/src/main/java/com/hedera/android_example/ui/main/SectionsPagerAdapter.kt @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.android_example.ui.main import androidx.fragment.app.FragmentActivity diff --git a/example-android/build.gradle.kts b/example-android/build.gradle.kts index 6c77d9a899..2ef81a7325 100644 --- a/example-android/build.gradle.kts +++ b/example-android/build.gradle.kts @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 plugins { id("com.android.application") version "8.2.2" apply false diff --git a/example-android/settings.gradle.kts b/example-android/settings.gradle.kts index 06a0497537..dd9df81581 100644 --- a/example-android/settings.gradle.kts +++ b/example-android/settings.gradle.kts @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 pluginManagement { repositories { diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java index 931cdbc3f0..24404704ab 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.hashgraph.sdk.examples; import com.google.gson.Gson; diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java index 54c762abdc..1840b90a04 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2022 - 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 package com.hedera.hashgraph.sdk.examples; import com.hedera.hashgraph.sdk.*; diff --git a/examples/src/main/java/module-info.java b/examples/src/main/java/module-info.java index 7242d5b8cf..858487390a 100644 --- a/examples/src/main/java/module-info.java +++ b/examples/src/main/java/module-info.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 module com.hedera.hashgraph.examples { requires com.hedera.hashgraph.sdk; // .full; diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java index a5ca83e2cf..6c62636fb0 100644 --- a/sdk/src/main/java/module-info.java +++ b/sdk/src/main/java/module-info.java @@ -1,22 +1,4 @@ -/*- - * - * Hedera Java SDK - * - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * 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. - * - */ +// SPDX-License-Identifier: Apache-2.0 module org.hiero.sdk { requires transitive com.google.protobuf; From acb11df2d1e5b73c14310f8d07d52743a6bcb960 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 16 Dec 2024 17:47:21 +0200 Subject: [PATCH 11/15] spotlessApply examples Signed-off-by: Ivan Ivanov --- .../sdk/examples/ContractHelper.java | 89 ++++++------ .../examples/SolidityPrecompileExample.java | 127 +++++++++--------- 2 files changed, 107 insertions(+), 109 deletions(-) diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java index 24404704ab..965eb854a4 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractHelper.java @@ -18,9 +18,7 @@ import com.hedera.hashgraph.sdk.Status; import com.hedera.hashgraph.sdk.TransactionId; import com.hedera.hashgraph.sdk.TransactionRecord; - import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.StandardCharsets; @@ -30,7 +28,6 @@ import java.util.function.Function; import java.util.function.Supplier; - /* ContractHelper declutters PrecompileExample.java @@ -60,13 +57,14 @@ public class ContractHelper { public static String getBytecodeHex(String filename) throws IOException { try (Reader reader = new InputStreamReader( - Optional.ofNullable(ContractHelper.class.getResourceAsStream(filename)) - .orElseThrow(() -> new RuntimeException("Failed to find: " + filename)), - StandardCharsets.UTF_8)) { + Optional.ofNullable(ContractHelper.class.getResourceAsStream(filename)) + .orElseThrow(() -> new RuntimeException("Failed to find: " + filename)), + StandardCharsets.UTF_8)) { JsonObject json = new Gson().fromJson(reader, JsonObject.class); - JsonElement bytecodeElement = Optional.ofNullable(json.has("object") ? json.get("object") : json.get("bytecode")) - .orElseThrow(() -> new RuntimeException("No bytecode or object found in json.")); + JsonElement bytecodeElement = Optional.ofNullable( + json.has("object") ? json.get("object") : json.get("bytecode")) + .orElseThrow(() -> new RuntimeException("No bytecode or object found in json.")); if (bytecodeElement.isJsonObject()) { bytecodeElement = bytecodeElement.getAsJsonObject().get("object"); @@ -75,22 +73,20 @@ public static String getBytecodeHex(String filename) throws IOException { } } - public ContractHelper( - String filename, - ContractFunctionParameters constructorParameters, - Client client - ) throws PrecheckStatusException, TimeoutException, ReceiptStatusException, IOException { + public ContractHelper(String filename, ContractFunctionParameters constructorParameters, Client client) + throws PrecheckStatusException, TimeoutException, ReceiptStatusException, IOException { contractId = Objects.requireNonNull(new ContractCreateFlow() - .setBytecode(getBytecodeHex(filename)) - .setMaxChunks(30) - .setGas(8_000_000) - .setConstructorParameters(constructorParameters) - .execute(client) - .getReceipt(client) - .contractId); + .setBytecode(getBytecodeHex(filename)) + .setMaxChunks(30) + .setGas(8_000_000) + .setConstructorParameters(constructorParameters) + .execute(client) + .getReceipt(client) + .contractId); } - public ContractHelper setResultValidatorForStep(int stepIndex, Function validator) { + public ContractHelper setResultValidatorForStep( + int stepIndex, Function validator) { stepResultValidators.put(stepIndex, validator); return this; } @@ -128,17 +124,17 @@ public ContractHelper setStepLogic(int stepIndex, Consumer stepLogic) { private Function getResultValidator(int stepIndex) { return stepResultValidators.getOrDefault( - stepIndex, - // if no custom validator is given, assume that the step returns a response code which ought to be SUCCESS - contractFunctionResult -> { - Status responseStatus = Status.fromResponseCode(contractFunctionResult.getInt32(0)); - boolean isValid = responseStatus == Status.SUCCESS; - if (!isValid) { - System.out.println("Encountered invalid response status " + responseStatus); - } - return isValid; - } - ); + stepIndex, + // if no custom validator is given, assume that the step returns a response code which ought to be + // SUCCESS + contractFunctionResult -> { + Status responseStatus = Status.fromResponseCode(contractFunctionResult.getInt32(0)); + boolean isValid = responseStatus == Status.SUCCESS; + if (!isValid) { + System.out.println("Encountered invalid response status " + responseStatus); + } + return isValid; + }); } private Supplier getParameterSupplier(int stepIndex) { @@ -153,16 +149,11 @@ private List getSigners(int stepIndex) { return stepSigners.getOrDefault(stepIndex, Collections.emptyList()); } - public ContractHelper executeSteps( - int firstStepToExecute, - int lastStepToExecute, - Client client - ) throws Exception { + public ContractHelper executeSteps(int firstStepToExecute, int lastStepToExecute, Client client) throws Exception { for (int stepIndex = firstStepToExecute; stepIndex <= lastStepToExecute; stepIndex++) { System.out.println("Attempting to execute step " + stepIndex); - ContractExecuteTransaction tx = new ContractExecuteTransaction() - .setContractId(contractId) - .setGas(10_000_000); + ContractExecuteTransaction tx = + new ContractExecuteTransaction().setContractId(contractId).setGas(10_000_000); Hbar payableAmount = getPayableAmount(stepIndex); if (payableAmount != null) { @@ -170,7 +161,8 @@ public ContractHelper executeSteps( } String functionName = "step" + stepIndex; - ContractFunctionParameters parameters = getParameterSupplier(stepIndex).get(); + ContractFunctionParameters parameters = + getParameterSupplier(stepIndex).get(); if (parameters != null) { tx.setFunction(functionName, parameters); } else { @@ -187,14 +179,13 @@ public ContractHelper executeSteps( tx.sign(signer); } - TransactionRecord record = tx - .execute(client) - .setValidateStatus(false) - .getRecord(client); + TransactionRecord record = + tx.execute(client).setValidateStatus(false).getRecord(client); try { if (record.receipt.status != Status.SUCCESS) { - throw new Exception("transaction receipt yielded unsuccessful response code " + record.receipt.status); + throw new Exception( + "transaction receipt yielded unsuccessful response code " + record.receipt.status); } ContractFunctionResult functionResult = Objects.requireNonNull(record.contractFunctionResult); @@ -206,12 +197,14 @@ public ContractHelper executeSteps( } if (getResultValidator(stepIndex).apply(functionResult)) { - System.out.println("step " + stepIndex + " completed, and returned valid result. (TransactionId \"" + record.transactionId + "\")"); + System.out.println("step " + stepIndex + " completed, and returned valid result. (TransactionId \"" + + record.transactionId + "\")"); } else { throw new Exception("returned invalid result"); } } catch (Throwable error) { - throw new Exception("Error occurred in step " + stepIndex + ": " + error.getMessage() + "\n" + "Transaction record: " + record); + throw new Exception("Error occurred in step " + stepIndex + ": " + error.getMessage() + "\n" + + "Transaction record: " + record); } // otherwise will meet local-node throttle diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java index 1840b90a04..4d380acb74 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java @@ -3,7 +3,6 @@ import com.hedera.hashgraph.sdk.*; import io.github.cdimascio.dotenv.Dotenv; - import java.util.Arrays; import java.util.Objects; import java.util.function.Consumer; @@ -25,13 +24,14 @@ public class SolidityPrecompileExample { // see `.env.sample` in the repository root for how to specify these values // or set environment variables with the same names - private static final AccountId OPERATOR_ID = AccountId.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_ID"))); - private static final PrivateKey OPERATOR_KEY = PrivateKey.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_KEY"))); + private static final AccountId OPERATOR_ID = + AccountId.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_ID"))); + private static final PrivateKey OPERATOR_KEY = + PrivateKey.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_KEY"))); // HEDERA_NETWORK defaults to testnet if not specified in dotenv private static final String HEDERA_NETWORK = Dotenv.load().get("HEDERA_NETWORK", "testnet"); - private SolidityPrecompileExample() { - } + private SolidityPrecompileExample() {} public static void main(String[] args) throws Exception { Client client = ClientHelper.forName(HEDERA_NETWORK); @@ -44,48 +44,49 @@ public static void main(String[] args) throws Exception { PrivateKey alicePrivateKey = PrivateKey.generateED25519(); PublicKey alicePublicKey = alicePrivateKey.getPublicKey(); AccountId aliceAccountId = Objects.requireNonNull(new AccountCreateTransaction() - .setKey(alicePublicKey) - .setInitialBalance(Hbar.fromTinybars(1000)) - .execute(client) - .getReceipt(client) - .accountId - ); + .setKey(alicePublicKey) + .setInitialBalance(Hbar.fromTinybars(1000)) + .execute(client) + .getReceipt(client) + .accountId); // Instantiate ContractHelper ContractHelper contractHelper = new ContractHelper( - "contracts/precompile/PrecompileExample.json", - new ContractFunctionParameters() - .addAddress(OPERATOR_ID.toSolidityAddress()) - .addAddress(aliceAccountId.toSolidityAddress()), - client - ); + "contracts/precompile/PrecompileExample.json", + new ContractFunctionParameters() + .addAddress(OPERATOR_ID.toSolidityAddress()) + .addAddress(aliceAccountId.toSolidityAddress()), + client); // Update the signer to have contractId KeyList (this is by security requirement) new AccountUpdateTransaction() - .setAccountId(OPERATOR_ID) - .setKey(KeyList.of(OPERATOR_KEY.getPublicKey(), contractHelper.contractId).setThreshold(1)) - .execute(client) - .getReceipt(client); + .setAccountId(OPERATOR_ID) + .setKey(KeyList.of(OPERATOR_KEY.getPublicKey(), contractHelper.contractId) + .setThreshold(1)) + .execute(client) + .getReceipt(client); // Update the Alice account to have contractId KeyList (this is by security requirement) new AccountUpdateTransaction() - .setAccountId(aliceAccountId) - .setKey(KeyList.of(alicePublicKey, contractHelper.contractId).setThreshold(1)) - .freezeWith(client) - .sign(alicePrivateKey) - .execute(client) - .getReceipt(client); + .setAccountId(aliceAccountId) + .setKey(KeyList.of(alicePublicKey, contractHelper.contractId).setThreshold(1)) + .freezeWith(client) + .sign(alicePrivateKey) + .execute(client) + .getReceipt(client); Consumer additionalLogic = tokenAddress -> { try { var tokenUpdateTransactionReceipt = new TokenUpdateTransaction() - .setTokenId(TokenId.fromSolidityAddress(tokenAddress)) - .setAdminKey(KeyList.of(OPERATOR_KEY.getPublicKey(), contractHelper.contractId).setThreshold(1)) - .setSupplyKey(KeyList.of(OPERATOR_KEY.getPublicKey(), contractHelper.contractId).setThreshold(1)) - .freezeWith(client) - .sign(alicePrivateKey) - .execute(client) - .getReceipt(client); + .setTokenId(TokenId.fromSolidityAddress(tokenAddress)) + .setAdminKey(KeyList.of(OPERATOR_KEY.getPublicKey(), contractHelper.contractId) + .setThreshold(1)) + .setSupplyKey(KeyList.of(OPERATOR_KEY.getPublicKey(), contractHelper.contractId) + .setThreshold(1)) + .freezeWith(client) + .sign(alicePrivateKey) + .execute(client) + .getReceipt(client); System.out.println("Status of Token Update Transaction: " + tokenUpdateTransactionReceipt.status); } catch (Exception e) { @@ -95,39 +96,43 @@ public static void main(String[] args) throws Exception { // Configure steps in ContractHelper contractHelper - .setResultValidatorForStep(0, contractFunctionResult -> { - System.out.println("getPseudoRandomSeed() returned " + Arrays.toString(contractFunctionResult.getBytes32(0))); - return true; - }).setPayableAmountForStep(1, Hbar.from(20)) - // step 3 associates Alice with the token, which requires Alice's signature - .addSignerForStep(3, alicePrivateKey) - .addSignerForStep(5, alicePrivateKey) - .setParameterSupplierForStep(11, () -> { - return new ContractFunctionParameters() - // when contracts work with a public key, they handle the raw bytes of the public key - .addBytes(alicePublicKey.toBytesRaw()); - }).setPayableAmountForStep(11, Hbar.from(40)) - // Because we're setting the adminKey for the created NFT token to Alice's key, - // Alice must sign the ContractExecuteTransaction. - .addSignerForStep(11, alicePrivateKey) - .setStepLogic(11, additionalLogic) - // and Alice must sign for minting because her key is the supply key. - .addSignerForStep(12, alicePrivateKey) - .setParameterSupplierForStep(12, () -> { - return new ContractFunctionParameters() - // add three metadatas - .addBytesArray(new byte[][]{new byte[]{0x01b}, new byte[]{0x02b}, new byte[]{0x03b}}); - }) // and alice must sign to become associated with the token. - .addSignerForStep(13, alicePrivateKey) - // Alice must sign to burn the token because her key is the supply key - .addSignerForStep(16, alicePrivateKey); + .setResultValidatorForStep(0, contractFunctionResult -> { + System.out.println( + "getPseudoRandomSeed() returned " + Arrays.toString(contractFunctionResult.getBytes32(0))); + return true; + }) + .setPayableAmountForStep(1, Hbar.from(20)) + // step 3 associates Alice with the token, which requires Alice's signature + .addSignerForStep(3, alicePrivateKey) + .addSignerForStep(5, alicePrivateKey) + .setParameterSupplierForStep(11, () -> { + return new ContractFunctionParameters() + // when contracts work with a public key, they handle the raw bytes of the public key + .addBytes(alicePublicKey.toBytesRaw()); + }) + .setPayableAmountForStep(11, Hbar.from(40)) + // Because we're setting the adminKey for the created NFT token to Alice's key, + // Alice must sign the ContractExecuteTransaction. + .addSignerForStep(11, alicePrivateKey) + .setStepLogic(11, additionalLogic) + // and Alice must sign for minting because her key is the supply key. + .addSignerForStep(12, alicePrivateKey) + .setParameterSupplierForStep(12, () -> { + return new ContractFunctionParameters() + // add three metadatas + .addBytesArray(new byte[][] {new byte[] {0x01b}, new byte[] {0x02b}, new byte[] {0x03b}}); + }) // and alice must sign to become associated with the token. + .addSignerForStep(13, alicePrivateKey) + // Alice must sign to burn the token because her key is the supply key + .addSignerForStep(16, alicePrivateKey); // step 0 tests pseudo random number generator (PRNG) // step 1 creates a fungible token // step 2 mints it // step 3 associates Alice with it // step 4 transfers it to Alice. - // step 5 approves an allowance of the fungible token with operator as the owner and Alice as the spender [NOT WORKING] + // step 5 approves an allowance of the fungible token with operator as the owner and Alice as the spender [NOT + // WORKING] // steps 6 - 10 test misc functions on the fungible token (see PrecompileExample.sol for details). // step 11 creates an NFT token with a custom fee, and with the admin and supply set to Alice's key // step 12 mints some NFTs From 59eae978d1a677c0f7c49022f61f8109bbd20604 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 17 Dec 2024 09:53:32 +0200 Subject: [PATCH 12/15] chore: disable cache for unit/integration tests Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 2 +- .github/workflows/disabled/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac499fdd6b..ce1174f2ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: OPERATOR_ID: '0.0.1022' HEDERA_NETWORK: 'localhost' run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport --scan + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport --scan --rerun-tasks - name: Upload coverage to Codecov if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }} diff --git a/.github/workflows/disabled/main.yml b/.github/workflows/disabled/main.yml index 7d9d543458..981878d674 100644 --- a/.github/workflows/disabled/main.yml +++ b/.github/workflows/disabled/main.yml @@ -68,4 +68,4 @@ jobs: cd hedera-services docker-compose up & cd ../hedera-sdk-java - ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID jacocoTestReport + ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID testIntegration From 2a3a076d9f952a3ffa02e86a6559a1e536f1f1b0 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 17 Dec 2024 10:21:40 +0200 Subject: [PATCH 13/15] chore: address PR comments Signed-off-by: Ivan Ivanov --- .github/workflows/build.yml | 2 +- tck/build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce1174f2ed..ac499fdd6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,7 +101,7 @@ jobs: OPERATOR_ID: '0.0.1022' HEDERA_NETWORK: 'localhost' run: | - ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport --scan --rerun-tasks + ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport --scan - name: Upload coverage to Codecov if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }} diff --git a/tck/build.gradle.kts b/tck/build.gradle.kts index eb3417f2d5..df8ce3ed29 100644 --- a/tck/build.gradle.kts +++ b/tck/build.gradle.kts @@ -41,6 +41,7 @@ dependencies { implementation("org.springframework:spring-context") implementation("org.springframework:spring-web") implementation("org.springframework:spring-webmvc") + runtimeOnly("io.grpc:grpc-netty-shaded") runtimeOnly("org.springframework.boot:spring-boot-starter-web") compileOnly("org.projectlombok:lombok") @@ -62,7 +63,6 @@ dependencyAnalysis { onAny { severity("fail") exclude("com.google.protobuf:protobuf-javalite") - onUnusedDependencies { exclude(":sdk") } } } } From 3752cbe769bb54781c302b1fad8cff1dc1dd6c1a Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 17 Dec 2024 11:06:31 +0200 Subject: [PATCH 14/15] chore: add onUnusedDependencies Signed-off-by: Ivan Ivanov --- tck/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/tck/build.gradle.kts b/tck/build.gradle.kts index df8ce3ed29..8f4d066a9e 100644 --- a/tck/build.gradle.kts +++ b/tck/build.gradle.kts @@ -63,6 +63,7 @@ dependencyAnalysis { onAny { severity("fail") exclude("com.google.protobuf:protobuf-javalite") + onUnusedDependencies { exclude(":sdk") } } } } From a558440b4b902e8ac23069d760ac8c5ad15bb101 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Tue, 17 Dec 2024 19:06:25 +0200 Subject: [PATCH 15/15] chore: change remaining of .proto files to hiero Signed-off-by: Ivan Ivanov --- sdk/src/main/proto/block_stream_info.proto | 2 +- sdk/src/main/proto/ledger_id.proto | 2 +- sdk/src/main/proto/node.proto | 2 +- sdk/src/main/proto/node_create.proto | 2 +- sdk/src/main/proto/node_delete.proto | 2 +- sdk/src/main/proto/node_update.proto | 2 +- sdk/src/main/proto/roster.proto | 2 +- sdk/src/main/proto/roster_state.proto | 2 +- .../main/proto/schedulable_transaction_body.proto | 6 +++--- sdk/src/main/proto/transaction_body.proto | 12 ++++++------ sdk/src/main/proto/tss_message.proto | 4 ++-- sdk/src/main/proto/tss_message_map_key.proto | 4 ++-- sdk/src/main/proto/tss_share_signature.proto | 4 ++-- sdk/src/main/proto/tss_vote.proto | 4 ++-- sdk/src/main/proto/tss_vote_map_key.proto | 4 ++-- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sdk/src/main/proto/block_stream_info.proto b/sdk/src/main/proto/block_stream_info.proto index 57751a3ee2..889595f3f5 100644 --- a/sdk/src/main/proto/block_stream_info.proto +++ b/sdk/src/main/proto/block_stream_info.proto @@ -12,7 +12,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.node.state.blockstream; +package org.hiero.hapi.node.state.blockstream; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/ledger_id.proto b/sdk/src/main/proto/ledger_id.proto index de11594d28..cb633e9a2d 100644 --- a/sdk/src/main/proto/ledger_id.proto +++ b/sdk/src/main/proto/ledger_id.proto @@ -15,7 +15,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.node.state.roster; +package org.hiero.hapi.node.state.roster; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/node.proto b/sdk/src/main/proto/node.proto index 161233eab5..1eedc792b4 100644 --- a/sdk/src/main/proto/node.proto +++ b/sdk/src/main/proto/node.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package com.hedera.hapi.node.state.addressbook; +package org.hiero.hapi.node.state.addressbook; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/node_create.proto b/sdk/src/main/proto/node_create.proto index 3080b7923a..f3181dfaad 100644 --- a/sdk/src/main/proto/node_create.proto +++ b/sdk/src/main/proto/node_create.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package com.hedera.hapi.node.addressbook; +package org.hiero.hapi.node.addressbook; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/node_delete.proto b/sdk/src/main/proto/node_delete.proto index 73280b8b5b..08bd893265 100644 --- a/sdk/src/main/proto/node_delete.proto +++ b/sdk/src/main/proto/node_delete.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package com.hedera.hapi.node.addressbook; +package org.hiero.hapi.node.addressbook; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/node_update.proto b/sdk/src/main/proto/node_update.proto index 201f42effc..15a65cc562 100644 --- a/sdk/src/main/proto/node_update.proto +++ b/sdk/src/main/proto/node_update.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package com.hedera.hapi.node.addressbook; +package org.hiero.hapi.node.addressbook; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/roster.proto b/sdk/src/main/proto/roster.proto index 587c9d18fa..bc8b2fc0dc 100644 --- a/sdk/src/main/proto/roster.proto +++ b/sdk/src/main/proto/roster.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package com.hedera.hapi.node.state.roster; +package org.hiero.hapi.node.state.roster; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/roster_state.proto b/sdk/src/main/proto/roster_state.proto index bb63f949ae..40e9e83d8b 100644 --- a/sdk/src/main/proto/roster_state.proto +++ b/sdk/src/main/proto/roster_state.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package com.hedera.hapi.node.state.roster; +package org.hiero.hapi.node.state.roster; /* * Copyright (C) 2024 Hedera Hashgraph, LLC diff --git a/sdk/src/main/proto/schedulable_transaction_body.proto b/sdk/src/main/proto/schedulable_transaction_body.proto index c2d38b2e27..7ab64b7807 100644 --- a/sdk/src/main/proto/schedulable_transaction_body.proto +++ b/sdk/src/main/proto/schedulable_transaction_body.proto @@ -297,17 +297,17 @@ message SchedulableTransactionBody { /** * Transaction body for a scheduled transaction to create a new node. */ - com.hedera.hapi.node.addressbook.NodeCreateTransactionBody nodeCreate = 42; + org.hiero.hapi.node.addressbook.NodeCreateTransactionBody nodeCreate = 42; /** * Transaction body for a scheduled transaction to modify an existing node. */ - com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody nodeUpdate = 43; + org.hiero.hapi.node.addressbook.NodeUpdateTransactionBody nodeUpdate = 43; /** * Transaction body for a scheduled transaction to remove a node. */ - com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody nodeDelete = 44; + org.hiero.hapi.node.addressbook.NodeDeleteTransactionBody nodeDelete = 44; /** * A transaction body to "reject" undesired tokens.
diff --git a/sdk/src/main/proto/transaction_body.proto b/sdk/src/main/proto/transaction_body.proto index ef4abf6ce4..736d7ef33f 100644 --- a/sdk/src/main/proto/transaction_body.proto +++ b/sdk/src/main/proto/transaction_body.proto @@ -371,7 +371,7 @@ message TransactionBody { * This transaction SHALL create a new consensus node record and add * that record to the network address book. */ - com.hedera.hapi.node.addressbook.NodeCreateTransactionBody nodeCreate = 54; + org.hiero.hapi.node.addressbook.NodeCreateTransactionBody nodeCreate = 54; /** * A transaction body for an `updateNode` request. @@ -379,7 +379,7 @@ message TransactionBody { * This transaction SHALL update an existing consensus node record in * the network address book. */ - com.hedera.hapi.node.addressbook.NodeUpdateTransactionBody nodeUpdate = 55; + org.hiero.hapi.node.addressbook.NodeUpdateTransactionBody nodeUpdate = 55; /** * A transaction body for a `deleteNode` request. @@ -387,7 +387,7 @@ message TransactionBody { * This transaction SHALL remove an existing consensus node record from * the network address book. */ - com.hedera.hapi.node.addressbook.NodeDeleteTransactionBody nodeDelete = 56; + org.hiero.hapi.node.addressbook.NodeDeleteTransactionBody nodeDelete = 56; /** * A transaction body to "reject" undesired tokens.
@@ -426,16 +426,16 @@ message TransactionBody { /** * A transaction body for a `tssMessage` request. */ - com.hedera.hapi.services.auxiliary.tss.TssMessageTransactionBody tssMessage = 61; + org.hiero.hapi.services.auxiliary.tss.TssMessageTransactionBody tssMessage = 61; /** * A transaction body for a `tssVote` request. */ - com.hedera.hapi.services.auxiliary.tss.TssVoteTransactionBody tssVote = 62; + org.hiero.hapi.services.auxiliary.tss.TssVoteTransactionBody tssVote = 62; /** * A transaction body for a 'tssShareSignature` request */ - com.hedera.hapi.services.auxiliary.tss.TssShareSignatureTransactionBody tssShareSignature = 63; + org.hiero.hapi.services.auxiliary.tss.TssShareSignatureTransactionBody tssShareSignature = 63; } } diff --git a/sdk/src/main/proto/tss_message.proto b/sdk/src/main/proto/tss_message.proto index 73c495069e..dcfe317ad4 100644 --- a/sdk/src/main/proto/tss_message.proto +++ b/sdk/src/main/proto/tss_message.proto @@ -10,7 +10,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.services.auxiliary.tss; +package org.hiero.hapi.services.auxiliary.tss; /* * Copyright (C) 2024 Hedera Hashgraph, LLC @@ -28,7 +28,7 @@ package com.hedera.hapi.services.auxiliary.tss; * limitations under the License. */ -option java_package = "com.hedera.hapi.services.auxiliary.tss.legacy"; +option java_package = "org.hiero.hapi.services.auxiliary.tss.legacy"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/tss_message_map_key.proto b/sdk/src/main/proto/tss_message_map_key.proto index bd33431563..31d202d427 100644 --- a/sdk/src/main/proto/tss_message_map_key.proto +++ b/sdk/src/main/proto/tss_message_map_key.proto @@ -10,7 +10,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.node.state.tss; +package org.hiero.hapi.node.state.tss; /* * Copyright (C) 2024 Hedera Hashgraph, LLC @@ -28,7 +28,7 @@ package com.hedera.hapi.node.state.tss; * limitations under the License. */ -option java_package = "com.hedera.hapi.node.state.tss.legacy"; +option java_package = "org.hiero.hapi.node.state.tss.legacy"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/tss_share_signature.proto b/sdk/src/main/proto/tss_share_signature.proto index 8ff4b14f19..094a253bac 100644 --- a/sdk/src/main/proto/tss_share_signature.proto +++ b/sdk/src/main/proto/tss_share_signature.proto @@ -12,7 +12,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.services.auxiliary.tss; +package org.hiero.hapi.services.auxiliary.tss; /* * Copyright (C) 2024 Hedera Hashgraph, LLC @@ -30,7 +30,7 @@ package com.hedera.hapi.services.auxiliary.tss; * limitations under the License. */ -option java_package = "com.hedera.hapi.services.auxiliary.tss.legacy"; +option java_package = "org.hiero.hapi.services.auxiliary.tss.legacy"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/tss_vote.proto b/sdk/src/main/proto/tss_vote.proto index 97eb559a43..38cc26bcd3 100644 --- a/sdk/src/main/proto/tss_vote.proto +++ b/sdk/src/main/proto/tss_vote.proto @@ -10,7 +10,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.services.auxiliary.tss; +package org.hiero.hapi.services.auxiliary.tss; /* * Copyright (C) 2024 Hedera Hashgraph, LLC @@ -28,7 +28,7 @@ package com.hedera.hapi.services.auxiliary.tss; * limitations under the License. */ -option java_package = "com.hedera.hapi.services.auxiliary.tss.legacy"; +option java_package = "org.hiero.hapi.services.auxiliary.tss.legacy"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true; diff --git a/sdk/src/main/proto/tss_vote_map_key.proto b/sdk/src/main/proto/tss_vote_map_key.proto index d5a0d66926..570f3e3de4 100644 --- a/sdk/src/main/proto/tss_vote_map_key.proto +++ b/sdk/src/main/proto/tss_vote_map_key.proto @@ -10,7 +10,7 @@ */ syntax = "proto3"; -package com.hedera.hapi.node.state.tss; +package org.hiero.hapi.node.state.tss; /* * Copyright (C) 2024 Hedera Hashgraph, LLC @@ -28,7 +28,7 @@ package com.hedera.hapi.node.state.tss; * limitations under the License. */ -option java_package = "com.hedera.hapi.node.state.tss.legacy"; +option java_package = "org.hiero.hapi.node.state.tss.legacy"; // <<>> This comment is special code for setting PBJ Compiler java package option java_multiple_files = true;