mirror of
https://github.com/arnaucube/asmt.git
synced 2026-02-06 19:06:46 +01:00
Rm dvote/censustree interface dependency (which nolonger exists)
This commit is contained in:
10
asmt.go
10
asmt.go
@@ -7,7 +7,6 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"go.vocdoni.io/dvote/censustree"
|
||||
"go.vocdoni.io/dvote/log"
|
||||
"go.vocdoni.io/proto/build/go/models"
|
||||
|
||||
@@ -32,9 +31,6 @@ type Tree struct {
|
||||
snapshotSize uint64
|
||||
}
|
||||
|
||||
// check that censustree.Tree interface is matched by Tree
|
||||
var _ censustree.Tree = (*Tree)(nil)
|
||||
|
||||
type Proof struct {
|
||||
Bitmap []byte
|
||||
Length int
|
||||
@@ -57,8 +53,8 @@ const (
|
||||
dbRootPrefix = "this is the last root for the SMT tree"
|
||||
)
|
||||
|
||||
// NewTree initializes a new AergoSMT tree following the censustree.Tree interface specification.
|
||||
func NewTree(name, storageDir string) (censustree.Tree, error) {
|
||||
// NewTree initializes a new AergoSMT tree following the Tree interface specification.
|
||||
func NewTree(name, storageDir string) (*Tree, error) {
|
||||
tr := &Tree{}
|
||||
err := tr.Init(name, storageDir)
|
||||
return tr, err
|
||||
@@ -371,7 +367,7 @@ func (t *Tree) ImportDump(data []byte) error {
|
||||
|
||||
// Snapshot returns a Tree instance of a exiting merkle root.
|
||||
// A Snapshot cannot be modified.
|
||||
func (t *Tree) Snapshot(root []byte) (censustree.Tree, error) {
|
||||
func (t *Tree) Snapshot(root []byte) (*Tree, error) {
|
||||
exist, err := t.HashExists(root)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
8
go.mod
8
go.mod
@@ -7,8 +7,8 @@ require (
|
||||
github.com/aergoio/aergo-lib v1.0.2
|
||||
github.com/guptarohit/asciigraph v0.4.1
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
|
||||
go.vocdoni.io/dvote v1.0.4-0.20210809075252-5e1716d5e0f5
|
||||
go.vocdoni.io/proto v1.0.4-0.20210726091234-bceaf416353b
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954
|
||||
go.vocdoni.io/dvote v1.0.4-0.20211224171421-4172e1643820
|
||||
go.vocdoni.io/proto v1.13.3-0.20211213155005-46b4177904ba
|
||||
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user