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

storage incentives: batch service and backing store #1069

Closed
wants to merge 19 commits into from

Conversation

acud
Copy link
Member

@acud acud commented Dec 22, 2020

#1046 #922 and parts of #934

}
svc := newTestBatchService(t, store)

if err := svc.TopUp(testID, testAmount); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

confusing to use amount here when it is value we update


const (
batchKeyPrefix = "batchKeyPrefix"
// valueKeyPrefix = "valueKeyPrefix"
Copy link
Member

Choose a reason for hiding this comment

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

we need this index by value and replace/reinsert for topup and depth change

pkg/postage/batchservice/batchservice_test.go Show resolved Hide resolved
@@ -0,0 +1,34 @@
package mock
Copy link
Member

Choose a reason for hiding this comment

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

why do we need all these mocks?

// Batch represents a postage batch, a payment on the blockchain.
type Batch struct {
ID []byte // batch ID
Value *big.Int // overall balance of the batch
Copy link
Member

Choose a reason for hiding this comment

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

incorrect or misleading comment

pkg/postage/batchstore/store_test.go Show resolved Hide resolved
// EventUpdater interface definitions reflect the updates triggered by events
// emitted by the postage contract on the blockchain
type EventUpdater interface {
Create(id []byte, owner []byte, amount *big.Int, depth uint8) error
Copy link
Member

Choose a reason for hiding this comment

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

use value instead of amount

pkg/postage/interface.go Show resolved Hide resolved
pkg/postage/testing/batch.go Show resolved Hide resolved
pkg/postage/testing/batch.go Show resolved Hide resolved
@acud
Copy link
Member Author

acud commented Dec 24, 2020

closed in favor of #1070

@acud acud closed this Dec 24, 2020
@acud acud deleted the batchbatchbatch branch December 24, 2020 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants