Summary generated by Reviewpad on 26 Jul 23 11:24 UTC
This pull request includes the following changes:
In the trees.go file:
Added a new method Prove that generates and verifies a proof against a tree name stored in the TreeStore.
Updated the GetTreeHashes method to exclude the root tree from the map of tree names to their root hashes.
In the treestore_module.go file:
Added a new method Prove that generates and verifies a proof against a tree with a matching name.
No other changes have been made to the existing methods in the file.
In the transaction_test.go file:
Modified the import statements to use different package names.
Modified the test cases TestHandleTransaction_ErrorAlreadyInMempool, TestHandleTransaction_ErrorAlreadyCommitted, and TestHandleTransaction_BasicValidation.
Modified the function prepareEmptyIndexedTransaction.
Changed some variable names.
In the ibc_msg_mempool_test.go file:
Added a new test function TestHandleMessage_ErrorAlreadyCommitted.
Added environment preparation code, code for indexing a test transaction, and handling the error.
Modified the error handling code.
In the utility/transaction.go file:
Added an import statement for the github.com/pokt-network/pocket/shared/crypto package.
Updated the assignment of the txHash variable.
Updated the condition for checking if the transaction is already in the mempool.
Updated the call to u.GetBus().GetPersistenceModule().TransactionExists.
Updated the check for the existence of the transaction.
In the persistence/trees/trees_test.go file:
Updated the package imports.
Added a new test function TestTreeStore_Prove and several test cases.
Updated the treeStore struct and the existing test function.
In the persistence_module.go file:
Added a new method TransactionExists and commented out the old method.
Please let me know if you would like a more detailed review of any specific part of the diff.
Issue
Fixes #875
Type of change
Please mark the relevant option(s):
[x] New feature, functionality or library
[ ] Bug fix
[ ] Code health or cleanup
[ ] Major breaking change
[ ] Documentation
[ ] Other
List of changes
Update TransactionExists to use TreeStore
Add Prove method to TreeStore
Update tests
Testing
[x] make develop_test; if any code changes were made
[x] make test_e2e on k8s LocalNet; if any code changes were made
[x] e2e-devnet-test passes tests on DevNet; if any code was changed
Description
Summary generated by Reviewpad on 26 Jul 23 11:24 UTC
This pull request includes the following changes:
In the
trees.go
file:Prove
that generates and verifies a proof against a tree name stored in theTreeStore
.GetTreeHashes
method to exclude the root tree from the map of tree names to their root hashes.In the
treestore_module.go
file:Prove
that generates and verifies a proof against a tree with a matching name.In the
transaction_test.go
file:TestHandleTransaction_ErrorAlreadyInMempool
,TestHandleTransaction_ErrorAlreadyCommitted
, andTestHandleTransaction_BasicValidation
.prepareEmptyIndexedTransaction
.In the
ibc_msg_mempool_test.go
file:TestHandleMessage_ErrorAlreadyCommitted
.In the
utility/transaction.go
file:github.com/pokt-network/pocket/shared/crypto
package.txHash
variable.u.GetBus().GetPersistenceModule().TransactionExists
.In the
persistence/trees/trees_test.go
file:TestTreeStore_Prove
and several test cases.treeStore
struct and the existing test function.In the
persistence_module.go
file:TransactionExists
and commented out the old method.Please let me know if you would like a more detailed review of any specific part of the diff.
Issue
Fixes #875
Type of change
Please mark the relevant option(s):
List of changes
TransactionExists
to use TreeStoreProve
method to TreeStoreTesting
make develop_test
; if any code changes were mademake test_e2e
on k8s LocalNet; if any code changes were madee2e-devnet-test
passes tests on DevNet; if any code was changedRequired Checklist
godoc
format comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)