MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / transferToken

Method transferToken

cmd/cql-eth-exchange/exchange.go:606–628  ·  view source on GitHub ↗
(target proto.AccountAddress, nonce cinter.AccountNonce, amount uint64)

Source from the content-addressed store, hash-verified

604}
605
606func (e *Exchange) transferToken(target proto.AccountAddress, nonce cinter.AccountNonce, amount uint64) (txHash hash.Hash, err error) {
607 var (
608 req = new(ctypes.AddTxReq)
609 resp = new(ctypes.AddTxResp)
610 tx = ctypes.NewTransfer(&ctypes.TransferHeader{
611 Sender: e.vaultAddress,
612 Receiver: target,
613 Nonce: nonce,
614 TokenType: e.cfg.TokenType,
615 Amount: amount,
616 })
617 )
618
619 if err = tx.Sign(e.vaultPrivateKey); err != nil {
620 return
621 }
622
623 req.Tx = tx
624 txHash = tx.Hash()
625 err = mux.RequestBP(route.MCCAddTx.String(), req, resp)
626
627 return
628}

Callers 1

processPendingTxsMethod · 0.95

Calls 4

RequestBPFunction · 0.92
SignMethod · 0.65
HashMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected