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

Index relayed transactions #2222

Merged
merged 12 commits into from
Aug 20, 2020
Merged

Index relayed transactions #2222

merged 12 commits into from
Aug 20, 2020

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented Aug 13, 2020

Index in elastic search also smart contract results that are generated by relayed transactions.

@miiu96 miiu96 changed the base branch from master to development August 13, 2020 10:28
@miiu96 miiu96 self-assigned this Aug 13, 2020
@sasurobert sasurobert self-requested a review August 14, 2020 07:37
@@ -118,8 +130,20 @@ func (tdp *txDatabaseProcessor) prepareTransactionsForDatabase(
return append(convertMapTxsToSlice(transactions), rewardsTxs...)
}

func (tdp *txDatabaseProcessor) addScResultInfoInTx(scr *smartContractResult.SmartContractResult, tx *Transaction) *Transaction {
dbScResult := tdp.commonProcessor.convertScResultInDatabaseScr(scr)
func findAllChildScrResults(hash string, scrs map[string]*smartContractResult.SmartContractResult) map[string]*smartContractResult.SmartContractResult {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add unit tests for intrashard and cross shard relayed smart contracts. verify how those are indexed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. added a unit tests and did a lot of manual test to check if transaction are indexed correctly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename it as this function also removes elements from the map received as parameter

@miiu96 miiu96 marked this pull request as ready for review August 14, 2020 08:16
@bogdan-rosianu bogdan-rosianu self-requested a review August 18, 2020 12:25
@@ -187,59 +187,27 @@ func (cm *commonProcessor) buildRewardTransaction(
}
}

func (cm *commonProcessor) convertScResultInDatabaseScr(sc *smartContractResult.SmartContractResult) ScResult {
decodedData := decodeScResultData(sc.Data)
func (cm *commonProcessor) convertScResultInDatabaseScr(scHash string, sc *smartContractResult.SmartContractResult) ScResult {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

into*

@@ -98,6 +106,10 @@ func (tdp *txDatabaseProcessor) prepareTransactionsForDatabase(
}
}

if strings.Contains(string(transactions[hash].Data), "relayedTx") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use core->constants.go->RelayedTransaction

tx1 := &transaction.Transaction{
GasLimit: 100,
GasPrice: 100,
Data: []byte("relayedTx@blablabllablalba"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use a prettier mock data

Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System tests passed.

@LucianMincu LucianMincu merged commit 997ff3e into development Aug 20, 2020
@LucianMincu LucianMincu deleted the index-relayed-txs branch August 20, 2020 17:59
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.

None yet

4 participants