-
Notifications
You must be signed in to change notification settings - Fork 1
/
exec.go
40 lines (32 loc) · 1.36 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
// 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/assetcloud/chain/types"
rty "github.com/assetcloud/plugin/plugin/dapp/relay/types"
)
func (r *relay) Exec_Create(payload *rty.RelayCreate, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newRelayDB(r, tx)
return action.create(payload)
}
func (r *relay) Exec_Accept(payload *rty.RelayAccept, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newRelayDB(r, tx)
return action.accept(payload)
}
func (r *relay) Exec_Revoke(payload *rty.RelayRevoke, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newRelayDB(r, tx)
return action.relayRevoke(payload)
}
func (r *relay) Exec_ConfirmTx(payload *rty.RelayConfirmTx, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newRelayDB(r, tx)
return action.confirmTx(payload)
}
func (r *relay) Exec_Verify(payload *rty.RelayVerify, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newRelayDB(r, tx)
return action.verifyTx(payload)
}
func (r *relay) Exec_BtcHeaders(payload *rty.BtcHeaders, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newRelayDB(r, tx)
return action.saveBtcHeader(payload, r.GetLocalDB())
}