The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
woop/staking/slash/report.go

28 lines
613 B

package slash
import (
"io/ioutil"
"gopkg.in/yaml.v2"
)
// DoubleSignWebHooks ..
type DoubleSignWebHooks struct {
WebHooks struct {
OnNoticeDoubleSign string `yaml:"notice-double-sign"`
OnThisNodeDoubleSigned string `yaml:"this-node-double-signed"`
} `yaml:"web-hooks"`
}
// NewDoubleSignWebHooksFromPath ..
func NewDoubleSignWebHooksFromPath(yamlPath string) (*DoubleSignWebHooks, error) {
rawYAML, err := ioutil.ReadFile(yamlPath)
if err != nil {
return nil, err
}
t := DoubleSignWebHooks{}
if err := yaml.UnmarshalStrict(rawYAML, &t); err != nil {
return nil, err
}
return &t, nil
}