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

Function setupChain

xenomint/chain_test.go:37–53  ·  view source on GitHub ↗
(testName string)

Source from the content-addressed store, hash-verified

35)
36
37func setupChain(testName string) (c *Chain, err error) {
38 // Setup chain state
39 var (
40 fl = path.Join(testingDataDir, strings.Replace(testName, "/", "-", -1))
41 )
42 if c, err = NewChain(fmt.Sprint("file:", fl)); err != nil {
43 err = errors.Wrap(err, "failed to setup bench environment: ")
44 return
45 }
46 if _, err = c.state.strg.Writer().Exec(
47 `CREATE TABLE "bench" ("k" INT, "v1" TEXT, "v2" TEXT, "v3" TEXT, PRIMARY KEY("k"))`,
48 ); err != nil {
49 err = errors.Wrap(err, "failed to setup bench environment: ")
50 return
51 }
52 return
53}
54
55func setupBenchmarkChainRequest(b *testing.B) (r []*types.Request) {
56 // Setup query requests

Callers 3

setupBenchmarkChainFunction · 0.85
TestChainFunction · 0.85
TestMuxServiceFunction · 0.85

Calls 3

NewChainFunction · 0.70
ExecMethod · 0.65
WriterMethod · 0.65

Tested by

no test coverage detected