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

Transaction testing framework #422

Open
wants to merge 207 commits into
base: main
Choose a base branch
from
Open

Conversation

AeonSw4n
Copy link
Contributor

No description provided.

@AeonSw4n AeonSw4n marked this pull request as ready for review November 29, 2022 23:40
@AeonSw4n AeonSw4n requested a review from a team as a code owner November 29, 2022 23:40
hackintoshrao and others added 2 commits December 4, 2022 18:34
* Group test blocks using t.Run()

* Adding test case for AddInputsAndChangeToTransactionWithSubsidy

- Calling AddInputsAndChangeToTransactionWithSubsidy with txnInputs.
- Expected to fail.
Copy link
Member

@lazynina lazynina left a comment

Choose a reason for hiding this comment

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

seems like this tests well, but it is a little confusing to go through this code. @diamondhands0 - feel free to look when you'd like to give some input here.

// IsDependency should return true if the other input space will have overlapping utxoView/utxoOps mappings or db records
// with the current input space. This is used by the transactionTest framework to determine which transactionTestVector
// will describe entries that will be flushed to the db after both test vectors are applied.
// We assume that IsDependant is a symmetric relation, i.e. IsDependency(TV1, TV2) == IsDependency(TV2, TV1); however,
Copy link
Member

Choose a reason for hiding this comment

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

Dependent is misspelled.

Comment on lines +112 to +113
transactionTestInputTypeAccessGroupCreate transactionTestInputType = iota
transactionTestInputTypeAccessGroupMembers
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we wouldn't just re-use TxnType instead of defining a new enum we need to update whenever we add a new transaction?

tes.testDisconnectBlock(tm, testVectorBlock)
dbEntriesAfter := tes.GetAllStateDbEntries(tm)
tes.compareBeforeAfterDbEntries(dbEntriesBefore, dbEntriesAfter)
glog.Infof(CLog(Yellow, "RunBadgerTest: successfully connected/disconnected block and verified db state"))
Copy link
Member

Choose a reason for hiding this comment

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

Can we set a glog level such that our builds don't have all these print statements in them please? applies to all print statements.


// Fund provided public key with the desired amount of DeSo in nanos.
func (tes *transactionTestSuite) fundPublicKey(tm *transactionTestMeta, publicKey PublicKey, amountNanos uint64) {
// Note we don't need to pass Postgres here, because _doBasicTransferWithVieFlush takes it from Blockchain.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Note we don't need to pass Postgres here, because _doBasicTransferWithVieFlush takes it from Blockchain.
// Note we don't need to pass Postgres here, because _doBasicTransferWithViewFlush takes it from Blockchain.

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.

5 participants