github.com/koko1123/flow-go-1@v0.29.6/engine/access/rest/request/create_transaction.go (about) 1 package request 2 3 import ( 4 "io" 5 6 "github.com/koko1123/flow-go-1/model/flow" 7 ) 8 9 type CreateTransaction struct { 10 Transaction flow.TransactionBody 11 } 12 13 func (c *CreateTransaction) Build(r *Request) error { 14 return c.Parse(r.Body, r.Chain) 15 } 16 17 func (c *CreateTransaction) Parse(rawTransaction io.Reader, chain flow.Chain) error { 18 var tx Transaction 19 err := tx.Parse(rawTransaction, chain) 20 if err != nil { 21 return err 22 } 23 24 c.Transaction = tx.Flow() 25 return nil 26 }