-
Notifications
You must be signed in to change notification settings - Fork 13
/
ownership.go
40 lines (32 loc) · 928 Bytes
/
ownership.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: ISC
// Copyright (c) 2014-2020 Bitmark Inc.
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package ownership
import (
"github.com/bitmark-inc/bitmarkd/account"
"github.com/bitmark-inc/bitmarkd/storage"
)
// Ownership - interface for ownership
type Ownership interface {
ListBitmarksFor(*account.Account, uint64, int) ([]Record, error)
}
type ownership struct {
PoolOwnerList storage.Handle
PoolOwnerData storage.Handle
}
func (o ownership) ListBitmarksFor(owner *account.Account, start uint64, count int) ([]Record, error) {
return listBitmarksFor(owner, start, count)
}
var data ownership
// Initialise - initialise ownership
func Initialise(ownerList, ownerData storage.Handle) {
data = ownership{
PoolOwnerList: ownerList,
PoolOwnerData: ownerData,
}
}
// Get - return Record interface
func Get() Ownership {
return &data
}