/
canceldelay.go
33 lines (29 loc) · 981 Bytes
/
canceldelay.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
package system
import "github.com/eoscanada/eos-go"
// NewCancelDelay creates an action from the `eosio.system` contract
// called `canceldelay`.
//
// `canceldelay` allows you to cancel a deferred transaction,
// previously sent to the chain with a `delay_sec` larger than 0. You
// need to sign with cancelingAuth, to cancel a transaction signed
// with that same authority.
func NewCancelDelay(cancelingAuth eos.PermissionLevel, transactionID eos.Checksum256) *eos.Action {
a := &eos.Action{
Account: AN("eosio"),
Name: ActN("canceldelay"),
Authorization: []eos.PermissionLevel{
cancelingAuth,
},
ActionData: eos.NewActionData(CancelDelay{
CancelingAuth: cancelingAuth,
TransactionID: transactionID,
}),
}
return a
}
// CancelDelay represents the native `canceldelay` action, through the
// system contract.
type CancelDelay struct {
CancelingAuth eos.PermissionLevel `json:"canceling_auth"`
TransactionID eos.Checksum256 `json:"trx_id"`
}