"github.com/vapor/account"
"github.com/vapor/blockchain/txbuilder"
"github.com/vapor/errors"
- "github.com/vapor/net/http/reqid"
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/bc/types"
)
decoders := map[string]func([]byte) (txbuilder.Action, error){
"control_address": txbuilder.DecodeControlAddressAction,
"control_program": txbuilder.DecodeControlProgramAction,
- "issue": a.wallet.AssetReg.DecodeIssueAction,
+ "cross_chain_out": txbuilder.DecodeCrossOutAction,
+ "vote_output": txbuilder.DecodeVoteOutputAction,
"retire": txbuilder.DecodeRetireAction,
+ "cross_chain_in": txbuilder.DecodeCrossInAction,
"spend_account": a.wallet.AccountMgr.DecodeSpendAction,
"spend_account_unspent_output": a.wallet.AccountMgr.DecodeSpendUTXOAction,
+ "veto": a.wallet.AccountMgr.DecodeVetoAction,
}
decoder, ok := decoders[action]
return decoder, ok
// POST /build-transaction
func (a *API) build(ctx context.Context, buildReqs *BuildRequest) Response {
- subctx := reqid.NewSubContext(ctx, reqid.New())
- tmpl, err := a.buildSingle(subctx, buildReqs)
+ tmpl, err := a.buildSingle(ctx, buildReqs)
if err != nil {
return NewErrorResponse(err)
}
// POST /build-chain-transactions
func (a *API) buildChainTxs(ctx context.Context, buildReqs *BuildRequest) Response {
- subctx := reqid.NewSubContext(ctx, reqid.New())
- tmpls, err := a.buildTxs(subctx, buildReqs)
+ tmpls, err := a.buildTxs(ctx, buildReqs)
if err != nil {
return NewErrorResponse(err)
}