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

Function AddTokenApplyRecord

cmd/cql-proxy/model/faucet.go:70–88  ·  view source on GitHub ↗

AddTokenApplyRecord add new token apply record to database.

(db *gorp.DbMap, developer int64, account utils.AccountAddress, amount uint64)

Source from the content-addressed store, hash-verified

68
69// AddTokenApplyRecord add new token apply record to database.
70func AddTokenApplyRecord(db *gorp.DbMap, developer int64, account utils.AccountAddress, amount uint64) (r *TokenApply, err error) {
71 applicationID := uuid.Must(uuid.NewV4()).String()
72
73 r = &TokenApply{
74 ID: applicationID,
75 Account: account,
76 Developer: developer,
77 Amount: amount,
78 Created: time.Now().Unix(),
79 }
80
81 err = db.Insert(r)
82
83 if err != nil {
84 err = errors.Wrapf(err, "add token apply record failed")
85 }
86
87 return
88}

Callers 1

ApplyTokenTaskFunction · 0.92

Calls 2

InsertMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected