Skip to content

Commit

Permalink
Added token.transfer in BIOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Vachon committed Oct 16, 2019
1 parent c41984f commit 983e045
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions bios/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var operationsRegistry = map[string]Operation{
"system.setpriv": &OpSetPriv{},
"token.create": &OpCreateToken{},
"token.issue": &OpIssueToken{},
"token.transfer": &OpTransferToken{},
"system.setprods": &OpSetProds{},
"snapshot.create_accounts": &OpSnapshotCreateAccounts{},
"snapshot.load_unregistered": &OpInjectUnregdSnapshot{},
Expand Down Expand Up @@ -209,6 +210,20 @@ func (op *OpIssueToken) Actions(b *BIOS) (out []*eos.Action, err error) {

//

type OpTransferToken struct {
From eos.AccountName
To eos.AccountName
Quantity eos.Asset
Memo string
}

func (op *OpTransferToken) Actions(b *BIOS) (out []*eos.Action, err error) {
act := token.NewTransfer(op.From, op.To, op.Quantity, op.Memo)
return append(out, act), nil
}

//

type OpSnapshotCreateAccounts struct {
BuyRAMBytes uint64 `json:"buy_ram_bytes"`
TestnetTruncateSnapshot int `json:"TESTNET_TRUNCATE_SNAPSHOT"`
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/abourget/llerrgroup v0.0.0-20161118145731-75f536392d17
github.com/bronze1man/go-yaml2json v0.0.0-20150129175009-f6f64b738964
github.com/davecgh/go-spew v1.1.1
github.com/eoscanada/eos-go v0.8.14-0.20190614154328-0014a42badb5
github.com/eoscanada/eos-go v0.8.16-0.20190628070134-3da66e8f192f
github.com/golang/protobuf v1.3.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 // indirect
Expand Down Expand Up @@ -36,3 +36,5 @@ require (
google.golang.org/appengine v0.0.0-20150527042145-b667a5000b08 // indirect
gopkg.in/olivere/elastic.v3 v3.0.75
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ github.com/eoscanada/eos-go v0.8.13 h1:2U6a+cj+VygmcrKP8Y2op1qukynXUTfhyhKrysjPm
github.com/eoscanada/eos-go v0.8.13/go.mod h1:RKrm2XzZEZWxSMTRqH5QOyJ1fb/qKEjs2ix1aQl0sk4=
github.com/eoscanada/eos-go v0.8.14-0.20190614154328-0014a42badb5 h1:6Y6xlTLOaY7Uzb/aarC4hpqkztamhpyX8ELGXFRre00=
github.com/eoscanada/eos-go v0.8.14-0.20190614154328-0014a42badb5/go.mod h1:RKrm2XzZEZWxSMTRqH5QOyJ1fb/qKEjs2ix1aQl0sk4=
github.com/eoscanada/eos-go v0.8.16-0.20190628070134-3da66e8f192f h1:xYUwaaX306tPPBeLRIq7vDQv/TLAunkBbeWIlB7EaCI=
github.com/eoscanada/eos-go v0.8.16-0.20190628070134-3da66e8f192f/go.mod h1:RKrm2XzZEZWxSMTRqH5QOyJ1fb/qKEjs2ix1aQl0sk4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
Expand Down

0 comments on commit 983e045

Please sign in to comment.