Skip to content

Commit

Permalink
Add TokenFeeScheduleUpdate operation (#1764)
Browse files Browse the repository at this point in the history
* Refactored nfts (#1614)
Signed-off-by: Daniel <Daniel.K.Ivanov95@gmail.com>

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored nfts transfers (#277)

Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

#182 ! merging nft transfers

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* fix build (#278)

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>
Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Refactored nfts touchups (#1626)

* Use 0.15.0 hapi-proto

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try adding missing TOKEN_MAX_SUPPLY_REACHED constant

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try removing Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix some CI issues

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize other failing EET in CI

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Feature: Unique Token Burn operation (#1627)

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Use 0.15.0 hapi-proto

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try adding missing TOKEN_MAX_SUPPLY_REACHED constant

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try removing Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fixes after merge

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Unique token burn (#275)

* burn method signature

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Initial burn implementation

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Add unit tests for unique burn and mint

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Add serial numbers to receipt

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More coverage

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Fees for token burn tx

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More E2E and unit.Update prechecks

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Fixes after merge

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More fixes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More e2e + usages

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Cosmetic fixes - license

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Change fungible transfers on NFT transfer

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Move stores.persist login in state transition + coverage

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Implement requested PR changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* unit test: any -> eq where possible

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* nit fix

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Remove CryptoTransferUsage and resp. test
Update NftAdjustments
Update UsagePricesProvider

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Update fee files for failing unit tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Fix failing unit test

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: tinker-michaelj <michael.tinker@hedera.com>

* Added nfts e2e (#1635)

* Use 0.15.0 hapi-proto

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try adding missing TOKEN_MAX_SUPPLY_REACHED constant

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try removing Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* + nft transfer E2E (#279)

+ nft transfer E2E

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + nft transfer E2E

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>
Signed-off-by: daniel-danev-limechain <daniel.danev@limechain.tech>

Co-authored-by: tinker-michaelj <michael.tinker@hedera.com>
Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Refactored nfts plus master (#1645)

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Roll to SDK 0.15.1 (#1618)

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Use 0.15.0 hapi-proto

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try adding missing TOKEN_MAX_SUPPLY_REACHED constant

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Try removing Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fixes after merge

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* 01621: Added explicit DENY all clause to top level filters (#1622)

Signed-off-by: Nathan Klick <nathan@swirlds.com>

* Remove gRPC types from HederaLedger zero-sum transfers API to use  (#1616)

* Replace SigMapPubKeyToSigBytes with POJO version

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Reuse expiringEntities ArrayList in AwareTransactionContext

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add license headers

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix code smells

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Initial commit, disabling CI for now

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Introduce PureTransferSemanticChecks

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Before semanticCheck argument type migration

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Prioritize validateSemantics

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Extract CryptoTransfer semantic checks into PureTransferSemanticChecks

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Remove unnecessary injection from ContextOptionalValidator

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Start LedgerBalanceChangesTest

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Disable unit test for now

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Switch HederaLedger zeroSum transfers API to non-GRPC types

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Finish transition logic for scheduled CryptoTransfers

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Finalize ImpliedTransfersMarshal

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Permit override of response code to be used for an insufficient balance in zero-sum transfers

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Permit overriding INSUFFICIENT_TOKEN_BALANCE response code

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Use faster implementations for MerkleEntityId hashCode/equals

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Use INSUFFICIENT_TOKEN_BALANCE as default code for token balance change

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Extract functions to please Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc, remove more code smells

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add more javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix typo in Javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Address reviewer comments

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Remove public setter for codeForInsufficientBalance.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Simplify the code and avoid exposing unnecessary setters in BalanceChange.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Add safety check on noTokenForHbarAdjust.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>

* Unique token burn (#275)

* burn method signature

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Initial burn implementation

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Add unit tests for unique burn and mint

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Add serial numbers to receipt

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More coverage

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Fees for token burn tx

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More E2E and unit.Update prechecks

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Fixes after merge

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More fixes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* More e2e + usages

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Cosmetic fixes - license

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Change fungible transfers on NFT transfer

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Move stores.persist login in state transition + coverage

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Implement requested PR changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* unit test: any -> eq where possible

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* nit fix

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Remove CryptoTransferUsage and resp. test
Update NftAdjustments
Update UsagePricesProvider

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Update fee files for failing unit tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Begin 0.16.0 development iteration (#1584)

* [maven-release-plugin] Create release branch

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* [maven-release-plugin] prepare for next development iteration

* Add SelfSerializable representation of a custom fee (fixed or fractional) (#1624)

* Implement CustomFee

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add unit tests

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add missing license header.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Add javadoc and equals/hashCode/toString methods for convenience

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>

* Begin compartmentalized use of NftsLedger for atomic CryptoTransfer

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add NFT support to TokenStore.tryTokenChange()

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit tests

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize CI and address reviewer comments

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize TokenManagementSpecs

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: Yoan Sredkov <yoansredkov@gmail.com>
Co-authored-by: Nathan Klick <nathanklick@users.noreply.github.com>
Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>

* resolve unit test failures & making sure that E2E tests pass

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Feature: Integration of One-To-Many Data Structure (#1668)

* Feature: One to many data structure (#287)

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored nfts transfers (#277)

#182 ! merging nft transfers

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* fix build (#278)

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* add swirlds alpha version

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Replace invertible with new structures

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unfinished work

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Enable function

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring and replacement

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Ownership Change on Mint

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unique Token Ownership Transfer on NFT Transfer

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Merge Conflicts and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Association and disassociation

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* PR Comments Resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* remove fc invertible map & rename properties

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Coverage fix and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* rename getter

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* Keep FCOTMRs in-sync with mutable state (#1674)

* Add (temporary) default prices for WipeAccount

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>
Signed-off-by: Michael Tinker <michael.tinker@hedera.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Co-authored-by: Michael Tinker <michael.tinker@hedera.com>

* Tests: Increase Unit Test coverage on NFTs (#1688)

* Feature: One to many data structure (#287)

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored nfts transfers (#277)

#182 ! merging nft transfers

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* fix build (#278)

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* add swirlds alpha version

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Replace invertible with new structures

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unfinished work

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Enable function

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring and replacement

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Ownership Change on Mint

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unique Token Ownership Transfer on NFT Transfer

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Merge Conflicts and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Association and disassociation

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* PR Comments Resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* remove fc invertible map & rename properties

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Coverage fix and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* rename getter

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* Keep FCOTMRs in-sync with mutable state (#1674)

* Add (temporary) default prices for WipeAccount

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Code coverage  (#308)

* initial unit tests for coverage

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>
Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* More tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* 1 more for TypedTokenStore

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>
Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Add test for UniqueToken

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Update outdated tests after merge

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Fix metadata on UniqueTokenTest

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Feature: Integration of One-To-Many Data Structure (#1668)

* Feature: One to many data structure (#287)

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored nfts transfers (#277)

#182 ! merging nft transfers

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* fix build (#278)

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* add swirlds alpha version

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Replace invertible with new structures

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unfinished work

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Enable function

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring and replacement

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Ownership Change on Mint

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unique Token Ownership Transfer on NFT Transfer

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Merge Conflicts and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Association and disassociation

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* PR Comments Resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* remove fc invertible map & rename properties

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Coverage fix and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* rename getter

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* Keep FCOTMRs in-sync with mutable state (#1674)

* Add (temporary) default prices for WipeAccount

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>
Signed-off-by: Michael Tinker <michael.tinker@hedera.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Co-authored-by: Michael Tinker <michael.tinker@hedera.com>

* more tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Co-authored-by: Michael Tinker <michael.tinker@hedera.com>

* fix after merge

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* + increasing code coverage (#288)

* + increasing code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + increasing code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + increasing code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + increasing code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + increasing code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + increasing code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + added TokenGetNftInfosQuery implementation

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* + increase code coverage

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* fix unit test bug

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* fix requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* add wipe default fee data to resolve issue

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* fix formatting

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* fix formatting

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <yoansredkov@gmail.com>

* revert accidental change

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* fix licenses

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Co-authored-by: Michael Tinker <michael.tinker@hedera.com>
Co-authored-by: daniel-danev-limechain <daniel.danev@limechain.tech>

* Re-resolve merge conflicts with master (#1696)

* HIP-18 Changes for ExpirableTxnRecord (#1649)

* Replace SigMapPubKeyToSigBytes with POJO version

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Reuse expiringEntities ArrayList in AwareTransactionContext

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add license headers

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix code smells

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Initial commit, disabling CI for now

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Introduce PureTransferSemanticChecks

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Before semanticCheck argument type migration

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Prioritize validateSemantics

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Extract CryptoTransfer semantic checks into PureTransferSemanticChecks

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Remove unnecessary injection from ContextOptionalValidator

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Start LedgerBalanceChangesTest

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Disable unit test for now

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Switch HederaLedger zeroSum transfers API to non-GRPC types

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Finish transition logic for scheduled CryptoTransfers

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* initial commit to use 0.16.0-snapshot

* Finalize ImpliedTransfersMarshal

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Permit override of response code to be used for an insufficient balance in zero-sum transfers

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Permit overriding INSUFFICIENT_TOKEN_BALANCE response code

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Use faster implementations for MerkleEntityId hashCode/equals

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Use INSUFFICIENT_TOKEN_BALANCE as default code for token balance change

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Extract functions to please Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc, remove more code smells

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add more javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix typo in Javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* add BalanceChange list to ExpirableTxnRecord

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add CustomFees for the record from CryptoTransferTransitionLogic

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Merge 'master' into 1590-M-Update-TxnRecordService

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add to another list for custom fees

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add changes for computing customFees in ImpliedTransfersMarshal

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add CustomFeesBalanceChangeTest

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing SpanMapManagerTest.java

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add serialize and deserialize tests for ExpirableTxnRecord

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix no args constructor

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* uncomment LedgerBalanceChangesTest

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Add ImpliedTransfersMarshalTest

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add some more tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add tests to ImpliedTransfersMarshalTest for fractional fee

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* more test coverage

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Full coverage for CustomFeesBalanceChange.java

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add re-calculation of custom fee schedules based on FCMap implementation

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix code smells

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add FCMCustomFeeSchedulesTest.java and fix javadocs

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add division by zero test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* remove unnecessary creations of other ArrayLists

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* return void

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Modify the logic in ImpliedTransfersMarshal

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix test and refactor the code

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* misc typo fixes

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix review comments

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

Co-authored-by: tinker-michaelj <michael.tinker@hedera.com>
Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>

* 1654 EET for TokenUpdate with CustomFees (#1662)

* Add CustomFees support in HapiTokenUpdate.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Add scenarios that fail on TokenUpdate.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Add scenario that successfully update token.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Fix typos.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Fix defaultFailingHapiSpec to override CI Props.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* HAPIClientValidator does not support FAILED_AS_EXPECTED spec yet. Turn this spec off.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Update BalanceChange to use Id instead of EntityId (#1665)

* update balance change to use ID

* add setter for codeForInsufficientBalance so that INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE can be set while adding custom fees

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add condition for payer

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix misc

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix BalanceChangeTest

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Feature: One to many data structure (#287)

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored nfts transfers (#277)

#182 ! merging nft transfers

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* fix build (#278)

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* add swirlds alpha version

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Replace invertible with new structures

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unfinished work

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Enable function

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring and replacement

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Ownership Change on Mint

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unique Token Ownership Transfer on NFT Transfer

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Merge Conflicts and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Association and disassociation

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* PR Comments Resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* remove fc invertible map & rename properties

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Coverage fix and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* rename getter

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* Initial Draft for GCP set up and steps to run JRS in services (#1620)

* initial doc with headers

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add some basic info

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix headers

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add GCP set up guide

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix other spaces

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add a png

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add image

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix typos

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix comments from Ron

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add some pics

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix pics

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix the pics

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add an example personal JSON

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* address review comments

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Always reset assessedCustomFees to null in AwareTransactionContext (#1673)

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Update for alpha.1 HIP-18 protos (#1671)

* Fix compile errors with post-review HIP-18 protobufs

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Complete migration to 0.16.0-alpha.1 protos

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Rename tokenFeeSchedules field

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Always reset assessedCustomFees to null in AwareTransactionContext

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fail fast in fee spec factories

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Minor improvements.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>

* Add (temporary) default prices for WipeAccount

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix compile errors

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Update record forensics (#1677)

* Hmm

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Update and simplify test comparing consensus/ISS record streams

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Ignore deleted tokens when rebuilding knownTreasuries (#1679)

* Ignore deleted tokens when rebuilding knownTreasuries; disable FCM dumps by default

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Use stable protobufs

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Reviewer comment

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add custom fee resources usage into cryptoTransfer fee calculation. (#1666)

* Add custom fee resources usage into cryptoTransfer fee calculation.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Fix code smell and test coverage.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* # This is a combination of 4 commits.
# This is the 1st commit message:

Try to fix the INSUFFICIENT_TX_FEE for some EET tests.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

# This is the commit message #2:

Validate more tests.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

# This is the commit message #3:

Why these tests fail in CircleCi?

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

# This is the commit message #4:

Re-implement transfer fee calculation.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Re-implement custom fee usage calculation.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Add several scenarios for TokenCreate with negative custom fees.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Add more scenarios for transfer.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Removed not needed custom fee key.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Changes per comments.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* 01680: Fix log4j2 issue that resulted in empty hgcaa.log file (#1681)

- Refactor filters by moving out of the global space and into a Logger space
- Define a new com.swirlds logger to contain the filters
- Remove filters from Root logger
- Change Root logger level to FATAL as a last resort catch-all

Signed-off-by: Nathan Klick <nathan@swirlds.com>

* Reconnect test with an account dissociation from a deleted token (#1684)

* add a new token reconnect scenario

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* modify comment

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* 01574-master-javaDocAdded (#1660)

* Javadoc Added

* Styling updated for JavaDoc

* JavaDoc Warnings

* JavaDoc Warnings

* Javadoc

* Javadoc

* Javadoc

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Refactored nfts touchups

Signed-off-by: Michael Tinker <michael.tinker@hedera.com>

* Refactored nfts plus master

Signed-off-by: Michael Tinker <michael.tinker@hedera.com>

Co-authored-by: Neeha <52669918+Neeharika-Sompalli@users.noreply.github.com>
Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>
Co-authored-by: Quan Nguyen <45947300+qnswirlds@users.noreply.github.com>
Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Co-authored-by: ljianghedera <55505519+ljianghedera@users.noreply.github.com>
Co-authored-by: Nathan Klick <nathanklick@users.noreply.github.com>
Co-authored-by: amckay7777 <amckay7777@gmail.com>

* add forgotten changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Nfts: Code Coverage Increase (#1713)

* add forgotten changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Token Nft Info Answer Unit Tests (#315)

* Token Nft Info Answer Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Coverage unit tests (#316)

* context unit tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* SeqNoEntityIdSource unit tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Burn usage missing test

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Add ContextOptionValidator missing tests

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* Add coverage for token mint usage

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* update token mint usage logic

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* pr changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* fix all requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* refactor missed metadata test

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* cleanup

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <yoansredkov@gmail.com>

* Re-enable Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix config.yml spacing

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix compile error

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Sync config.yml

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* CI-enabled #1712 (#1723)

* Unit tests after refactoring

Signed-off-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>

* add MerkleUniqueToken and MerkleUniqueTokenId

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* save changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* add all necessary hedera-node changes

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* resolve queries and resolve compilation failures

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* services state update

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Unit tests after refactoring (#274)

* Fix most of unit tests but 7

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* all but 1

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* PR requested changes

Signed-off-by: Yoan Sredkov <yoansredkov@gmail.com>

* NFTs: Refactored E2E (#273)

* Adapted E2E Scenarios after major refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored nfts transfers (#277)

Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

#182 ! merging nft transfers

Signed-off-by: Daniel Danev <daniel.danev@limechain.tech>

* fix build (#278)

Signed-off-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* add swirlds alpha version

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Replace invertible with new structures

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unfinished work

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Enable function

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring and replacement

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Ownership Change on Mint

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unique Token Ownership Transfer on NFT Transfer

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Merge Conflicts and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Association and disassociation

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Minor change

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* PR Comments Resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* remove fc invertible map & rename properties

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Coverage fix and refactoring

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Refactored Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Nfts: Get Account NFT Infos Query

* Get Nft Account Infos Query

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Merge conflicts

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Query Range Response Code Renaming

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Remove unnecessary stuff

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Nit resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* FeeSchedules Revert

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* FeeSchedules Revert

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* Re-enable Sonar

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit test

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix Sonar bugs

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Stabilize CI (add TokenGetAccountNftInfos to ExpectedCustomThrottles)

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Quans comments resolution

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* make naming consistent + fix unit tests

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>

* Feat/burn bug and unit tests internal (#319) (#1724)

* resolve burn issue and add unit tests

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Additional Unit Tests

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* E2E HapiGetAccountNftInfos Modification

Signed-off-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>

* resolve unit test comments

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* rename unittest

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

Co-authored-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* fix sonar issue

Signed-off-by: Daniel Ivanov <daniel.k.ivanov95@gmail.com>

* Add unit test to trigger CI

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Resolve compile errors

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix unit tests.

Signed-off-by: Quan Nguyen <quan.nguyen@hedera.com>

* Fix more unit tests.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* added feeScheduleKey to MerkleToken and its tests

Signed-off-by: abhishek-hedera <abhishek.pandey@hedera.com>

* Add more tests to MerkleTokenTest

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add changes to HederaTokenStore update method

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Update TokenCreate transition logic for feeScheduleKey

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* fix unit test

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* Initial commit to add TokenFeeScheduleUpdate operation to lookup and a shell for the transition logic

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* add unit tests to validate token immutability when updating feeScheduleKey on a taken with no AdminKey

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* Enforce signing reqs for TokenFeeScheduleUpdate

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Update HAPI permissions, throttles, etc for new op (#1749)

* add the hapi permissions

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add more tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Update throttles JSON with new ops

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix TokenNftGetInfo typo

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Add fee schedule generation tool + base usage and canonical price of TokenFeeScheduleUpdate (#1754)

* Initial commit

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* add the hapi permissions

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add more tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* SpanMapManager update in progress

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Update throttles JSON with new ops

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* (TokenFeeScheduleUpdate) Expand usage meta in span map; add OpUsageCtxHelper for extant usage ctx; update AccessorBasedUsages for the op

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Implement fee schedule generator + submit message sanity check

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Disable CI for now

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Intermezzo

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Oops

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Re-enable CI

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add JSON resources

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Add javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* More javadoc

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Revert accidental change to spec-default.properties

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Remove unnecessary type check on constant weight resource values

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Impl TokenFeeScheduleUpdate transition logic via existing store (#1760)

* add feeSchedule and feeScheduleKey to the Token Model

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* Validate usage of NFT as token denomination in customFee and validate usage of fractinal fee when creating an NFT

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* pass golobalDynamicProperties to TokenFeeScheduleUpdateTransitionLogic which are used to validate the feeSchdule

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* Add feeSchedule validation to TypedTokenStore

Signed-off-by: anighanta <anirudh.ghanta@hedera.com>

* Added EET test cases.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Add missing fee scheulde key scenario

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* update the validation of custom fee response codes as per master

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* update the validation of custom fee response codes as per master

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Add 2 more scenarios.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Initial implementation of transition logic of fee schedule update.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Add test cases for TokenFeeScheduleUpdateTransitionLogic.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* add test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add test for TokenCreateTransitionLogic

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* add more tests

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Initial commit; unwind refactoring for speed of implementation

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Unwind remaining refactoring

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* add test coverage

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Add the case for fee update fractional fee check.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Missing default txn for the new op.

Signed-off-by: ljianghedera <leo.jiang@hedera.com>

* Restore fee schedule key to GetTokenInfo

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Compute FeeSchUpd usage meta in SignedTxnAccessor not SpanMapManager#expand

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Cover FeeSchUpdMeta#toString

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Reject fractional fee update to non-fungible unique

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

Co-authored-by: anighanta <anirudh.ghanta@hedera.com>
Co-authored-by: ljianghedera <leo.jiang@hedera.com>
Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* Fix merge resolution slip-ups

Signed-off-by: tinker-michaelj <michael.tinker@hedera.com>

* Fix new code smells added by Fees PR (#1763)

* fix few code smells

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix all code smells

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix the switch cases

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix switch case

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix failing test

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix more smells

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix review comments

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix indentations after merge

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix merge conflicts

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

* fix other nit review comments

Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>

Co-authored-by: Daniel <Daniel.K.Ivanov95@gmail.com>
Co-authored-by: Yoan Sredkov <48679375+joan41868@users.noreply.github.com>
Co-authored-by: Georgi Yazovaliyski <georgi.yazovaliiski@gmail.com>
Co-authored-by: daniel-danev-limechain <84330934+daniel-danev-limechain@users.noreply.github.com>
Co-authored-by: Yoan Sredkov <yoansredkov@gmail.com>
Co-authored-by: daniel-danev-limechain <daniel.danev@limechain.tech>
Co-authored-by: Nathan Klick <nathanklick@users.noreply.github.com>
Co-authored-by: Quan Nguyen <quan.nguyen@hedera.com>
Co-authored-by: Neeha <52669918+Neeharika-Sompalli@users.noreply.github.com>
Co-authored-by: Quan Nguyen <45947300+qnswirlds@users.noreply.github.com>
Co-authored-by: ljianghedera <55505519+ljianghedera@users.noreply.github.com>
Co-authored-by: amckay7777 <amckay7777@gmail.com>
Co-authored-by: ljianghedera <leo.jiang@hedera.com>
Co-authored-by: abhishek-hedera <abhishek.pandey@hedera.com>
Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@hedera.com>
Co-authored-by: anighanta <anirudh.ghanta@hedera.com>
  • Loading branch information
17 people authored Jul 7, 2021
1 parent 0416015 commit 416b33a
Show file tree
Hide file tree
Showing 164 changed files with 6,032 additions and 2,394 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ hs_err_pid*
!test-clients/yahcli/assets/*.sh
!test-clients/yahcli/run/test/local/*.sh
*.json
!hapi-fees/src/main/resources/*.json
!hapi-utils/src/test/resources/bootstrap/*.json
!hedera-node/src/test/resources/fees/feeSchedules.json
!hedera-node/src/test/resources/legacyAccounts.json
Expand Down
127 changes: 127 additions & 0 deletions hapi-fees/src/main/java/com/hedera/services/pricing/AssetsLoader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
package com.hedera.services.pricing;

/*-
* ‌
* Hedera Services API Fees
* ​
* Copyright (C) 2018 - 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.
* ‍
*/

import com.fasterxml.jackson.databind.ObjectMapper;
import com.hederahashgraph.api.proto.java.HederaFunctionality;
import com.hederahashgraph.api.proto.java.SubType;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.EnumMap;
import java.util.Map;

/**
* Loads assets used to generate a fee schedule from JSON resources on the classpath.
*
* Please see the individual methods for details.
*/
class AssetsLoader {
private static final String CAPACITIES_RESOURCE = "capacities.json";
private static final String CONSTANT_WEIGHTS_RESOURCE = "constant-weights.json";
private static final String CANONICAL_PRICES_RESOURCE = "canonical-prices.json";

/**
* Loads a map that, for each supported operation, gives the fraction of that
* operation's total price that should come from its constant term in the fee
* schedule.
*
* This fraction is the "weight" of the constant term; and is currently set at
* 0.9 for operations that create new entities, and 0.2 for other operations.
*
* @return the "weight" of the constant term for each operation
* @throws IOException if the backing JSON resource cannot be loaded
*/
Map<HederaFunctionality, BigDecimal> loadConstWeights() throws IOException {
try (var fin = AssetsLoader.class.getClassLoader().getResourceAsStream(CONSTANT_WEIGHTS_RESOURCE)) {
final var om = new ObjectMapper();
final var constWeights = om.readValue(fin, Map.class);

final Map<HederaFunctionality, BigDecimal> typedConstWeights = new EnumMap<>(HederaFunctionality.class);
constWeights.forEach((funcName, weight) -> {
final var function = HederaFunctionality.valueOf((String) funcName);
final var bdWeight = BigDecimal.valueOf((Double) weight);
typedConstWeights.put(function, bdWeight);
});

return typedConstWeights;
}
}

/**
* Loads a map that, for each resource type available in the network, gives the
* "capacity" of that resource. These capacities do not have an absolute meaning,
* and are just compared to infer the relative scarcity of each resource.
*
* @return the network "capacity" of each resource type
* @throws IOException if the backing JSON resource cannot be loaded
*/
Map<UsableResource, BigDecimal> loadCapacities() throws IOException {
try (var fin = AssetsLoader.class.getClassLoader().getResourceAsStream(CAPACITIES_RESOURCE)) {
final var om = new ObjectMapper();
final var capacities = om.readValue(fin, Map.class);

final Map<UsableResource, BigDecimal> typedCapacities = new EnumMap<>(UsableResource.class);
capacities.forEach((resourceName, amount) -> {
final var resource = UsableResource.valueOf((String) resourceName);
final var bdAmount = (amount instanceof Long)
? BigDecimal.valueOf((Long) amount)
: BigDecimal.valueOf((Integer) amount);
typedCapacities.put(resource, bdAmount);
});

return typedCapacities;
}
}

/**
* Loads a map that, for each supported operation, gives the desired price in
* USD for the "base configuration" of each type of that operation. (Types are
* given by the values of the {@link SubType} enum; that is, DEFAULT,
* TOKEN_NON_FUNGIBLE_UNIQUE, and TOKEN_FUNGIBLE_COMMON.)
*
* @return the desired per-type prices, in USD
* @throws IOException if the backing JSON resource cannot be loaded
*/
Map<HederaFunctionality, Map<SubType, BigDecimal>> loadCanonicalPrices() throws IOException {
try (var fin = AssetsLoader.class.getClassLoader().getResourceAsStream(CANONICAL_PRICES_RESOURCE)) {
final var om = new ObjectMapper();
final var prices = om.readValue(fin, Map.class);

final Map<HederaFunctionality, Map<SubType, BigDecimal>> typedPrices =
new EnumMap<>(HederaFunctionality.class);
prices.forEach((funName, priceMap) -> {
final var function = HederaFunctionality.valueOf((String) funName);
final Map<SubType, BigDecimal> scopedPrices = new EnumMap<>(SubType.class);
((Map) priceMap).forEach((typeName, price) -> {
final var type = SubType.valueOf((String) typeName);
final var bdPrice = (price instanceof Double)
? BigDecimal.valueOf((Double) price)
: BigDecimal.valueOf((Integer) price);
scopedPrices.put(type, bdPrice);
});
typedPrices.put(function, scopedPrices);
});

return typedPrices;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package com.hedera.services.pricing;

/*-
* ‌
* Hedera Services API Fees
* ​
* Copyright (C) 2018 - 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.
* ‍
*/

import com.google.protobuf.ByteString;
import com.hedera.services.usage.BaseTransactionMeta;
import com.hedera.services.usage.SigUsage;
import com.hedera.services.usage.consensus.ConsensusOpsUsage;
import com.hedera.services.usage.consensus.SubmitMessageMeta;
import com.hedera.services.usage.state.UsageAccumulator;
import com.hedera.services.usage.token.TokenOpsUsage;
import com.hedera.services.usage.token.meta.ExtantFeeScheduleContext;
import com.hedera.services.usage.token.meta.FeeScheduleUpdateMeta;
import com.hederahashgraph.api.proto.java.CustomFee;
import com.hederahashgraph.api.proto.java.FixedFee;
import com.hederahashgraph.api.proto.java.HederaFunctionality;
import com.hederahashgraph.api.proto.java.SignatureMap;
import com.hederahashgraph.api.proto.java.SignaturePair;
import com.hederahashgraph.api.proto.java.SubType;
import com.hederahashgraph.api.proto.java.TokenFeeScheduleUpdateTransactionBody;
import com.hederahashgraph.api.proto.java.TokenID;

import java.util.List;

/**
* Provides the resource usage of the "base configuration" for each Hedera operation.
*
* The base configuration of an operation is usually the cheapest version of the
* operation that still does something useful. (For example, the base CryptoTransfer
* adjusts only two ℏ accounts using one signature, the base TokenFeeScheduleUpdate
* adds a single custom HTS fee to a token, etc.)
*/
class BaseOperationUsage {
private static final long THREE_MONTHS_IN_SECONDS = 7776000L;
private static final ByteString CANONICAL_SIG = ByteString.copyFromUtf8(
"0123456789012345678901234567890123456789012345678901234567890123");
private static final SignatureMap ONE_PAIR_SIG_MAP = SignatureMap.newBuilder()
.addSigPair(SignaturePair.newBuilder()
.setPubKeyPrefix(ByteString.copyFromUtf8("a"))
.setEd25519(CANONICAL_SIG))
.build();
private static final SigUsage SINGLE_SIG_USAGE = new SigUsage(
1, ONE_PAIR_SIG_MAP.getSerializedSize(), 1
);
private static final BaseTransactionMeta NO_MEMO_AND_NO_EXPLICIT_XFERS = new BaseTransactionMeta(0, 0);

private static final TokenOpsUsage TOKEN_OPS_USAGE = new TokenOpsUsage();
private static final ConsensusOpsUsage CONSENSUS_OPS_USAGE = new ConsensusOpsUsage();
private static final String NOT_IMPLEMENTED = "Not implemented!";

/**
* Returns the total resource usage for the base configuration of the given
* type of the given operation.
*
* @param function
* the operation of interest
* @param type
* the type of interest
* @return the total resource usage of the base configuration
*/
UsageAccumulator baseUsageFor(HederaFunctionality function, SubType type) {
switch (function) {
case CryptoTransfer:
switch (type) {
case DEFAULT:
return hbarCryptoTransfer();
case TOKEN_FUNGIBLE_COMMON:
return htsCryptoTransfer();
case TOKEN_NON_FUNGIBLE_UNIQUE:
return nftCryptoTransfer();
}
break;
case ConsensusSubmitMessage:
return submitMessage();
case TokenFeeScheduleUpdate:
return feeScheduleUpdate();
default:
throw new IllegalArgumentException("Canonical usage unknown");

}

throw new IllegalArgumentException("Canonical usage unknown");
}

private UsageAccumulator submitMessage() {
final var baseMeta = new BaseTransactionMeta(0, 0);
final var opMeta = new SubmitMessageMeta(100);
final var into = new UsageAccumulator();
CONSENSUS_OPS_USAGE.submitMessageUsage(SINGLE_SIG_USAGE, opMeta, baseMeta, into);
return into;
}

private UsageAccumulator feeScheduleUpdate() {
/* A canonical op */
final var target = TokenID.newBuilder().setShardNum(1).setRealmNum(2).setTokenNum(3).build();
final List<CustomFee> theNewSchedule = List.of(
CustomFee.newBuilder().setFixedFee(FixedFee.newBuilder()
.setAmount(123L)
.setDenominatingTokenId(target))
.build());
final var op = TokenFeeScheduleUpdateTransactionBody.newBuilder()
.setTokenId(target)
.addAllCustomFees(theNewSchedule)
.build();

/* The canonical usage and context */
final var newReprBytes = TOKEN_OPS_USAGE.bytesNeededToRepr(theNewSchedule);
final var grpcReprBytes = op.getSerializedSize() - op.getTokenId().getSerializedSize();
final var opMeta = new FeeScheduleUpdateMeta(0L, newReprBytes, grpcReprBytes);
final var feeScheduleCtx = new ExtantFeeScheduleContext(THREE_MONTHS_IN_SECONDS, 0);

final var into = new UsageAccumulator();
TOKEN_OPS_USAGE.feeScheduleUpdateUsage(
SINGLE_SIG_USAGE,
NO_MEMO_AND_NO_EXPLICIT_XFERS,
opMeta,
feeScheduleCtx,
into);
return into;
}

private UsageAccumulator hbarCryptoTransfer() {
throw new AssertionError(NOT_IMPLEMENTED);
}

private UsageAccumulator htsCryptoTransfer() {
throw new AssertionError(NOT_IMPLEMENTED);
}

private UsageAccumulator nftCryptoTransfer() {
throw new AssertionError(NOT_IMPLEMENTED);
}
}
Loading

0 comments on commit 416b33a

Please sign in to comment.