/
exec.go
executable file
·41 lines (35 loc) · 1.35 KB
/
exec.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
// 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 executor
import (
"github.com/33cn/chain33/types"
rt "github.com/33cn/plugin/plugin/dapp/retrieve/types"
)
// Exec_Backup Action
func (c *Retrieve) Exec_Backup(backup *rt.BackupRetrieve, tx *types.Transaction, index int) (*types.Receipt, error) {
actiondb := NewRetrieveAcction(c, tx)
if backup.DelayPeriod < minPeriod {
return nil, rt.ErrRetrievePeriodLimit
}
rlog.Debug("RetrieveBackup action")
return actiondb.RetrieveBackup(backup)
}
// Exec_Perform Action
func (c *Retrieve) Exec_Perform(perf *rt.PerformRetrieve, tx *types.Transaction, index int) (*types.Receipt, error) {
actiondb := NewRetrieveAcction(c, tx)
rlog.Debug("PerformRetrieve action")
return actiondb.RetrievePerform(perf)
}
// Exec_Prepare Action
func (c *Retrieve) Exec_Prepare(pre *rt.PrepareRetrieve, tx *types.Transaction, index int) (*types.Receipt, error) {
actiondb := NewRetrieveAcction(c, tx)
rlog.Debug("PreRetrieve action")
return actiondb.RetrievePrepare(pre)
}
// Exec_Cancel Action
func (c *Retrieve) Exec_Cancel(cancel *rt.CancelRetrieve, tx *types.Transaction, index int) (*types.Receipt, error) {
actiondb := NewRetrieveAcction(c, tx)
rlog.Debug("PreRetrieve action")
return actiondb.RetrieveCancel(cancel)
}