forked from 33cn/plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
norm.go
52 lines (42 loc) · 1012 Bytes
/
norm.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
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package types
import (
"github.com/33cn/chain33/types"
)
// NormX name
var NormX = "norm"
func init() {
types.AllowUserExec = append(types.AllowUserExec, []byte(NormX))
types.RegistorExecutor(NormX, NewType())
types.RegisterDappFork(NormX, "Enable", 0)
}
// NormType def
type NormType struct {
types.ExecTypeBase
}
// NewType method
func NewType() *NormType {
c := &NormType{}
c.SetChild(c)
return c
}
// GetName 获取执行器名称
func (norm *NormType) GetName() string {
return NormX
}
// GetPayload method
func (norm *NormType) GetPayload() types.Message {
return &NormAction{}
}
// GetTypeMap method
func (norm *NormType) GetTypeMap() map[string]int32 {
return map[string]int32{
"Nput": NormActionPut,
}
}
// GetLogMap method
func (norm *NormType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{}
}