-
Notifications
You must be signed in to change notification settings - Fork 198
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
Conversation
@@ -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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@@ -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 { |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.
Index in elastic search also smart contract results that are generated by relayed transactions.