-
Notifications
You must be signed in to change notification settings - Fork 44
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
add serialization/deserialization react transaction #50
base: main
Are you sure you want to change the base?
add serialization/deserialization react transaction #50
Conversation
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
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.
Great start!
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
…ichelmajdalani/first-core-change
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
} | ||
|
||
func (bav *UtxoView) GetReactionsForPostHash(postHash *BlockHash) (_ReactorPubKeys [][]byte, _err error) { | ||
if bav.Postgres != nil { |
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.
we should refactor this function to use the DbAdapter
to get the reactions from the db and only update the view if the key constructed from the entry does not exist in the view yet. Otherwise, we risk updating entries in the view that haven't been flushed.
for-developers/walkthrough/dev-setup/making-your-first-changes.md
Outdated
Show resolved
Hide resolved
// increment the react s on the react d post. | ||
reactEntry := &ReactionEntry{ | ||
ReactorPubKey: txn.PublicKey, | ||
ReactedPostHash: txMeta.PostHash, |
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.
need to add ReactEmoji
in here
require.NoError(utxoView.FlushToDb()) | ||
} | ||
|
||
testDisconnectedState() |
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.
I would probably use the TestMeta
struct and follow the pattern used in block_view_dao_coin_limit_order_test.go
.
Using the below at the end of your tests ensures all disconnect / connects work in all different forms:
_rollBackTestMetaTxnsAndFlush(testMeta)
_applyTestMetaTxnsToMempool(testMeta)
_applyTestMetaTxnsToViewAndFlush(testMeta)
_disconnectTestMetaTxnsFromViewAndFlush(testMeta)
_connectBlockThenDisconnectBlockAndFlush(testMeta)
Add documentation for the first core change of supporting reactions to posts.