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

Method Sign

types/request_type.go:140–150  ·  view source on GitHub ↗

Sign the request.

(signer *asymmetric.PrivateKey)

Source from the content-addressed store, hash-verified

138
139// Sign the request.
140func (r *Request) Sign(signer *asymmetric.PrivateKey) (err error) {
141 // set query count
142 r.Header.BatchCount = uint64(len(r.Payload.Queries))
143
144 // compute payload hash
145 if err = buildHash(&r.Payload, &r.Header.QueriesHash); err != nil {
146 return
147 }
148
149 return r.Header.Sign(signer)
150}
151
152// SetMarshalCache sets _marshalCache.
153func (r *Request) SetMarshalCache(buf []byte) {

Callers 8

sendQueryMethod · 0.95
TestRequest_SignFunction · 0.95
BenchmarkEncodeFunction · 0.95
createRandomQueryRequestFunction · 0.95
BenchmarkDBWriteFunction · 0.95
BenchmarkSignSignatureFunction · 0.95
TestComputeMetricsFunction · 0.95
sendQueryMethod · 0.95

Calls 2

buildHashFunction · 0.85
SignMethod · 0.65

Tested by 6

TestRequest_SignFunction · 0.76
BenchmarkEncodeFunction · 0.76
createRandomQueryRequestFunction · 0.76
BenchmarkDBWriteFunction · 0.76
BenchmarkSignSignatureFunction · 0.76
TestComputeMetricsFunction · 0.76