Repository navigation
Expand file tree
/
Copy pathregistry_test.go
More file actions
67 lines (50 loc) · 1.55 KB
/
Copy pathregistry_test.go
File metadata and controls
67 lines (50 loc) · 1.55 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package plugins
import (
"context"
"github.com/itering/subscan-plugin"
"github.com/itering/subscan-plugin/router"
"github.com/itering/subscan-plugin/storage"
"github.com/shopspring/decimal"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli"
"testing"
)
type TPlugin struct{}
func (a *TPlugin) Commands() []cli.Command {
return nil
}
func (a *TPlugin) ProcessBlock(ctx context.Context, block *storage.Block) error {
return nil
}
func (a *TPlugin) SetRedisPool(pool subscan_plugin.RedisPool) {
}
func (a *TPlugin) Enable() bool {
return true
}
func (a *TPlugin) ConsumptionQueue() []string {
// TODO implement me
panic("implement me")
}
func (a *TPlugin) ExecWorker(ctx context.Context, queue, class string, raw interface{}) error {
// TODO implement me
panic("implement me")
}
func (a *TPlugin) InitDao(d storage.Dao) {}
func (a *TPlugin) InitHttp() []router.Http { return nil }
func (a *TPlugin) ProcessExtrinsic(block *storage.Block, extrinsic *storage.Extrinsic, events []storage.Event) error {
return nil
}
func (a *TPlugin) ProcessEvent(block *storage.Block, event *storage.Event, fee decimal.Decimal) error {
return nil
}
func (a *TPlugin) Migrate() {}
func (a *TPlugin) Version() string { return "0.1" }
func (a *TPlugin) SubscribeExtrinsic() []string { return nil }
func (a *TPlugin) SubscribeEvent() []string { return nil }
func TestRegister(t *testing.T) {
register("test", &TPlugin{})
register("test2", nil)
register("test", &TPlugin{})
assert.NotNil(t, RegisteredPlugins["test"])
assert.Nil(t, RegisteredPlugins["test2"])
}