Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable Refactor changes #849

Merged
merged 4 commits into from
Jan 2, 2024
Merged

Executable Refactor changes #849

merged 4 commits into from
Jan 2, 2024

Conversation

NicolaMirchev
Copy link
Contributor

Description:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

rokn and others added 4 commits December 8, 2023 01:02
Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
* Created base structures and interfaces (executable & transaction) and implemented root functions inside Transaction struct. Refactored '_Execute' func to accept only client and Executable reference

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored transaction struct and interfaces names, because we should keep ITransaction with only one method

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Renamed Terminal -> terminal in more files

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Moved common getters inside executable.go. Edited account_create_transaction.go to use the new approach

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Implemented default executable methods inside

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored transaction struct name in some functions to match the new style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored query root struct and file_contents_query.go to match the new style.

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_balance_query.go to use the new style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Removed 'build' from executable, because query and transaction build return types are different. Also refactored account_balance_query.go to use the new approach

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Recatored tests to use new function method, added public function for query method to match old name

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_info.go to use the new design

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_records_query.go to use the new design

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_stakers_query.go

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contract_bytecode_query.go to use the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contracy_bytecode_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Changed method names inside address_book_query.go to match the method names inside other queries

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contract_info_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored file_info_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored live_hash_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored network_version_info_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored schedule_info_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored token_info_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored token_nft_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored topic_info_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored private function names inside topic_message_query.go to match the new names

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored transaction_receipt_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored transaction_record_query.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_allowance_approve_transaction.go to use the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_allowance_approve_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_allowance_delete_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_delete_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored account_update_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contract_create_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contract_delete_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contract_execute_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored contract_update_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored ethereum_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored file_append_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored file_create_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored file_delete_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored file_update_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored freeze_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored live_has_add_transaction.go to match the new design style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored transaction.go with Schedule function inside. Refactored file_update.go with only specific implementations

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Remove getLogId, because I have getName()

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Updated token, topic, transfer, system and schedule transactions (#837)

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Renamed this -> tx

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fixed unit test running

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored all transaction instances to have buildProtoBody & _ConstructScheduleProtobuf

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Renamed query receivers -> 'q'

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Edited executable functions

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fix freeze functionality

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored 'execute' in Executable and added get Request type, so we can reuse old functions

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored executable

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fixed query execution

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Implemented validateOnNetworkId for file_create_transaction.go

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Changed Transaction struct and interface names

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fix token create account renew

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fix query test problems and executable commented code

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Changed return type on 'fromBytes'. No we pass reference, isntead of copy

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fixed some tests

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Added contract_append_transaction custom execute logic

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fixed all unit tests, which are using 'Transaction.fromBytes'

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fixed query execute to check whether query = AccountBalanceQuery

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Eddited account_balance_query custom execute

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Refactored code to pass lint checks

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fix TransactionFromBytes, removing e in executable

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

* Fix license

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

* Clean up

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

* Fix linting issues

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

* Fix failing tests cause of TransactionFromBytes

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

* Removed unnecessary logic

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

* Added getLogID function back to query/transaction to match the new style

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Raised gas on test to test it in pipeline

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Commented some assets regarding balance query and added more gas for contract calls

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Commented test, which is failing because of testnet

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>

* Fix failing tests from testnet

Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>

---------

Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>
Signed-off-by: Antonio Mindov <antonio.mindov@limechain.tech>
Co-authored-by: Antonio Mindov <antonio.mindov@limechain.tech>
* Fix: Wrong nodes for transactions

Signed-off-by: Emanuel Pargov <bamzedev@gmail.com>
Signed-off-by: NikolaMirchev <nikola.mirchev@limechain.tech>
Copy link

sonarqubecloud bot commented Jan 2, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
1.0% Duplication on New Code

See analysis details on SonarCloud

@NicolaMirchev NicolaMirchev merged commit 0999d93 into main Jan 2, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants