id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
27,000 | hyperledger/burrow | event/emitter.go | UnsubscribeAll | func (em *Emitter) UnsubscribeAll(ctx context.Context, subscriber string) error {
return em.pubsubServer.UnsubscribeAll(ctx, subscriber)
} | go | func (em *Emitter) UnsubscribeAll(ctx context.Context, subscriber string) error {
return em.pubsubServer.UnsubscribeAll(ctx, subscriber)
} | [
"func",
"(",
"em",
"*",
"Emitter",
")",
"UnsubscribeAll",
"(",
"ctx",
"context",
".",
"Context",
",",
"subscriber",
"string",
")",
"error",
"{",
"return",
"em",
".",
"pubsubServer",
".",
"UnsubscribeAll",
"(",
"ctx",
",",
"subscriber",
")",
"\n",
"}"
] | // UnsubscribeAll just stop listening for all messages | [
"UnsubscribeAll",
"just",
"stop",
"listening",
"for",
"all",
"messages"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/event/emitter.go#L88-L90 |
27,001 | hyperledger/burrow | logging/loggers/capture_logger.go | SetPassthrough | func (cl *CaptureLogger) SetPassthrough(passthrough bool) {
cl.Lock()
defer cl.Unlock()
cl.passthrough = passthrough
} | go | func (cl *CaptureLogger) SetPassthrough(passthrough bool) {
cl.Lock()
defer cl.Unlock()
cl.passthrough = passthrough
} | [
"func",
"(",
"cl",
"*",
"CaptureLogger",
")",
"SetPassthrough",
"(",
"passthrough",
"bool",
")",
"{",
"cl",
".",
"Lock",
"(",
")",
"\n",
"defer",
"cl",
".",
"Unlock",
"(",
")",
"\n",
"cl",
".",
"passthrough",
"=",
"passthrough",
"\n",
"}"
] | // Sets whether the CaptureLogger is forwarding log lines sent to it through
// to its output logger. Concurrently safe. | [
"Sets",
"whether",
"the",
"CaptureLogger",
"is",
"forwarding",
"log",
"lines",
"sent",
"to",
"it",
"through",
"to",
"its",
"output",
"logger",
".",
"Concurrently",
"safe",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/loggers/capture_logger.go#L58-L62 |
27,002 | hyperledger/burrow | logging/loggers/capture_logger.go | Passthrough | func (cl *CaptureLogger) Passthrough() bool {
cl.RLock()
defer cl.RUnlock()
return cl.passthrough
} | go | func (cl *CaptureLogger) Passthrough() bool {
cl.RLock()
defer cl.RUnlock()
return cl.passthrough
} | [
"func",
"(",
"cl",
"*",
"CaptureLogger",
")",
"Passthrough",
"(",
")",
"bool",
"{",
"cl",
".",
"RLock",
"(",
")",
"\n",
"defer",
"cl",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"cl",
".",
"passthrough",
"\n",
"}"
] | // Gets whether the CaptureLogger is forwarding log lines sent to through to its
// OutputLogger. Concurrently Safe. | [
"Gets",
"whether",
"the",
"CaptureLogger",
"is",
"forwarding",
"log",
"lines",
"sent",
"to",
"through",
"to",
"its",
"OutputLogger",
".",
"Concurrently",
"Safe",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/loggers/capture_logger.go#L66-L70 |
27,003 | hyperledger/burrow | util/logging/cmd/main.go | main | func main() {
loggingConfig := &LoggingConfig{
RootSink: Sink().
AddSinks(
// Log everything to Stderr
Sink().SetOutput(StderrOutput()),
Sink().SetTransform(FilterTransform(ExcludeWhenAllMatch,
"module", "p2p",
"captured_logging_source", "tendermint_log15")).
AddSinks(
Sink().SetO... | go | func main() {
loggingConfig := &LoggingConfig{
RootSink: Sink().
AddSinks(
// Log everything to Stderr
Sink().SetOutput(StderrOutput()),
Sink().SetTransform(FilterTransform(ExcludeWhenAllMatch,
"module", "p2p",
"captured_logging_source", "tendermint_log15")).
AddSinks(
Sink().SetO... | [
"func",
"main",
"(",
")",
"{",
"loggingConfig",
":=",
"&",
"LoggingConfig",
"{",
"RootSink",
":",
"Sink",
"(",
")",
".",
"AddSinks",
"(",
"// Log everything to Stderr",
"Sink",
"(",
")",
".",
"SetOutput",
"(",
"StderrOutput",
"(",
")",
")",
",",
"Sink",
... | // Dump an example logging configuration | [
"Dump",
"an",
"example",
"logging",
"configuration"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/util/logging/cmd/main.go#L24-L39 |
27,004 | hyperledger/burrow | logging/logger.go | NewLogger | func NewLogger(outputLogger log.Logger) *Logger {
// We will never halt the progress of a log emitter. If log output takes too
// long will start dropping log lines by using a ring buffer.
swapLogger := new(log.SwapLogger)
swapLogger.Swap(outputLogger)
return &Logger{
Output: swapLogger,
// logging contexts
... | go | func NewLogger(outputLogger log.Logger) *Logger {
// We will never halt the progress of a log emitter. If log output takes too
// long will start dropping log lines by using a ring buffer.
swapLogger := new(log.SwapLogger)
swapLogger.Swap(outputLogger)
return &Logger{
Output: swapLogger,
// logging contexts
... | [
"func",
"NewLogger",
"(",
"outputLogger",
"log",
".",
"Logger",
")",
"*",
"Logger",
"{",
"// We will never halt the progress of a log emitter. If log output takes too",
"// long will start dropping log lines by using a ring buffer.",
"swapLogger",
":=",
"new",
"(",
"log",
".",
... | // Create an InfoTraceLogger by passing the initial outputLogger. | [
"Create",
"an",
"InfoTraceLogger",
"by",
"passing",
"the",
"initial",
"outputLogger",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logger.go#L44-L59 |
27,005 | hyperledger/burrow | logging/logger.go | SwapOutput | func (l *Logger) SwapOutput(infoLogger log.Logger) {
l.Output.Swap(infoLogger)
} | go | func (l *Logger) SwapOutput(infoLogger log.Logger) {
l.Output.Swap(infoLogger)
} | [
"func",
"(",
"l",
"*",
"Logger",
")",
"SwapOutput",
"(",
"infoLogger",
"log",
".",
"Logger",
")",
"{",
"l",
".",
"Output",
".",
"Swap",
"(",
"infoLogger",
")",
"\n",
"}"
] | // Hot swap the underlying outputLogger with another one to re-route messages | [
"Hot",
"swap",
"the",
"underlying",
"outputLogger",
"with",
"another",
"one",
"to",
"re",
"-",
"route",
"messages"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logger.go#L127-L129 |
27,006 | hyperledger/burrow | logging/logger.go | InfoMsg | func (l *Logger) InfoMsg(message string, keyvals ...interface{}) error {
return Msg(l.Info, message, keyvals...)
} | go | func (l *Logger) InfoMsg(message string, keyvals ...interface{}) error {
return Msg(l.Info, message, keyvals...)
} | [
"func",
"(",
"l",
"*",
"Logger",
")",
"InfoMsg",
"(",
"message",
"string",
",",
"keyvals",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"Msg",
"(",
"l",
".",
"Info",
",",
"message",
",",
"keyvals",
"...",
")",
"\n",
"}"
] | // Record structured Info lo`g line with a message | [
"Record",
"structured",
"Info",
"lo",
"g",
"line",
"with",
"a",
"message"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logger.go#L132-L134 |
27,007 | hyperledger/burrow | logging/logger.go | TraceMsg | func (l *Logger) TraceMsg(message string, keyvals ...interface{}) error {
return Msg(l.Trace, message, keyvals...)
} | go | func (l *Logger) TraceMsg(message string, keyvals ...interface{}) error {
return Msg(l.Trace, message, keyvals...)
} | [
"func",
"(",
"l",
"*",
"Logger",
")",
"TraceMsg",
"(",
"message",
"string",
",",
"keyvals",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"Msg",
"(",
"l",
".",
"Trace",
",",
"message",
",",
"keyvals",
"...",
")",
"\n",
"}"
] | // Record structured Trace log line with a message | [
"Record",
"structured",
"Trace",
"log",
"line",
"with",
"a",
"message"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logger.go#L137-L139 |
27,008 | hyperledger/burrow | logging/logger.go | WithScope | func (l *Logger) WithScope(scopeName string) *Logger {
// InfoTraceLogger will collapse successive (ScopeKey, scopeName) pairs into a vector in the order which they appear
return l.With(structure.ScopeKey, scopeName)
} | go | func (l *Logger) WithScope(scopeName string) *Logger {
// InfoTraceLogger will collapse successive (ScopeKey, scopeName) pairs into a vector in the order which they appear
return l.With(structure.ScopeKey, scopeName)
} | [
"func",
"(",
"l",
"*",
"Logger",
")",
"WithScope",
"(",
"scopeName",
"string",
")",
"*",
"Logger",
"{",
"// InfoTraceLogger will collapse successive (ScopeKey, scopeName) pairs into a vector in the order which they appear",
"return",
"l",
".",
"With",
"(",
"structure",
".",... | // Establish or extend the scope of this logger by appending scopeName to the Scope vector.
// Like With the logging scope is append only but can be used to provide parenthetical scopes by hanging on to the
// parent scope and using once the scope has been exited. The scope mechanism does is agnostic to the type of sco... | [
"Establish",
"or",
"extend",
"the",
"scope",
"of",
"this",
"logger",
"by",
"appending",
"scopeName",
"to",
"the",
"Scope",
"vector",
".",
"Like",
"With",
"the",
"logging",
"scope",
"is",
"append",
"only",
"but",
"can",
"be",
"used",
"to",
"provide",
"paren... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logger.go#L145-L148 |
27,009 | hyperledger/burrow | logging/logger.go | Msg | func Msg(logger log.Logger, message string, keyvals ...interface{}) error {
prepended := structure.CopyPrepend(keyvals, structure.MessageKey, message)
return logger.Log(prepended...)
} | go | func Msg(logger log.Logger, message string, keyvals ...interface{}) error {
prepended := structure.CopyPrepend(keyvals, structure.MessageKey, message)
return logger.Log(prepended...)
} | [
"func",
"Msg",
"(",
"logger",
"log",
".",
"Logger",
",",
"message",
"string",
",",
"keyvals",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"prepended",
":=",
"structure",
".",
"CopyPrepend",
"(",
"keyvals",
",",
"structure",
".",
"MessageKey",
",",
"... | // Record a structured log line with a message | [
"Record",
"a",
"structured",
"log",
"line",
"with",
"a",
"message"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logger.go#L151-L154 |
27,010 | hyperledger/burrow | crypto/sha3/sha3.go | unalignedAbsorb | func (d *digest) unalignedAbsorb(p []byte) {
var t uint64
for i := len(p) - 1; i >= 0; i-- {
t <<= 8
t |= uint64(p[i])
}
offset := (d.absorbed) % d.rate()
t <<= 8 * uint(offset%laneSize)
d.a[offset/laneSize] ^= t
d.absorbed += len(p)
} | go | func (d *digest) unalignedAbsorb(p []byte) {
var t uint64
for i := len(p) - 1; i >= 0; i-- {
t <<= 8
t |= uint64(p[i])
}
offset := (d.absorbed) % d.rate()
t <<= 8 * uint(offset%laneSize)
d.a[offset/laneSize] ^= t
d.absorbed += len(p)
} | [
"func",
"(",
"d",
"*",
"digest",
")",
"unalignedAbsorb",
"(",
"p",
"[",
"]",
"byte",
")",
"{",
"var",
"t",
"uint64",
"\n",
"for",
"i",
":=",
"len",
"(",
"p",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
"{",
"t",
"<<=",
"8",
"\n",
... | // unalignedAbsorb is a helper function for Write, which absorbs data that isn't aligned with an
// 8-byte lane. This requires shifting the individual bytes into position in a uint64. | [
"unalignedAbsorb",
"is",
"a",
"helper",
"function",
"for",
"Write",
"which",
"absorbs",
"data",
"that",
"isn",
"t",
"aligned",
"with",
"an",
"8",
"-",
"byte",
"lane",
".",
"This",
"requires",
"shifting",
"the",
"individual",
"bytes",
"into",
"position",
"in"... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/crypto/sha3/sha3.go#L89-L99 |
27,011 | hyperledger/burrow | crypto/sha3/sha3.go | Sum | func (d *digest) Sum(in []byte) []byte {
// Make a copy of the original hash so that caller can keep writing and summing.
dup := *d
dup.finalize()
return dup.squeeze(in, dup.outputSize)
} | go | func (d *digest) Sum(in []byte) []byte {
// Make a copy of the original hash so that caller can keep writing and summing.
dup := *d
dup.finalize()
return dup.squeeze(in, dup.outputSize)
} | [
"func",
"(",
"d",
"*",
"digest",
")",
"Sum",
"(",
"in",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"// Make a copy of the original hash so that caller can keep writing and summing.",
"dup",
":=",
"*",
"d",
"\n",
"dup",
".",
"finalize",
"(",
")",
"\n",
"re... | // Sum applies padding to the hash state and then squeezes out the desired nubmer of output bytes. | [
"Sum",
"applies",
"padding",
"to",
"the",
"hash",
"state",
"and",
"then",
"squeezes",
"out",
"the",
"desired",
"nubmer",
"of",
"output",
"bytes",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/crypto/sha3/sha3.go#L203-L208 |
27,012 | hyperledger/burrow | logging/lifecycle/lifecycle.go | NewLoggerFromLoggingConfig | func NewLoggerFromLoggingConfig(loggingConfig *logconfig.LoggingConfig) (*logging.Logger, error) {
if loggingConfig == nil {
return NewStdErrLogger()
} else {
outputLogger, errCh, err := loggerFromLoggingConfig(loggingConfig)
if err != nil {
return nil, err
}
logger := logging.NewLogger(outputLogger)
i... | go | func NewLoggerFromLoggingConfig(loggingConfig *logconfig.LoggingConfig) (*logging.Logger, error) {
if loggingConfig == nil {
return NewStdErrLogger()
} else {
outputLogger, errCh, err := loggerFromLoggingConfig(loggingConfig)
if err != nil {
return nil, err
}
logger := logging.NewLogger(outputLogger)
i... | [
"func",
"NewLoggerFromLoggingConfig",
"(",
"loggingConfig",
"*",
"logconfig",
".",
"LoggingConfig",
")",
"(",
"*",
"logging",
".",
"Logger",
",",
"error",
")",
"{",
"if",
"loggingConfig",
"==",
"nil",
"{",
"return",
"NewStdErrLogger",
"(",
")",
"\n",
"}",
"e... | // Lifecycle provides a canonical source for burrow loggers. Components should use the functions here
// to set up their root logger and capture any other logging output.
// Obtain a logger from a LoggingConfig | [
"Lifecycle",
"provides",
"a",
"canonical",
"source",
"for",
"burrow",
"loggers",
".",
"Components",
"should",
"use",
"the",
"functions",
"here",
"to",
"set",
"up",
"their",
"root",
"logger",
"and",
"capture",
"any",
"other",
"logging",
"output",
".",
"Obtain",... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/lifecycle/lifecycle.go#L37-L57 |
27,013 | hyperledger/burrow | logging/lifecycle/lifecycle.go | SwapOutputLoggersFromLoggingConfig | func SwapOutputLoggersFromLoggingConfig(logger *logging.Logger, loggingConfig *logconfig.LoggingConfig) (error, channels.Channel) {
outputLogger, errCh, err := loggerFromLoggingConfig(loggingConfig)
if err != nil {
return err, channels.NewDeadChannel()
}
logger.SwapOutput(outputLogger)
return nil, errCh
} | go | func SwapOutputLoggersFromLoggingConfig(logger *logging.Logger, loggingConfig *logconfig.LoggingConfig) (error, channels.Channel) {
outputLogger, errCh, err := loggerFromLoggingConfig(loggingConfig)
if err != nil {
return err, channels.NewDeadChannel()
}
logger.SwapOutput(outputLogger)
return nil, errCh
} | [
"func",
"SwapOutputLoggersFromLoggingConfig",
"(",
"logger",
"*",
"logging",
".",
"Logger",
",",
"loggingConfig",
"*",
"logconfig",
".",
"LoggingConfig",
")",
"(",
"error",
",",
"channels",
".",
"Channel",
")",
"{",
"outputLogger",
",",
"errCh",
",",
"err",
":... | // Hot swap logging config by replacing output loggers of passed InfoTraceLogger
// with those built from loggingConfig | [
"Hot",
"swap",
"logging",
"config",
"by",
"replacing",
"output",
"loggers",
"of",
"passed",
"InfoTraceLogger",
"with",
"those",
"built",
"from",
"loggingConfig"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/lifecycle/lifecycle.go#L61-L68 |
27,014 | hyperledger/burrow | execution/evm/abi/abi.go | MergeAbiSpec | func MergeAbiSpec(abiSpec []*AbiSpec) *AbiSpec {
newSpec := AbiSpec{
Events: make(map[string]EventSpec),
EventsById: make(map[EventID]EventSpec),
Functions: make(map[string]FunctionSpec),
}
for _, s := range abiSpec {
for n, f := range s.Functions {
newSpec.Functions[n] = f
}
// Different Abis ... | go | func MergeAbiSpec(abiSpec []*AbiSpec) *AbiSpec {
newSpec := AbiSpec{
Events: make(map[string]EventSpec),
EventsById: make(map[EventID]EventSpec),
Functions: make(map[string]FunctionSpec),
}
for _, s := range abiSpec {
for n, f := range s.Functions {
newSpec.Functions[n] = f
}
// Different Abis ... | [
"func",
"MergeAbiSpec",
"(",
"abiSpec",
"[",
"]",
"*",
"AbiSpec",
")",
"*",
"AbiSpec",
"{",
"newSpec",
":=",
"AbiSpec",
"{",
"Events",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"EventSpec",
")",
",",
"EventsById",
":",
"make",
"(",
"map",
"[",
"Ev... | // MergeAbiSpec takes multiple AbiSpecs and merges them into once structure. Note that
// the same function name or event name can occur in different abis, so there might be
// some information loss. | [
"MergeAbiSpec",
"takes",
"multiple",
"AbiSpecs",
"and",
"merges",
"them",
"into",
"once",
"structure",
".",
"Note",
"that",
"the",
"same",
"function",
"name",
"or",
"event",
"name",
"can",
"occur",
"in",
"different",
"abis",
"so",
"there",
"might",
"be",
"so... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/evm/abi/abi.go#L937-L958 |
27,015 | hyperledger/burrow | execution/evm/abi/abi.go | UnpackRevert | func UnpackRevert(data []byte) (message *string, err error) {
if len(data) > 0 {
var msg string
err = RevertAbi.UnpackWithID(data, &msg)
message = &msg
}
return
} | go | func UnpackRevert(data []byte) (message *string, err error) {
if len(data) > 0 {
var msg string
err = RevertAbi.UnpackWithID(data, &msg)
message = &msg
}
return
} | [
"func",
"UnpackRevert",
"(",
"data",
"[",
"]",
"byte",
")",
"(",
"message",
"*",
"string",
",",
"err",
"error",
")",
"{",
"if",
"len",
"(",
"data",
")",
">",
"0",
"{",
"var",
"msg",
"string",
"\n",
"err",
"=",
"RevertAbi",
".",
"UnpackWithID",
"(",... | // UnpackRevert decodes the revert reason if a contract called revert. If no
// reason was given, message will be nil else it will point to the string | [
"UnpackRevert",
"decodes",
"the",
"revert",
"reason",
"if",
"a",
"contract",
"called",
"revert",
".",
"If",
"no",
"reason",
"was",
"given",
"message",
"will",
"be",
"nil",
"else",
"it",
"will",
"point",
"to",
"the",
"string"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/evm/abi/abi.go#L1090-L1097 |
27,016 | hyperledger/burrow | execution/evm/abi/abi.go | pad | func pad(input []byte, size int, left bool) []byte {
if len(input) >= size {
return input[:size]
}
padded := make([]byte, size)
if left {
copy(padded[size-len(input):], input)
} else {
copy(padded, input)
}
return padded
} | go | func pad(input []byte, size int, left bool) []byte {
if len(input) >= size {
return input[:size]
}
padded := make([]byte, size)
if left {
copy(padded[size-len(input):], input)
} else {
copy(padded, input)
}
return padded
} | [
"func",
"pad",
"(",
"input",
"[",
"]",
"byte",
",",
"size",
"int",
",",
"left",
"bool",
")",
"[",
"]",
"byte",
"{",
"if",
"len",
"(",
"input",
")",
">=",
"size",
"{",
"return",
"input",
"[",
":",
"size",
"]",
"\n",
"}",
"\n",
"padded",
":=",
... | // quick helper padding | [
"quick",
"helper",
"padding"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/evm/abi/abi.go#L1484-L1495 |
27,017 | hyperledger/burrow | permission/base_permissions.go | Get | func (bp BasePermissions) Get(ty PermFlag) (bool, error) {
if ty == 0 {
return false, ErrInvalidPermission(ty)
}
if !bp.IsSet(ty) {
return false, ErrValueNotSet(ty)
}
return bp.Perms&ty == ty, nil
} | go | func (bp BasePermissions) Get(ty PermFlag) (bool, error) {
if ty == 0 {
return false, ErrInvalidPermission(ty)
}
if !bp.IsSet(ty) {
return false, ErrValueNotSet(ty)
}
return bp.Perms&ty == ty, nil
} | [
"func",
"(",
"bp",
"BasePermissions",
")",
"Get",
"(",
"ty",
"PermFlag",
")",
"(",
"bool",
",",
"error",
")",
"{",
"if",
"ty",
"==",
"0",
"{",
"return",
"false",
",",
"ErrInvalidPermission",
"(",
"ty",
")",
"\n",
"}",
"\n",
"if",
"!",
"bp",
".",
... | // Gets the permission value.
// ErrValueNotSet is returned if the permission's set bits are not all on,
// and should be caught by caller so the global permission can be fetched | [
"Gets",
"the",
"permission",
"value",
".",
"ErrValueNotSet",
"is",
"returned",
"if",
"the",
"permission",
"s",
"set",
"bits",
"are",
"not",
"all",
"on",
"and",
"should",
"be",
"caught",
"by",
"caller",
"so",
"the",
"global",
"permission",
"can",
"be",
"fet... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/base_permissions.go#L8-L16 |
27,018 | hyperledger/burrow | permission/base_permissions.go | Set | func (bp *BasePermissions) Set(ty PermFlag, value bool) error {
if ty == 0 {
return ErrInvalidPermission(ty)
}
bp.SetBit |= ty
if value {
bp.Perms |= ty
} else {
bp.Perms &= ^ty
}
return nil
} | go | func (bp *BasePermissions) Set(ty PermFlag, value bool) error {
if ty == 0 {
return ErrInvalidPermission(ty)
}
bp.SetBit |= ty
if value {
bp.Perms |= ty
} else {
bp.Perms &= ^ty
}
return nil
} | [
"func",
"(",
"bp",
"*",
"BasePermissions",
")",
"Set",
"(",
"ty",
"PermFlag",
",",
"value",
"bool",
")",
"error",
"{",
"if",
"ty",
"==",
"0",
"{",
"return",
"ErrInvalidPermission",
"(",
"ty",
")",
"\n",
"}",
"\n",
"bp",
".",
"SetBit",
"|=",
"ty",
"... | // Set a permission bit. Will set the permission's set bit to true. | [
"Set",
"a",
"permission",
"bit",
".",
"Will",
"set",
"the",
"permission",
"s",
"set",
"bit",
"to",
"true",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/base_permissions.go#L19-L30 |
27,019 | hyperledger/burrow | permission/base_permissions.go | Unset | func (bp *BasePermissions) Unset(ty PermFlag) error {
if ty == 0 {
return ErrInvalidPermission(ty)
}
bp.SetBit &= ^ty
return nil
} | go | func (bp *BasePermissions) Unset(ty PermFlag) error {
if ty == 0 {
return ErrInvalidPermission(ty)
}
bp.SetBit &= ^ty
return nil
} | [
"func",
"(",
"bp",
"*",
"BasePermissions",
")",
"Unset",
"(",
"ty",
"PermFlag",
")",
"error",
"{",
"if",
"ty",
"==",
"0",
"{",
"return",
"ErrInvalidPermission",
"(",
"ty",
")",
"\n",
"}",
"\n",
"bp",
".",
"SetBit",
"&=",
"^",
"ty",
"\n",
"return",
... | // Set the permission's set bits to false | [
"Set",
"the",
"permission",
"s",
"set",
"bits",
"to",
"false"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/base_permissions.go#L33-L39 |
27,020 | hyperledger/burrow | permission/base_permissions.go | IsSet | func (bp BasePermissions) IsSet(ty PermFlag) bool {
if ty == 0 {
return false
}
return bp.SetBit&ty == ty
} | go | func (bp BasePermissions) IsSet(ty PermFlag) bool {
if ty == 0 {
return false
}
return bp.SetBit&ty == ty
} | [
"func",
"(",
"bp",
"BasePermissions",
")",
"IsSet",
"(",
"ty",
"PermFlag",
")",
"bool",
"{",
"if",
"ty",
"==",
"0",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"bp",
".",
"SetBit",
"&",
"ty",
"==",
"ty",
"\n",
"}"
] | // Check if the permission is set | [
"Check",
"if",
"the",
"permission",
"is",
"set"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/base_permissions.go#L42-L47 |
27,021 | hyperledger/burrow | permission/base_permissions.go | Compose | func (bp BasePermissions) Compose(bpFallthrough BasePermissions) BasePermissions {
return BasePermissions{
// Combine set perm flags from bp with set perm flags in fallthrough NOT set in bp
Perms: (bp.Perms & bp.SetBit) | (bpFallthrough.Perms & (^bp.SetBit & bpFallthrough.SetBit)),
SetBit: bp.SetBit | bpFallthr... | go | func (bp BasePermissions) Compose(bpFallthrough BasePermissions) BasePermissions {
return BasePermissions{
// Combine set perm flags from bp with set perm flags in fallthrough NOT set in bp
Perms: (bp.Perms & bp.SetBit) | (bpFallthrough.Perms & (^bp.SetBit & bpFallthrough.SetBit)),
SetBit: bp.SetBit | bpFallthr... | [
"func",
"(",
"bp",
"BasePermissions",
")",
"Compose",
"(",
"bpFallthrough",
"BasePermissions",
")",
"BasePermissions",
"{",
"return",
"BasePermissions",
"{",
"// Combine set perm flags from bp with set perm flags in fallthrough NOT set in bp",
"Perms",
":",
"(",
"bp",
".",
... | // Returns a BasePermission that matches any permissions set on this BasePermission
// and falls through to any permissions set on the bpFallthrough | [
"Returns",
"a",
"BasePermission",
"that",
"matches",
"any",
"permissions",
"set",
"on",
"this",
"BasePermission",
"and",
"falls",
"through",
"to",
"any",
"permissions",
"set",
"on",
"the",
"bpFallthrough"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/base_permissions.go#L57-L63 |
27,022 | hyperledger/burrow | core/kernel.go | NewKernel | func NewKernel(dbDir string) (*Kernel, error) {
if dbDir == "" {
return nil, fmt.Errorf("Burrow requires a database directory")
}
runID, err := simpleuuid.NewTime(time.Now()) // Create a random ID based on start time
return &Kernel{
Logger: logging.NewNoopLogger(),
RunID: runID,
Emitter: ... | go | func NewKernel(dbDir string) (*Kernel, error) {
if dbDir == "" {
return nil, fmt.Errorf("Burrow requires a database directory")
}
runID, err := simpleuuid.NewTime(time.Now()) // Create a random ID based on start time
return &Kernel{
Logger: logging.NewNoopLogger(),
RunID: runID,
Emitter: ... | [
"func",
"NewKernel",
"(",
"dbDir",
"string",
")",
"(",
"*",
"Kernel",
",",
"error",
")",
"{",
"if",
"dbDir",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"runID",
",",
"err",
":=",
"s... | // NewKernel initializes an empty kernel | [
"NewKernel",
"initializes",
"an",
"empty",
"kernel"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L85-L100 |
27,023 | hyperledger/burrow | core/kernel.go | SetLogger | func (kern *Kernel) SetLogger(logger *logging.Logger) {
logger = logger.WithScope("NewKernel()").With(structure.TimeKey,
log.DefaultTimestampUTC, structure.RunId, kern.RunID.String())
heightValuer := log.Valuer(func() interface{} { return kern.Blockchain.LastBlockHeight() })
kern.Logger = logger.WithInfo(structure... | go | func (kern *Kernel) SetLogger(logger *logging.Logger) {
logger = logger.WithScope("NewKernel()").With(structure.TimeKey,
log.DefaultTimestampUTC, structure.RunId, kern.RunID.String())
heightValuer := log.Valuer(func() interface{} { return kern.Blockchain.LastBlockHeight() })
kern.Logger = logger.WithInfo(structure... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"SetLogger",
"(",
"logger",
"*",
"logging",
".",
"Logger",
")",
"{",
"logger",
"=",
"logger",
".",
"WithScope",
"(",
"\"",
"\"",
")",
".",
"With",
"(",
"structure",
".",
"TimeKey",
",",
"log",
".",
"DefaultTim... | // SetLogger initializes the kernel with the provided logger | [
"SetLogger",
"initializes",
"the",
"kernel",
"with",
"the",
"provided",
"logger"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L103-L109 |
27,024 | hyperledger/burrow | core/kernel.go | LoadState | func (kern *Kernel) LoadState(genesisDoc *genesis.GenesisDoc) (err error) {
var existing bool
existing, kern.Blockchain, err = bcm.LoadOrNewBlockchain(kern.database, genesisDoc, kern.Logger)
if err != nil {
return fmt.Errorf("error creating or loading blockchain state: %v", err)
}
if existing {
kern.Logger.In... | go | func (kern *Kernel) LoadState(genesisDoc *genesis.GenesisDoc) (err error) {
var existing bool
existing, kern.Blockchain, err = bcm.LoadOrNewBlockchain(kern.database, genesisDoc, kern.Logger)
if err != nil {
return fmt.Errorf("error creating or loading blockchain state: %v", err)
}
if existing {
kern.Logger.In... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"LoadState",
"(",
"genesisDoc",
"*",
"genesis",
".",
"GenesisDoc",
")",
"(",
"err",
"error",
")",
"{",
"var",
"existing",
"bool",
"\n",
"existing",
",",
"kern",
".",
"Blockchain",
",",
"err",
"=",
"bcm",
".",
... | // LoadState starts from scratch or previous chain | [
"LoadState",
"starts",
"from",
"scratch",
"or",
"previous",
"chain"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L112-L151 |
27,025 | hyperledger/burrow | core/kernel.go | LoadDump | func (kern *Kernel) LoadDump(genesisDoc *genesis.GenesisDoc, restoreFile string, silent bool) (err error) {
var exists bool
if exists, kern.Blockchain, err = bcm.LoadOrNewBlockchain(kern.database, genesisDoc, kern.Logger); err != nil {
return fmt.Errorf("error creating or loading blockchain state: %v", err)
}
if... | go | func (kern *Kernel) LoadDump(genesisDoc *genesis.GenesisDoc, restoreFile string, silent bool) (err error) {
var exists bool
if exists, kern.Blockchain, err = bcm.LoadOrNewBlockchain(kern.database, genesisDoc, kern.Logger); err != nil {
return fmt.Errorf("error creating or loading blockchain state: %v", err)
}
if... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"LoadDump",
"(",
"genesisDoc",
"*",
"genesis",
".",
"GenesisDoc",
",",
"restoreFile",
"string",
",",
"silent",
"bool",
")",
"(",
"err",
"error",
")",
"{",
"var",
"exists",
"bool",
"\n",
"if",
"exists",
",",
"ker... | // LoadDump restores chain state from the given dump file | [
"LoadDump",
"restores",
"chain",
"state",
"from",
"the",
"given",
"dump",
"file"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L154-L203 |
27,026 | hyperledger/burrow | core/kernel.go | GetNodeView | func (kern *Kernel) GetNodeView() (*tendermint.NodeView, error) {
if kern.Node == nil {
return nil, nil
}
return tendermint.NewNodeView(kern.Node, kern.txCodec, kern.RunID)
} | go | func (kern *Kernel) GetNodeView() (*tendermint.NodeView, error) {
if kern.Node == nil {
return nil, nil
}
return tendermint.NewNodeView(kern.Node, kern.txCodec, kern.RunID)
} | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"GetNodeView",
"(",
")",
"(",
"*",
"tendermint",
".",
"NodeView",
",",
"error",
")",
"{",
"if",
"kern",
".",
"Node",
"==",
"nil",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"return",
"tendermint",
".... | // GetNodeView builds and returns a wrapper of our tendermint node | [
"GetNodeView",
"builds",
"and",
"returns",
"a",
"wrapper",
"of",
"our",
"tendermint",
"node"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L206-L211 |
27,027 | hyperledger/burrow | core/kernel.go | AddExecutionOptions | func (kern *Kernel) AddExecutionOptions(opts ...execution.ExecutionOption) {
kern.exeOptions = append(kern.exeOptions, opts...)
} | go | func (kern *Kernel) AddExecutionOptions(opts ...execution.ExecutionOption) {
kern.exeOptions = append(kern.exeOptions, opts...)
} | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"AddExecutionOptions",
"(",
"opts",
"...",
"execution",
".",
"ExecutionOption",
")",
"{",
"kern",
".",
"exeOptions",
"=",
"append",
"(",
"kern",
".",
"exeOptions",
",",
"opts",
"...",
")",
"\n",
"}"
] | // AddExecutionOptions extends our execution options | [
"AddExecutionOptions",
"extends",
"our",
"execution",
"options"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L214-L216 |
27,028 | hyperledger/burrow | core/kernel.go | AddProcesses | func (kern *Kernel) AddProcesses(pl ...process.Launcher) {
kern.Launchers = append(kern.Launchers, pl...)
} | go | func (kern *Kernel) AddProcesses(pl ...process.Launcher) {
kern.Launchers = append(kern.Launchers, pl...)
} | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"AddProcesses",
"(",
"pl",
"...",
"process",
".",
"Launcher",
")",
"{",
"kern",
".",
"Launchers",
"=",
"append",
"(",
"kern",
".",
"Launchers",
",",
"pl",
"...",
")",
"\n",
"}"
] | // AddProcesses extends the services that we launch at boot | [
"AddProcesses",
"extends",
"the",
"services",
"that",
"we",
"launch",
"at",
"boot"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L219-L221 |
27,029 | hyperledger/burrow | core/kernel.go | Boot | func (kern *Kernel) Boot() (err error) {
for _, launcher := range kern.Launchers {
if launcher.Enabled {
srvr, err := launcher.Launch()
if err != nil {
return fmt.Errorf("error launching %s server: %v", launcher.Name, err)
}
kern.processes[launcher.Name] = srvr
}
}
go kern.supervise()
return ni... | go | func (kern *Kernel) Boot() (err error) {
for _, launcher := range kern.Launchers {
if launcher.Enabled {
srvr, err := launcher.Launch()
if err != nil {
return fmt.Errorf("error launching %s server: %v", launcher.Name, err)
}
kern.processes[launcher.Name] = srvr
}
}
go kern.supervise()
return ni... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"Boot",
"(",
")",
"(",
"err",
"error",
")",
"{",
"for",
"_",
",",
"launcher",
":=",
"range",
"kern",
".",
"Launchers",
"{",
"if",
"launcher",
".",
"Enabled",
"{",
"srvr",
",",
"err",
":=",
"launcher",
".",
... | // Boot the kernel starting Tendermint and RPC layers | [
"Boot",
"the",
"kernel",
"starting",
"Tendermint",
"and",
"RPC",
"layers"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L247-L260 |
27,030 | hyperledger/burrow | core/kernel.go | supervise | func (kern *Kernel) supervise() {
// perform disaster restarts of the kernel; rejoining the network as if we were a new node.
shutdownCh := make(chan os.Signal, 1)
reloadCh := make(chan os.Signal, 1)
syncCh := make(chan os.Signal, 1)
signal.Notify(shutdownCh, syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL)
sign... | go | func (kern *Kernel) supervise() {
// perform disaster restarts of the kernel; rejoining the network as if we were a new node.
shutdownCh := make(chan os.Signal, 1)
reloadCh := make(chan os.Signal, 1)
syncCh := make(chan os.Signal, 1)
signal.Notify(shutdownCh, syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL)
sign... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"supervise",
"(",
")",
"{",
"// perform disaster restarts of the kernel; rejoining the network as if we were a new node.",
"shutdownCh",
":=",
"make",
"(",
"chan",
"os",
".",
"Signal",
",",
"1",
")",
"\n",
"reloadCh",
":=",
"... | // Supervise kernel once booted | [
"Supervise",
"kernel",
"once",
"booted"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L311-L338 |
27,031 | hyperledger/burrow | core/kernel.go | Shutdown | func (kern *Kernel) Shutdown(ctx context.Context) (err error) {
kern.shutdownOnce.Do(func() {
logger := kern.Logger.WithScope("Shutdown")
logger.InfoMsg("Attempting graceful shutdown...")
logger.InfoMsg("Shutting down servers")
// Shutdown servers in reverse order to boot
for i := len(kern.Launchers) - 1; i ... | go | func (kern *Kernel) Shutdown(ctx context.Context) (err error) {
kern.shutdownOnce.Do(func() {
logger := kern.Logger.WithScope("Shutdown")
logger.InfoMsg("Attempting graceful shutdown...")
logger.InfoMsg("Shutting down servers")
// Shutdown servers in reverse order to boot
for i := len(kern.Launchers) - 1; i ... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"Shutdown",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"kern",
".",
"shutdownOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",
"logger",
":=",
"kern",
".",
"Logger",
".",
"WithSco... | // Shutdown stops the kernel allowing for a graceful shutdown of components in order | [
"Shutdown",
"stops",
"the",
"kernel",
"allowing",
"for",
"a",
"graceful",
"shutdown",
"of",
"components",
"in",
"order"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/kernel.go#L352-L384 |
27,032 | hyperledger/burrow | deploy/jobs/jobs_transact.go | registerNameTx | func registerNameTx(name *def.RegisterName, do *def.DeployArgs, account string, client *def.Client, logger *logging.Logger) (*payload.NameTx, error) {
// Set Defaults
name.Source = useDefault(name.Source, account)
name.Fee = useDefault(name.Fee, do.DefaultFee)
name.Amount = useDefault(name.Amount, do.DefaultAmount)... | go | func registerNameTx(name *def.RegisterName, do *def.DeployArgs, account string, client *def.Client, logger *logging.Logger) (*payload.NameTx, error) {
// Set Defaults
name.Source = useDefault(name.Source, account)
name.Fee = useDefault(name.Fee, do.DefaultFee)
name.Amount = useDefault(name.Amount, do.DefaultAmount)... | [
"func",
"registerNameTx",
"(",
"name",
"*",
"def",
".",
"RegisterName",
",",
"do",
"*",
"def",
".",
"DeployArgs",
",",
"account",
"string",
",",
"client",
"*",
"def",
".",
"Client",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"(",
"*",
"payload"... | // Runs an individual nametx. | [
"Runs",
"an",
"individual",
"nametx",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/deploy/jobs/jobs_transact.go#L137-L157 |
27,033 | hyperledger/burrow | vent/service/decoder.go | decodeEvent | func decodeEvent(header *exec.Header, log *exec.LogEvent, abiSpec *abi.AbiSpec) (map[string]interface{}, error) {
// to prepare decoded data and map to event item name
data := make(map[string]interface{})
var eventID abi.EventID
copy(eventID[:], log.Topics[0].Bytes())
evAbi, ok := abiSpec.EventsById[eventID]
if... | go | func decodeEvent(header *exec.Header, log *exec.LogEvent, abiSpec *abi.AbiSpec) (map[string]interface{}, error) {
// to prepare decoded data and map to event item name
data := make(map[string]interface{})
var eventID abi.EventID
copy(eventID[:], log.Topics[0].Bytes())
evAbi, ok := abiSpec.EventsById[eventID]
if... | [
"func",
"decodeEvent",
"(",
"header",
"*",
"exec",
".",
"Header",
",",
"log",
"*",
"exec",
".",
"LogEvent",
",",
"abiSpec",
"*",
"abi",
".",
"AbiSpec",
")",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"// to prepare... | // decodeEvent unpacks & decodes event data | [
"decodeEvent",
"unpacks",
"&",
"decodes",
"event",
"data"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/service/decoder.go#L15-L56 |
27,034 | hyperledger/burrow | execution/execution.go | NewBatchChecker | func NewBatchChecker(backend ExecutorState, params Params, blockchain contexts.Blockchain, logger *logging.Logger,
options ...ExecutionOption) BatchExecutor {
return newExecutor("CheckCache", false, params, backend, blockchain, nil,
logger.WithScope("NewBatchExecutor"), options...)
} | go | func NewBatchChecker(backend ExecutorState, params Params, blockchain contexts.Blockchain, logger *logging.Logger,
options ...ExecutionOption) BatchExecutor {
return newExecutor("CheckCache", false, params, backend, blockchain, nil,
logger.WithScope("NewBatchExecutor"), options...)
} | [
"func",
"NewBatchChecker",
"(",
"backend",
"ExecutorState",
",",
"params",
"Params",
",",
"blockchain",
"contexts",
".",
"Blockchain",
",",
"logger",
"*",
"logging",
".",
"Logger",
",",
"options",
"...",
"ExecutionOption",
")",
"BatchExecutor",
"{",
"return",
"n... | // Wraps a cache of what is variously known as the 'check cache' and 'mempool' | [
"Wraps",
"a",
"cache",
"of",
"what",
"is",
"variously",
"known",
"as",
"the",
"check",
"cache",
"and",
"mempool"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/execution.go#L114-L119 |
27,035 | hyperledger/burrow | execution/execution.go | Commit | func (exe *executor) Commit(header *abciTypes.Header) (stateHash []byte, err error) {
// The write lock to the executor is controlled by the caller (e.g. abci.App) so we do not acquire it here to avoid
// deadlock
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("recovered from panic in executor.Co... | go | func (exe *executor) Commit(header *abciTypes.Header) (stateHash []byte, err error) {
// The write lock to the executor is controlled by the caller (e.g. abci.App) so we do not acquire it here to avoid
// deadlock
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("recovered from panic in executor.Co... | [
"func",
"(",
"exe",
"*",
"executor",
")",
"Commit",
"(",
"header",
"*",
"abciTypes",
".",
"Header",
")",
"(",
"stateHash",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"// The write lock to the executor is controlled by the caller (e.g. abci.App) so we do not acqu... | // Commit the current state - optionally pass in the tendermint ABCI header for that to be included with the BeginBlock
// StreamEvent | [
"Commit",
"the",
"current",
"state",
"-",
"optionally",
"pass",
"in",
"the",
"tendermint",
"ABCI",
"header",
"for",
"that",
"to",
"be",
"included",
"with",
"the",
"BeginBlock",
"StreamEvent"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/execution.go#L301-L354 |
27,036 | hyperledger/burrow | execution/execution.go | updateSignatories | func (exe *executor) updateSignatories(txEnv *txs.Envelope) error {
for _, sig := range txEnv.Signatories {
// pointer dereferences are safe since txEnv.Validate() is run by txEnv.Verify() above which checks they are
// non-nil
acc, err := exe.stateCache.GetAccount(*sig.Address)
if err != nil {
return fmt.E... | go | func (exe *executor) updateSignatories(txEnv *txs.Envelope) error {
for _, sig := range txEnv.Signatories {
// pointer dereferences are safe since txEnv.Validate() is run by txEnv.Verify() above which checks they are
// non-nil
acc, err := exe.stateCache.GetAccount(*sig.Address)
if err != nil {
return fmt.E... | [
"func",
"(",
"exe",
"*",
"executor",
")",
"updateSignatories",
"(",
"txEnv",
"*",
"txs",
".",
"Envelope",
")",
"error",
"{",
"for",
"_",
",",
"sig",
":=",
"range",
"txEnv",
".",
"Signatories",
"{",
"// pointer dereferences are safe since txEnv.Validate() is run by... | // Capture public keys and update sequence numbers | [
"Capture",
"public",
"keys",
"and",
"update",
"sequence",
"numbers"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/execution.go#L405-L433 |
27,037 | hyperledger/burrow | crypto/tendermint.go | ABCIPubKey | func (p PublicKey) ABCIPubKey() abci.PubKey {
return abci.PubKey{
Type: p.CurveType.ABCIType(),
Data: p.PublicKey,
}
} | go | func (p PublicKey) ABCIPubKey() abci.PubKey {
return abci.PubKey{
Type: p.CurveType.ABCIType(),
Data: p.PublicKey,
}
} | [
"func",
"(",
"p",
"PublicKey",
")",
"ABCIPubKey",
"(",
")",
"abci",
".",
"PubKey",
"{",
"return",
"abci",
".",
"PubKey",
"{",
"Type",
":",
"p",
".",
"CurveType",
".",
"ABCIType",
"(",
")",
",",
"Data",
":",
"p",
".",
"PublicKey",
",",
"}",
"\n",
... | // PublicKey extensions
// Return the ABCI PubKey. See Tendermint protobuf.go for the go-crypto conversion this is based on | [
"PublicKey",
"extensions",
"Return",
"the",
"ABCI",
"PubKey",
".",
"See",
"Tendermint",
"protobuf",
".",
"go",
"for",
"the",
"go",
"-",
"crypto",
"conversion",
"this",
"is",
"based",
"on"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/crypto/tendermint.go#L42-L47 |
27,038 | hyperledger/burrow | vent/sqlsol/spec_loader.go | SpecLoader | func SpecLoader(specFileOrDirs []string, createBlkTxTables bool) (*Projection, error) {
var projection *Projection
var err error
if len(specFileOrDirs) == 0 {
return nil, fmt.Errorf("please provide a spec file or directory")
}
projection, err = NewProjectionFromFolder(specFileOrDirs...)
if err != nil {
retu... | go | func SpecLoader(specFileOrDirs []string, createBlkTxTables bool) (*Projection, error) {
var projection *Projection
var err error
if len(specFileOrDirs) == 0 {
return nil, fmt.Errorf("please provide a spec file or directory")
}
projection, err = NewProjectionFromFolder(specFileOrDirs...)
if err != nil {
retu... | [
"func",
"SpecLoader",
"(",
"specFileOrDirs",
"[",
"]",
"string",
",",
"createBlkTxTables",
"bool",
")",
"(",
"*",
"Projection",
",",
"error",
")",
"{",
"var",
"projection",
"*",
"Projection",
"\n",
"var",
"err",
"error",
"\n\n",
"if",
"len",
"(",
"specFile... | // SpecLoader loads spec files and parses them | [
"SpecLoader",
"loads",
"spec",
"files",
"and",
"parses",
"them"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqlsol/spec_loader.go#L11-L35 |
27,039 | hyperledger/burrow | vent/sqlsol/spec_loader.go | getBlockTxTablesDefinition | func getBlockTxTablesDefinition() types.EventTables {
return types.EventTables{
types.SQLBlockTableName: &types.SQLTable{
Name: types.SQLBlockTableName,
Columns: []*types.SQLTableColumn{
{
Name: types.SQLColumnLabelHeight,
Type: types.SQLColumnTypeVarchar,
Length: 100,
Primary: t... | go | func getBlockTxTablesDefinition() types.EventTables {
return types.EventTables{
types.SQLBlockTableName: &types.SQLTable{
Name: types.SQLBlockTableName,
Columns: []*types.SQLTableColumn{
{
Name: types.SQLColumnLabelHeight,
Type: types.SQLColumnTypeVarchar,
Length: 100,
Primary: t... | [
"func",
"getBlockTxTablesDefinition",
"(",
")",
"types",
".",
"EventTables",
"{",
"return",
"types",
".",
"EventTables",
"{",
"types",
".",
"SQLBlockTableName",
":",
"&",
"types",
".",
"SQLTable",
"{",
"Name",
":",
"types",
".",
"SQLBlockTableName",
",",
"Colu... | // getBlockTxTablesDefinition returns block & transaction structures | [
"getBlockTxTablesDefinition",
"returns",
"block",
"&",
"transaction",
"structures"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqlsol/spec_loader.go#L38-L113 |
27,040 | hyperledger/burrow | execution/evm/abi/core.go | DecodeFunctionReturnFromFile | func DecodeFunctionReturnFromFile(abiLocation, binPath, funcName string, resultRaw []byte, logger *logging.Logger) ([]*Variable, error) {
abiSpecBytes, err := readAbi(binPath, abiLocation, logger)
if err != nil {
return nil, err
}
logger.TraceMsg("ABI Specification (Decode)", "spec", abiSpecBytes)
// Unpack the... | go | func DecodeFunctionReturnFromFile(abiLocation, binPath, funcName string, resultRaw []byte, logger *logging.Logger) ([]*Variable, error) {
abiSpecBytes, err := readAbi(binPath, abiLocation, logger)
if err != nil {
return nil, err
}
logger.TraceMsg("ABI Specification (Decode)", "spec", abiSpecBytes)
// Unpack the... | [
"func",
"DecodeFunctionReturnFromFile",
"(",
"abiLocation",
",",
"binPath",
",",
"funcName",
"string",
",",
"resultRaw",
"[",
"]",
"byte",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"(",
"[",
"]",
"*",
"Variable",
",",
"error",
")",
"{",
"abiSpecBy... | // DecodeFunctionReturnFromFile ABI decodes the return value from a contract function call. | [
"DecodeFunctionReturnFromFile",
"ABI",
"decodes",
"the",
"return",
"value",
"from",
"a",
"contract",
"function",
"call",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/evm/abi/core.go#L88-L97 |
27,041 | hyperledger/burrow | execution/evm/abi/core.go | LoadPath | func LoadPath(abiFileOrDirs ...string) (*AbiSpec, error) {
if len(abiFileOrDirs) == 0 {
return &AbiSpec{}, fmt.Errorf("no ABI file or directory provided")
}
specs := make([]*AbiSpec, 0)
for _, dir := range abiFileOrDirs {
err := filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
if err... | go | func LoadPath(abiFileOrDirs ...string) (*AbiSpec, error) {
if len(abiFileOrDirs) == 0 {
return &AbiSpec{}, fmt.Errorf("no ABI file or directory provided")
}
specs := make([]*AbiSpec, 0)
for _, dir := range abiFileOrDirs {
err := filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
if err... | [
"func",
"LoadPath",
"(",
"abiFileOrDirs",
"...",
"string",
")",
"(",
"*",
"AbiSpec",
",",
"error",
")",
"{",
"if",
"len",
"(",
"abiFileOrDirs",
")",
"==",
"0",
"{",
"return",
"&",
"AbiSpec",
"{",
"}",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")"... | // LoadPath loads one abi file or finds all files in a directory | [
"LoadPath",
"loads",
"one",
"abi",
"file",
"or",
"finds",
"all",
"files",
"in",
"a",
"directory"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/evm/abi/core.go#L165-L195 |
27,042 | hyperledger/burrow | consensus/tendermint/node_view.go | MempoolTransactions | func (nv *NodeView) MempoolTransactions(maxTxs int) ([]*txs.Envelope, error) {
var transactions []*txs.Envelope
for _, txBytes := range nv.tmNode.MempoolReactor().Mempool.ReapMaxTxs(maxTxs) {
txEnv, err := nv.txDecoder.DecodeTx(txBytes)
if err != nil {
return nil, err
}
transactions = append(transactions, ... | go | func (nv *NodeView) MempoolTransactions(maxTxs int) ([]*txs.Envelope, error) {
var transactions []*txs.Envelope
for _, txBytes := range nv.tmNode.MempoolReactor().Mempool.ReapMaxTxs(maxTxs) {
txEnv, err := nv.txDecoder.DecodeTx(txBytes)
if err != nil {
return nil, err
}
transactions = append(transactions, ... | [
"func",
"(",
"nv",
"*",
"NodeView",
")",
"MempoolTransactions",
"(",
"maxTxs",
"int",
")",
"(",
"[",
"]",
"*",
"txs",
".",
"Envelope",
",",
"error",
")",
"{",
"var",
"transactions",
"[",
"]",
"*",
"txs",
".",
"Envelope",
"\n",
"for",
"_",
",",
"txB... | // Pass -1 to get all available transactions | [
"Pass",
"-",
"1",
"to",
"get",
"all",
"available",
"transactions"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/consensus/tendermint/node_view.go#L85-L95 |
27,043 | hyperledger/burrow | genesis/spec/presets.go | FullAccount | func FullAccount(name string) GenesisSpec {
// Inheriting from the arbitrary figures used by monax tool for now
amount := uint64(99999999999999)
Power := uint64(9999999999)
return GenesisSpec{
Accounts: []TemplateAccount{{
Name: name,
Amounts: balance.New().Native(amount).Power(Power),
Permiss... | go | func FullAccount(name string) GenesisSpec {
// Inheriting from the arbitrary figures used by monax tool for now
amount := uint64(99999999999999)
Power := uint64(9999999999)
return GenesisSpec{
Accounts: []TemplateAccount{{
Name: name,
Amounts: balance.New().Native(amount).Power(Power),
Permiss... | [
"func",
"FullAccount",
"(",
"name",
"string",
")",
"GenesisSpec",
"{",
"// Inheriting from the arbitrary figures used by monax tool for now",
"amount",
":=",
"uint64",
"(",
"99999999999999",
")",
"\n",
"Power",
":=",
"uint64",
"(",
"9999999999",
")",
"\n",
"return",
"... | // Files here can be used as starting points for building various 'chain types' but are otherwise
// a fairly unprincipled collection of GenesisSpecs that we find useful in testing and development | [
"Files",
"here",
"can",
"be",
"used",
"as",
"starting",
"points",
"for",
"building",
"various",
"chain",
"types",
"but",
"are",
"otherwise",
"a",
"fairly",
"unprincipled",
"collection",
"of",
"GenesisSpecs",
"that",
"we",
"find",
"useful",
"in",
"testing",
"an... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/genesis/spec/presets.go#L13-L25 |
27,044 | hyperledger/burrow | genesis/spec/presets.go | mergeAccounts | func mergeAccounts(bases, overrides []TemplateAccount) []TemplateAccount {
indexOfBase := make(map[string]int, len(bases))
for i, ta := range bases {
if ta.Name != "" {
indexOfBase[ta.Name] = i
}
}
for _, override := range overrides {
if override.Name != "" {
if i, ok := indexOfBase[override.Name]; ok ... | go | func mergeAccounts(bases, overrides []TemplateAccount) []TemplateAccount {
indexOfBase := make(map[string]int, len(bases))
for i, ta := range bases {
if ta.Name != "" {
indexOfBase[ta.Name] = i
}
}
for _, override := range overrides {
if override.Name != "" {
if i, ok := indexOfBase[override.Name]; ok ... | [
"func",
"mergeAccounts",
"(",
"bases",
",",
"overrides",
"[",
"]",
"TemplateAccount",
")",
"[",
"]",
"TemplateAccount",
"{",
"indexOfBase",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"int",
",",
"len",
"(",
"bases",
")",
")",
"\n",
"for",
"i",
",",
... | // Merge accounts by adding to base list or updating previously named account | [
"Merge",
"accounts",
"by",
"adding",
"to",
"base",
"list",
"or",
"updating",
"previously",
"named",
"account"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/genesis/spec/presets.go#L117-L135 |
27,045 | hyperledger/burrow | keys/core.go | getNameAddr | func getNameAddr(keysDir, name, addr string) (string, error) {
if name == "" && addr == "" {
return "", fmt.Errorf("at least one of name or addr must be provided")
}
// name takes precedent if both are given
var err error
if name != "" {
addr, err = coreNameGet(keysDir, name)
if err != nil {
return "", e... | go | func getNameAddr(keysDir, name, addr string) (string, error) {
if name == "" && addr == "" {
return "", fmt.Errorf("at least one of name or addr must be provided")
}
// name takes precedent if both are given
var err error
if name != "" {
addr, err = coreNameGet(keysDir, name)
if err != nil {
return "", e... | [
"func",
"getNameAddr",
"(",
"keysDir",
",",
"name",
",",
"addr",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"name",
"==",
"\"",
"\"",
"&&",
"addr",
"==",
"\"",
"\"",
"{",
"return",
"\"",
"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\""... | // return addr from name or addr | [
"return",
"addr",
"from",
"name",
"or",
"addr"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/keys/core.go#L135-L149 |
27,046 | hyperledger/burrow | deploy/run_deploy.go | RunPlaybooks | func RunPlaybooks(args *def.DeployArgs, playbooks []string, logger *logging.Logger) (int, error) {
// if bin and abi paths are default cli settings then use the
// stated defaults of do.Path plus bin|abi
if args.Path == "" {
var err error
args.Path, err = os.Getwd()
if err != nil {
panic(fmt.Sprintf("fail... | go | func RunPlaybooks(args *def.DeployArgs, playbooks []string, logger *logging.Logger) (int, error) {
// if bin and abi paths are default cli settings then use the
// stated defaults of do.Path plus bin|abi
if args.Path == "" {
var err error
args.Path, err = os.Getwd()
if err != nil {
panic(fmt.Sprintf("fail... | [
"func",
"RunPlaybooks",
"(",
"args",
"*",
"def",
".",
"DeployArgs",
",",
"playbooks",
"[",
"]",
"string",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"(",
"int",
",",
"error",
")",
"{",
"// if bin and abi paths are default cli settings then use the",
"// ... | // RunPlaybooks starts workers, and loads the playbooks in parallel in the workers, and executes them. | [
"RunPlaybooks",
"starts",
"workers",
"and",
"loads",
"the",
"playbooks",
"in",
"parallel",
"in",
"the",
"workers",
"and",
"executes",
"them",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/deploy/run_deploy.go#L82-L167 |
27,047 | hyperledger/burrow | bcm/blockchain.go | LoadOrNewBlockchain | func LoadOrNewBlockchain(db dbm.DB, genesisDoc *genesis.GenesisDoc, logger *logging.Logger) (bool, *Blockchain, error) {
logger = logger.WithScope("LoadOrNewBlockchain")
logger.InfoMsg("Trying to load blockchain state from database",
"database_key", stateKey)
bc, err := loadBlockchain(db)
if err != nil {
return... | go | func LoadOrNewBlockchain(db dbm.DB, genesisDoc *genesis.GenesisDoc, logger *logging.Logger) (bool, *Blockchain, error) {
logger = logger.WithScope("LoadOrNewBlockchain")
logger.InfoMsg("Trying to load blockchain state from database",
"database_key", stateKey)
bc, err := loadBlockchain(db)
if err != nil {
return... | [
"func",
"LoadOrNewBlockchain",
"(",
"db",
"dbm",
".",
"DB",
",",
"genesisDoc",
"*",
"genesis",
".",
"GenesisDoc",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"(",
"bool",
",",
"*",
"Blockchain",
",",
"error",
")",
"{",
"logger",
"=",
"logger",
"... | // LoadOrNewBlockchain returns true if state already exists | [
"LoadOrNewBlockchain",
"returns",
"true",
"if",
"state",
"already",
"exists"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/bcm/blockchain.go#L73-L94 |
27,048 | hyperledger/burrow | bcm/blockchain.go | NewBlockchain | func NewBlockchain(db dbm.DB, genesisDoc *genesis.GenesisDoc) *Blockchain {
bc := &Blockchain{
db: db,
genesisHash: genesisDoc.Hash(),
genesisDoc: *genesisDoc,
chainID: genesisDoc.ChainID(),
lastBlockTime: genesisDoc.GenesisTime,
appHashAfterLas... | go | func NewBlockchain(db dbm.DB, genesisDoc *genesis.GenesisDoc) *Blockchain {
bc := &Blockchain{
db: db,
genesisHash: genesisDoc.Hash(),
genesisDoc: *genesisDoc,
chainID: genesisDoc.ChainID(),
lastBlockTime: genesisDoc.GenesisTime,
appHashAfterLas... | [
"func",
"NewBlockchain",
"(",
"db",
"dbm",
".",
"DB",
",",
"genesisDoc",
"*",
"genesis",
".",
"GenesisDoc",
")",
"*",
"Blockchain",
"{",
"bc",
":=",
"&",
"Blockchain",
"{",
"db",
":",
"db",
",",
"genesisHash",
":",
"genesisDoc",
".",
"Hash",
"(",
")",
... | // NewBlockchain returns a pointer to blockchain state initialised from genesis | [
"NewBlockchain",
"returns",
"a",
"pointer",
"to",
"blockchain",
"state",
"initialised",
"from",
"genesis"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/bcm/blockchain.go#L97-L107 |
27,049 | hyperledger/burrow | vent/types/sql_column_type.go | IsNumeric | func (ct SQLColumnType) IsNumeric() bool {
return ct == SQLColumnTypeInt || ct == SQLColumnTypeSerial || ct == SQLColumnTypeNumeric || ct == SQLColumnTypeBigInt
} | go | func (ct SQLColumnType) IsNumeric() bool {
return ct == SQLColumnTypeInt || ct == SQLColumnTypeSerial || ct == SQLColumnTypeNumeric || ct == SQLColumnTypeBigInt
} | [
"func",
"(",
"ct",
"SQLColumnType",
")",
"IsNumeric",
"(",
")",
"bool",
"{",
"return",
"ct",
"==",
"SQLColumnTypeInt",
"||",
"ct",
"==",
"SQLColumnTypeSerial",
"||",
"ct",
"==",
"SQLColumnTypeNumeric",
"||",
"ct",
"==",
"SQLColumnTypeBigInt",
"\n",
"}"
] | // IsNumeric determines if an sqlColumnType is numeric | [
"IsNumeric",
"determines",
"if",
"an",
"sqlColumnType",
"is",
"numeric"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/types/sql_column_type.go#L47-L49 |
27,050 | hyperledger/burrow | permission/util.go | ConvertPermissionsMapAndRolesToAccountPermissions | func ConvertPermissionsMapAndRolesToAccountPermissions(permissions map[string]bool,
roles []string) (*AccountPermissions, error) {
var err error
accountPermissions := &AccountPermissions{}
accountPermissions.Base, err = convertPermissionsMapStringIntToBasePermissions(permissions)
if err != nil {
return nil, err
... | go | func ConvertPermissionsMapAndRolesToAccountPermissions(permissions map[string]bool,
roles []string) (*AccountPermissions, error) {
var err error
accountPermissions := &AccountPermissions{}
accountPermissions.Base, err = convertPermissionsMapStringIntToBasePermissions(permissions)
if err != nil {
return nil, err
... | [
"func",
"ConvertPermissionsMapAndRolesToAccountPermissions",
"(",
"permissions",
"map",
"[",
"string",
"]",
"bool",
",",
"roles",
"[",
"]",
"string",
")",
"(",
"*",
"AccountPermissions",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"accountPermissions",
... | // ConvertMapStringIntToPermissions converts a map of string-bool pairs and a slice of
// strings for the roles to an AccountPermissions type. If the value in the
// permissions map is true for a particular permission string then the permission
// will be set in the AccountsPermissions. For all unmentioned permissions ... | [
"ConvertMapStringIntToPermissions",
"converts",
"a",
"map",
"of",
"string",
"-",
"bool",
"pairs",
"and",
"a",
"slice",
"of",
"strings",
"for",
"the",
"roles",
"to",
"an",
"AccountPermissions",
"type",
".",
"If",
"the",
"value",
"in",
"the",
"permissions",
"map... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/util.go#L26-L36 |
27,051 | hyperledger/burrow | permission/util.go | convertPermissionsMapStringIntToBasePermissions | func convertPermissionsMapStringIntToBasePermissions(permissions map[string]bool) (BasePermissions, error) {
// initialise basePermissions as ZeroBasePermissions
basePermissions := ZeroBasePermissions
for permissionName, value := range permissions {
permissionsFlag, err := PermStringToFlag(permissionName)
if er... | go | func convertPermissionsMapStringIntToBasePermissions(permissions map[string]bool) (BasePermissions, error) {
// initialise basePermissions as ZeroBasePermissions
basePermissions := ZeroBasePermissions
for permissionName, value := range permissions {
permissionsFlag, err := PermStringToFlag(permissionName)
if er... | [
"func",
"convertPermissionsMapStringIntToBasePermissions",
"(",
"permissions",
"map",
"[",
"string",
"]",
"bool",
")",
"(",
"BasePermissions",
",",
"error",
")",
"{",
"// initialise basePermissions as ZeroBasePermissions",
"basePermissions",
":=",
"ZeroBasePermissions",
"\n\n... | // convertPermissionsMapStringIntToBasePermissions converts a map of string-bool
// pairs to BasePermissions. | [
"convertPermissionsMapStringIntToBasePermissions",
"converts",
"a",
"map",
"of",
"string",
"-",
"bool",
"pairs",
"to",
"BasePermissions",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/util.go#L40-L54 |
27,052 | hyperledger/burrow | permission/util.go | BasePermissionsFromStringList | func BasePermissionsFromStringList(permissions []string) (BasePermissions, error) {
permFlag, err := PermFlagFromStringList(permissions)
if err != nil {
return ZeroBasePermissions, err
}
return BasePermissions{
Perms: permFlag,
SetBit: permFlag,
}, nil
} | go | func BasePermissionsFromStringList(permissions []string) (BasePermissions, error) {
permFlag, err := PermFlagFromStringList(permissions)
if err != nil {
return ZeroBasePermissions, err
}
return BasePermissions{
Perms: permFlag,
SetBit: permFlag,
}, nil
} | [
"func",
"BasePermissionsFromStringList",
"(",
"permissions",
"[",
"]",
"string",
")",
"(",
"BasePermissions",
",",
"error",
")",
"{",
"permFlag",
",",
"err",
":=",
"PermFlagFromStringList",
"(",
"permissions",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return"... | // Builds a composite BasePermission by creating a PermFlag from permissions strings and
// setting them all | [
"Builds",
"a",
"composite",
"BasePermission",
"by",
"creating",
"a",
"PermFlag",
"from",
"permissions",
"strings",
"and",
"setting",
"them",
"all"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/util.go#L58-L67 |
27,053 | hyperledger/burrow | permission/util.go | PermFlagFromStringList | func PermFlagFromStringList(permissions []string) (PermFlag, error) {
var permFlag PermFlag
for _, perm := range permissions {
s := strings.TrimSpace(perm)
if s == "" {
continue
}
flag, err := PermStringToFlag(s)
if err != nil {
return permFlag, err
}
permFlag |= flag
}
return permFlag, nil
} | go | func PermFlagFromStringList(permissions []string) (PermFlag, error) {
var permFlag PermFlag
for _, perm := range permissions {
s := strings.TrimSpace(perm)
if s == "" {
continue
}
flag, err := PermStringToFlag(s)
if err != nil {
return permFlag, err
}
permFlag |= flag
}
return permFlag, nil
} | [
"func",
"PermFlagFromStringList",
"(",
"permissions",
"[",
"]",
"string",
")",
"(",
"PermFlag",
",",
"error",
")",
"{",
"var",
"permFlag",
"PermFlag",
"\n",
"for",
"_",
",",
"perm",
":=",
"range",
"permissions",
"{",
"s",
":=",
"strings",
".",
"TrimSpace",... | // Builds a composite PermFlag by mapping each permission string in permissions to its
// flag and composing them with binary or | [
"Builds",
"a",
"composite",
"PermFlag",
"by",
"mapping",
"each",
"permission",
"string",
"in",
"permissions",
"to",
"its",
"flag",
"and",
"composing",
"them",
"with",
"binary",
"or"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/util.go#L71-L85 |
27,054 | hyperledger/burrow | permission/util.go | PermFlagToStringList | func PermFlagToStringList(permFlag PermFlag) []string {
permStrings := make([]string, 0, NumPermissions)
for i := uint(0); i < NumPermissions; i++ {
permFlag := permFlag & (1 << i)
if permFlag > 0 {
permStrings = append(permStrings, permFlag.String())
}
}
return permStrings
} | go | func PermFlagToStringList(permFlag PermFlag) []string {
permStrings := make([]string, 0, NumPermissions)
for i := uint(0); i < NumPermissions; i++ {
permFlag := permFlag & (1 << i)
if permFlag > 0 {
permStrings = append(permStrings, permFlag.String())
}
}
return permStrings
} | [
"func",
"PermFlagToStringList",
"(",
"permFlag",
"PermFlag",
")",
"[",
"]",
"string",
"{",
"permStrings",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"NumPermissions",
")",
"\n",
"for",
"i",
":=",
"uint",
"(",
"0",
")",
";",
"i",
"<",
"NumP... | // Creates a list of individual permission flag strings from a possibly composite PermFlag
// by projecting out each bit and adding its permission string if it is set | [
"Creates",
"a",
"list",
"of",
"individual",
"permission",
"flag",
"strings",
"from",
"a",
"possibly",
"composite",
"PermFlag",
"by",
"projecting",
"out",
"each",
"bit",
"and",
"adding",
"its",
"permission",
"string",
"if",
"it",
"is",
"set"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/util.go#L95-L104 |
27,055 | hyperledger/burrow | rpc/service.go | NewService | func NewService(state acmstate.IterableStatsReader, nameReg names.IterableReader, blockchain bcm.BlockchainInfo,
validators validator.History, nodeView *tendermint.NodeView, logger *logging.Logger) *Service {
return &Service{
state: state,
nameReg: nameReg,
blockchain: blockchain,
validators: validat... | go | func NewService(state acmstate.IterableStatsReader, nameReg names.IterableReader, blockchain bcm.BlockchainInfo,
validators validator.History, nodeView *tendermint.NodeView, logger *logging.Logger) *Service {
return &Service{
state: state,
nameReg: nameReg,
blockchain: blockchain,
validators: validat... | [
"func",
"NewService",
"(",
"state",
"acmstate",
".",
"IterableStatsReader",
",",
"nameReg",
"names",
".",
"IterableReader",
",",
"blockchain",
"bcm",
".",
"BlockchainInfo",
",",
"validators",
"validator",
".",
"History",
",",
"nodeView",
"*",
"tendermint",
".",
... | // Service provides an internal query and information service with serialisable return types on which can accomodate
// a number of transport front ends | [
"Service",
"provides",
"an",
"internal",
"query",
"and",
"information",
"service",
"with",
"serialisable",
"return",
"types",
"on",
"which",
"can",
"accomodate",
"a",
"number",
"of",
"transport",
"front",
"ends"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/rpc/service.go#L58-L69 |
27,056 | hyperledger/burrow | rpc/service.go | Blocks | func (s *Service) Blocks(minHeight, maxHeight int64) (*ResultBlocks, error) {
if s.nodeView == nil {
return nil, fmt.Errorf("NodeView is not mounted so cannot pull Tendermint blocks")
}
latestHeight := int64(s.blockchain.LastBlockHeight())
if minHeight < 1 {
minHeight = latestHeight
}
if maxHeight == 0 || la... | go | func (s *Service) Blocks(minHeight, maxHeight int64) (*ResultBlocks, error) {
if s.nodeView == nil {
return nil, fmt.Errorf("NodeView is not mounted so cannot pull Tendermint blocks")
}
latestHeight := int64(s.blockchain.LastBlockHeight())
if minHeight < 1 {
minHeight = latestHeight
}
if maxHeight == 0 || la... | [
"func",
"(",
"s",
"*",
"Service",
")",
"Blocks",
"(",
"minHeight",
",",
"maxHeight",
"int64",
")",
"(",
"*",
"ResultBlocks",
",",
"error",
")",
"{",
"if",
"s",
".",
"nodeView",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\""... | // Returns the current blockchain height and metadata for a range of blocks
// between minHeight and maxHeight. Only returns maxBlockLookback block metadata
// from the top of the range of blocks.
// Passing 0 for maxHeight sets the upper height of the range to the current
// blockchain height. | [
"Returns",
"the",
"current",
"blockchain",
"height",
"and",
"metadata",
"for",
"a",
"range",
"of",
"blocks",
"between",
"minHeight",
"and",
"maxHeight",
".",
"Only",
"returns",
"maxBlockLookback",
"block",
"metadata",
"from",
"the",
"top",
"of",
"the",
"range",
... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/rpc/service.go#L298-L324 |
27,057 | hyperledger/burrow | genesis/deterministic_genesis.go | NewDeterministicGenesis | func NewDeterministicGenesis(seed int64) *deterministicGenesis {
return &deterministicGenesis{
random: rand.New(rand.NewSource(seed)),
}
} | go | func NewDeterministicGenesis(seed int64) *deterministicGenesis {
return &deterministicGenesis{
random: rand.New(rand.NewSource(seed)),
}
} | [
"func",
"NewDeterministicGenesis",
"(",
"seed",
"int64",
")",
"*",
"deterministicGenesis",
"{",
"return",
"&",
"deterministicGenesis",
"{",
"random",
":",
"rand",
".",
"New",
"(",
"rand",
".",
"NewSource",
"(",
"seed",
")",
")",
",",
"}",
"\n",
"}"
] | // Generates deterministic pseudo-random genesis state | [
"Generates",
"deterministic",
"pseudo",
"-",
"random",
"genesis",
"state"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/genesis/deterministic_genesis.go#L18-L22 |
27,058 | hyperledger/burrow | execution/contexts/governance_context.go | Execute | func (ctx *GovernanceContext) Execute(txe *exec.TxExecution, p payload.Payload) error {
var ok bool
ctx.txe = txe
ctx.tx, ok = p.(*payload.GovTx)
if !ok {
return fmt.Errorf("payload must be NameTx, but is: %v", txe.Envelope.Tx.Payload)
}
// Nothing down with any incoming funds at this point
accounts, _, err :=... | go | func (ctx *GovernanceContext) Execute(txe *exec.TxExecution, p payload.Payload) error {
var ok bool
ctx.txe = txe
ctx.tx, ok = p.(*payload.GovTx)
if !ok {
return fmt.Errorf("payload must be NameTx, but is: %v", txe.Envelope.Tx.Payload)
}
// Nothing down with any incoming funds at this point
accounts, _, err :=... | [
"func",
"(",
"ctx",
"*",
"GovernanceContext",
")",
"Execute",
"(",
"txe",
"*",
"exec",
".",
"TxExecution",
",",
"p",
"payload",
".",
"Payload",
")",
"error",
"{",
"var",
"ok",
"bool",
"\n",
"ctx",
".",
"txe",
"=",
"txe",
"\n",
"ctx",
".",
"tx",
","... | // GovTx provides a set of TemplateAccounts and GovernanceContext tries to alter the chain state to match the
// specification given | [
"GovTx",
"provides",
"a",
"set",
"of",
"TemplateAccounts",
"and",
"GovernanceContext",
"tries",
"to",
"alter",
"the",
"chain",
"state",
"to",
"match",
"the",
"specification",
"given"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/contexts/governance_context.go#L29-L88 |
27,059 | hyperledger/burrow | vent/sqldb/utils.go | findTable | func (db *SQLDB) findTable(tableName string) (bool, error) {
found := 0
safeTable := safe(tableName)
query := db.DBAdapter.FindTableQuery()
db.Log.Info("msg", "FIND TABLE", "query", query, "value", safeTable)
if err := db.DB.QueryRow(query, tableName).Scan(&found); err != nil {
db.Log.Info("msg", "Error findin... | go | func (db *SQLDB) findTable(tableName string) (bool, error) {
found := 0
safeTable := safe(tableName)
query := db.DBAdapter.FindTableQuery()
db.Log.Info("msg", "FIND TABLE", "query", query, "value", safeTable)
if err := db.DB.QueryRow(query, tableName).Scan(&found); err != nil {
db.Log.Info("msg", "Error findin... | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"findTable",
"(",
"tableName",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"found",
":=",
"0",
"\n",
"safeTable",
":=",
"safe",
"(",
"tableName",
")",
"\n",
"query",
":=",
"db",
".",
"DBAdapter",
".",
"... | // findTable checks if a table exists in the default schema | [
"findTable",
"checks",
"if",
"a",
"table",
"exists",
"in",
"the",
"default",
"schema"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L19-L37 |
27,060 | hyperledger/burrow | vent/sqldb/utils.go | getTableDef | func (db *SQLDB) getTableDef(tableName string) (*types.SQLTable, error) {
table := &types.SQLTable{
Name: safe(tableName),
}
found, err := db.findTable(table.Name)
if err != nil {
return nil, err
}
if !found {
db.Log.Info("msg", "Error table not found", "value", table.Name)
return nil, errors.New("Error ... | go | func (db *SQLDB) getTableDef(tableName string) (*types.SQLTable, error) {
table := &types.SQLTable{
Name: safe(tableName),
}
found, err := db.findTable(table.Name)
if err != nil {
return nil, err
}
if !found {
db.Log.Info("msg", "Error table not found", "value", table.Name)
return nil, errors.New("Error ... | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"getTableDef",
"(",
"tableName",
"string",
")",
"(",
"*",
"types",
".",
"SQLTable",
",",
"error",
")",
"{",
"table",
":=",
"&",
"types",
".",
"SQLTable",
"{",
"Name",
":",
"safe",
"(",
"tableName",
")",
",",
"}... | // getTableDef returns the structure of a given SQL table | [
"getTableDef",
"returns",
"the",
"structure",
"of",
"a",
"given",
"SQL",
"table"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L176-L232 |
27,061 | hyperledger/burrow | vent/sqldb/utils.go | alterTable | func (db *SQLDB) alterTable(table *types.SQLTable) error {
db.Log.Info("msg", "Altering table", "value", table.Name)
// prepare log query
logQuery := db.DBAdapter.InsertLogQuery()
// current table structure
safeTable := safe(table.Name)
currentTable, err := db.getTableDef(safeTable)
if err != nil {
return er... | go | func (db *SQLDB) alterTable(table *types.SQLTable) error {
db.Log.Info("msg", "Altering table", "value", table.Name)
// prepare log query
logQuery := db.DBAdapter.InsertLogQuery()
// current table structure
safeTable := safe(table.Name)
currentTable, err := db.getTableDef(safeTable)
if err != nil {
return er... | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"alterTable",
"(",
"table",
"*",
"types",
".",
"SQLTable",
")",
"error",
"{",
"db",
".",
"Log",
".",
"Info",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"table",
".",
"Name",
")",
"\n\n",
"// pr... | // alterTable alters the structure of a SQL table & add info to the dictionary | [
"alterTable",
"alters",
"the",
"structure",
"of",
"a",
"SQL",
"table",
"&",
"add",
"info",
"to",
"the",
"dictionary"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L235-L311 |
27,062 | hyperledger/burrow | vent/sqldb/utils.go | createTable | func (db *SQLDB) createTable(table *types.SQLTable, isInitialise bool) error {
db.Log.Info("msg", "Creating Table", "value", table.Name)
// prepare log query
logQuery := db.DBAdapter.InsertLogQuery()
//get create table query
safeTable := safe(table.Name)
query, dictionary := db.DBAdapter.CreateTableQuery(safeTa... | go | func (db *SQLDB) createTable(table *types.SQLTable, isInitialise bool) error {
db.Log.Info("msg", "Creating Table", "value", table.Name)
// prepare log query
logQuery := db.DBAdapter.InsertLogQuery()
//get create table query
safeTable := safe(table.Name)
query, dictionary := db.DBAdapter.CreateTableQuery(safeTa... | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"createTable",
"(",
"table",
"*",
"types",
".",
"SQLTable",
",",
"isInitialise",
"bool",
")",
"error",
"{",
"db",
".",
"Log",
".",
"Info",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"table",
".",... | // createTable creates a new table | [
"createTable",
"creates",
"a",
"new",
"table"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L314-L368 |
27,063 | hyperledger/burrow | vent/sqldb/utils.go | getSelectQuery | func (db *SQLDB) getSelectQuery(table *types.SQLTable, height uint64) (string, error) {
fields := ""
for _, tableColumn := range table.Columns {
if fields != "" {
fields += ", "
}
fields += db.DBAdapter.SecureName(tableColumn.Name)
}
if fields == "" {
return "", errors.New("error table does not contai... | go | func (db *SQLDB) getSelectQuery(table *types.SQLTable, height uint64) (string, error) {
fields := ""
for _, tableColumn := range table.Columns {
if fields != "" {
fields += ", "
}
fields += db.DBAdapter.SecureName(tableColumn.Name)
}
if fields == "" {
return "", errors.New("error table does not contai... | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"getSelectQuery",
"(",
"table",
"*",
"types",
".",
"SQLTable",
",",
"height",
"uint64",
")",
"(",
"string",
",",
"error",
")",
"{",
"fields",
":=",
"\"",
"\"",
"\n\n",
"for",
"_",
",",
"tableColumn",
":=",
"range... | // getSelectQuery builds a select query for a specific SQL table and a given block | [
"getSelectQuery",
"builds",
"a",
"select",
"query",
"for",
"a",
"specific",
"SQL",
"table",
"and",
"a",
"given",
"block"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L398-L415 |
27,064 | hyperledger/burrow | vent/sqldb/utils.go | getBlockTables | func (db *SQLDB) getBlockTables(height uint64) (types.EventTables, error) {
tables := make(types.EventTables)
query := db.DBAdapter.SelectLogQuery()
db.Log.Info("msg", "QUERY LOG", "query", query, "value", height)
rows, err := db.DB.Query(query, height)
if err != nil {
db.Log.Info("msg", "Error querying log", ... | go | func (db *SQLDB) getBlockTables(height uint64) (types.EventTables, error) {
tables := make(types.EventTables)
query := db.DBAdapter.SelectLogQuery()
db.Log.Info("msg", "QUERY LOG", "query", query, "value", height)
rows, err := db.DB.Query(query, height)
if err != nil {
db.Log.Info("msg", "Error querying log", ... | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"getBlockTables",
"(",
"height",
"uint64",
")",
"(",
"types",
".",
"EventTables",
",",
"error",
")",
"{",
"tables",
":=",
"make",
"(",
"types",
".",
"EventTables",
")",
"\n\n",
"query",
":=",
"db",
".",
"DBAdapter"... | // getBlockTables return all SQL tables that have been involved
// in a given batch transaction for a specific block | [
"getBlockTables",
"return",
"all",
"SQL",
"tables",
"that",
"have",
"been",
"involved",
"in",
"a",
"given",
"batch",
"transaction",
"for",
"a",
"specific",
"block"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L419-L457 |
27,065 | hyperledger/burrow | vent/sqldb/utils.go | safe | func safe(parameter string) string {
replacer := strings.NewReplacer(";", "", ",", "")
return replacer.Replace(parameter)
} | go | func safe(parameter string) string {
replacer := strings.NewReplacer(";", "", ",", "")
return replacer.Replace(parameter)
} | [
"func",
"safe",
"(",
"parameter",
"string",
")",
"string",
"{",
"replacer",
":=",
"strings",
".",
"NewReplacer",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"replacer",
".",
"Replace",
"(",
"parameter",
")... | // safe sanitizes a parameter | [
"safe",
"sanitizes",
"a",
"parameter"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L460-L463 |
27,066 | hyperledger/burrow | vent/sqldb/utils.go | getJSON | func (db *SQLDB) getJSON(JSON interface{}) ([]byte, error) {
if JSON != nil {
return json.Marshal(JSON)
}
return json.Marshal("")
} | go | func (db *SQLDB) getJSON(JSON interface{}) ([]byte, error) {
if JSON != nil {
return json.Marshal(JSON)
}
return json.Marshal("")
} | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"getJSON",
"(",
"JSON",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"JSON",
"!=",
"nil",
"{",
"return",
"json",
".",
"Marshal",
"(",
"JSON",
")",
"\n",
"}",
"\n",
"retur... | //getJSON returns marshaled json from JSON single column | [
"getJSON",
"returns",
"marshaled",
"json",
"from",
"JSON",
"single",
"column"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L466-L471 |
27,067 | hyperledger/burrow | vent/sqldb/utils.go | getJSONFromValues | func (db *SQLDB) getJSONFromValues(values []interface{}) ([]byte, error) {
if values != nil {
return json.Marshal(values)
}
return json.Marshal("")
} | go | func (db *SQLDB) getJSONFromValues(values []interface{}) ([]byte, error) {
if values != nil {
return json.Marshal(values)
}
return json.Marshal("")
} | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"getJSONFromValues",
"(",
"values",
"[",
"]",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"values",
"!=",
"nil",
"{",
"return",
"json",
".",
"Marshal",
"(",
"values",
")",
... | //getJSONFromValues returns marshaled json from query values | [
"getJSONFromValues",
"returns",
"marshaled",
"json",
"from",
"query",
"values"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L474-L479 |
27,068 | hyperledger/burrow | vent/sqldb/utils.go | getValuesFromJSON | func (db *SQLDB) getValuesFromJSON(JSON string) ([]interface{}, error) {
pointers := make([]interface{}, 0)
bytes := []byte(JSON)
err := json.Unmarshal(bytes, &pointers)
return pointers, err
} | go | func (db *SQLDB) getValuesFromJSON(JSON string) ([]interface{}, error) {
pointers := make([]interface{}, 0)
bytes := []byte(JSON)
err := json.Unmarshal(bytes, &pointers)
return pointers, err
} | [
"func",
"(",
"db",
"*",
"SQLDB",
")",
"getValuesFromJSON",
"(",
"JSON",
"string",
")",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"pointers",
":=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"0",
")",
"\n",
"bytes",
":=... | //getValuesFromJSON returns query values from unmarshaled JSON column | [
"getValuesFromJSON",
"returns",
"query",
"values",
"from",
"unmarshaled",
"JSON",
"column"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/utils.go#L482-L487 |
27,069 | hyperledger/burrow | execution/errors/errors.go | AsException | func AsException(err error) *Exception {
if err == nil {
return nil
}
switch e := err.(type) {
case *Exception:
return e
case CodedError:
return NewException(e.ErrorCode(), e.String())
default:
return NewException(ErrorCodeGeneric, err.Error())
}
} | go | func AsException(err error) *Exception {
if err == nil {
return nil
}
switch e := err.(type) {
case *Exception:
return e
case CodedError:
return NewException(e.ErrorCode(), e.String())
default:
return NewException(ErrorCodeGeneric, err.Error())
}
} | [
"func",
"AsException",
"(",
"err",
"error",
")",
"*",
"Exception",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"switch",
"e",
":=",
"err",
".",
"(",
"type",
")",
"{",
"case",
"*",
"Exception",
":",
"return",
"e",
"\n",
"... | // Wraps any error as a Exception | [
"Wraps",
"any",
"error",
"as",
"a",
"Exception"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/errors/errors.go#L171-L183 |
27,070 | hyperledger/burrow | crypto/private_key.go | PublicKeyFromBytes | func PublicKeyFromBytes(bs []byte, curveType CurveType) (PublicKey, error) {
switch curveType {
case CurveTypeEd25519:
if len(bs) != ed25519.PublicKeySize {
return PublicKey{}, fmt.Errorf("bytes passed have length %v but ed25519 public keys have %v bytes",
len(bs), ed25519.PublicKeySize)
}
case CurveTypeS... | go | func PublicKeyFromBytes(bs []byte, curveType CurveType) (PublicKey, error) {
switch curveType {
case CurveTypeEd25519:
if len(bs) != ed25519.PublicKeySize {
return PublicKey{}, fmt.Errorf("bytes passed have length %v but ed25519 public keys have %v bytes",
len(bs), ed25519.PublicKeySize)
}
case CurveTypeS... | [
"func",
"PublicKeyFromBytes",
"(",
"bs",
"[",
"]",
"byte",
",",
"curveType",
"CurveType",
")",
"(",
"PublicKey",
",",
"error",
")",
"{",
"switch",
"curveType",
"{",
"case",
"CurveTypeEd25519",
":",
"if",
"len",
"(",
"bs",
")",
"!=",
"ed25519",
".",
"Publ... | // Currently this is a stub that reads the raw bytes returned by key_client and returns
// an ed25519 public key. | [
"Currently",
"this",
"is",
"a",
"stub",
"that",
"reads",
"the",
"raw",
"bytes",
"returned",
"by",
"key_client",
"and",
"returns",
"an",
"ed25519",
"public",
"key",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/crypto/private_key.go#L16-L38 |
27,071 | hyperledger/burrow | crypto/private_key.go | Reinitialise | func (p *PrivateKey) Reinitialise() error {
initP, err := PrivateKeyFromRawBytes(p.RawBytes(), p.CurveType)
if err != nil {
return err
}
*p = initP
return nil
} | go | func (p *PrivateKey) Reinitialise() error {
initP, err := PrivateKeyFromRawBytes(p.RawBytes(), p.CurveType)
if err != nil {
return err
}
*p = initP
return nil
} | [
"func",
"(",
"p",
"*",
"PrivateKey",
")",
"Reinitialise",
"(",
")",
"error",
"{",
"initP",
",",
"err",
":=",
"PrivateKeyFromRawBytes",
"(",
"p",
".",
"RawBytes",
"(",
")",
",",
"p",
".",
"CurveType",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return"... | // Reinitialise after serialisation | [
"Reinitialise",
"after",
"serialisation"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/crypto/private_key.go#L74-L81 |
27,072 | hyperledger/burrow | crypto/private_key.go | EnsureEd25519PrivateKeyCorrect | func EnsureEd25519PrivateKeyCorrect(candidatePrivateKey ed25519.PrivateKey) error {
if len(candidatePrivateKey) != ed25519.PrivateKeySize {
return fmt.Errorf("ed25519 key has size %v but %v bytes passed as key", ed25519.PrivateKeySize,
len(candidatePrivateKey))
}
_, derivedPrivateKey, err := ed25519.GenerateKey... | go | func EnsureEd25519PrivateKeyCorrect(candidatePrivateKey ed25519.PrivateKey) error {
if len(candidatePrivateKey) != ed25519.PrivateKeySize {
return fmt.Errorf("ed25519 key has size %v but %v bytes passed as key", ed25519.PrivateKeySize,
len(candidatePrivateKey))
}
_, derivedPrivateKey, err := ed25519.GenerateKey... | [
"func",
"EnsureEd25519PrivateKeyCorrect",
"(",
"candidatePrivateKey",
"ed25519",
".",
"PrivateKey",
")",
"error",
"{",
"if",
"len",
"(",
"candidatePrivateKey",
")",
"!=",
"ed25519",
".",
"PrivateKeySize",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
","... | // Ensures the last 32 bytes of the ed25519 private key is the public key derived from the first 32 private bytes | [
"Ensures",
"the",
"last",
"32",
"bytes",
"of",
"the",
"ed25519",
"private",
"key",
"is",
"the",
"public",
"key",
"derived",
"from",
"the",
"first",
"32",
"private",
"bytes"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/crypto/private_key.go#L142-L156 |
27,073 | hyperledger/burrow | storage/content_addressed_store.go | Put | func (cas *ContentAddressedStore) Put(data []byte) ([]byte, error) {
hasher := sha256.New()
_, err := hasher.Write(data)
if err != nil {
return nil, fmt.Errorf("ContentAddressedStore could not hash data: %v", err)
}
hash := hasher.Sum(nil)
cas.db.SetSync(hash, data)
return hash, nil
} | go | func (cas *ContentAddressedStore) Put(data []byte) ([]byte, error) {
hasher := sha256.New()
_, err := hasher.Write(data)
if err != nil {
return nil, fmt.Errorf("ContentAddressedStore could not hash data: %v", err)
}
hash := hasher.Sum(nil)
cas.db.SetSync(hash, data)
return hash, nil
} | [
"func",
"(",
"cas",
"*",
"ContentAddressedStore",
")",
"Put",
"(",
"data",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"hasher",
":=",
"sha256",
".",
"New",
"(",
")",
"\n",
"_",
",",
"err",
":=",
"hasher",
".",
"Write",
... | // These function match those used in Hoard
// Put data in the database by saving data with a key that is its sha256 hash | [
"These",
"function",
"match",
"those",
"used",
"in",
"Hoard",
"Put",
"data",
"in",
"the",
"database",
"by",
"saving",
"data",
"with",
"a",
"key",
"that",
"is",
"its",
"sha256",
"hash"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/storage/content_addressed_store.go#L24-L33 |
27,074 | hyperledger/burrow | logging/logconfig/presets/instructions.go | push | func push(stack []*logconfig.SinkConfig, sinkConfigs ...*logconfig.SinkConfig) []*logconfig.SinkConfig {
for _, sinkConfig := range sinkConfigs {
peek(stack).AddSinks(sinkConfig)
stack = append(stack, sinkConfig)
}
return stack
} | go | func push(stack []*logconfig.SinkConfig, sinkConfigs ...*logconfig.SinkConfig) []*logconfig.SinkConfig {
for _, sinkConfig := range sinkConfigs {
peek(stack).AddSinks(sinkConfig)
stack = append(stack, sinkConfig)
}
return stack
} | [
"func",
"push",
"(",
"stack",
"[",
"]",
"*",
"logconfig",
".",
"SinkConfig",
",",
"sinkConfigs",
"...",
"*",
"logconfig",
".",
"SinkConfig",
")",
"[",
"]",
"*",
"logconfig",
".",
"SinkConfig",
"{",
"for",
"_",
",",
"sinkConfig",
":=",
"range",
"sinkConfi... | // Push a path sequence of sinks onto the stack | [
"Push",
"a",
"path",
"sequence",
"of",
"sinks",
"onto",
"the",
"stack"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/logging/logconfig/presets/instructions.go#L266-L272 |
27,075 | hyperledger/burrow | vent/service/consumer.go | NewConsumer | func NewConsumer(cfg *config.VentConfig, log *logger.Logger, eventChannel chan types.EventData) *Consumer {
return &Consumer{
Config: cfg,
Log: log,
Closing: false,
EventsChannel: eventChannel,
}
} | go | func NewConsumer(cfg *config.VentConfig, log *logger.Logger, eventChannel chan types.EventData) *Consumer {
return &Consumer{
Config: cfg,
Log: log,
Closing: false,
EventsChannel: eventChannel,
}
} | [
"func",
"NewConsumer",
"(",
"cfg",
"*",
"config",
".",
"VentConfig",
",",
"log",
"*",
"logger",
".",
"Logger",
",",
"eventChannel",
"chan",
"types",
".",
"EventData",
")",
"*",
"Consumer",
"{",
"return",
"&",
"Consumer",
"{",
"Config",
":",
"cfg",
",",
... | // NewConsumer constructs a new consumer configuration.
// The event channel will be passed a collection of rows generated from all of the events in a single block
// It will be closed by the consumer when it is finished | [
"NewConsumer",
"constructs",
"a",
"new",
"consumer",
"configuration",
".",
"The",
"event",
"channel",
"will",
"be",
"passed",
"a",
"collection",
"of",
"rows",
"generated",
"from",
"all",
"of",
"the",
"events",
"in",
"a",
"single",
"block",
"It",
"will",
"be"... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/service/consumer.go#L47-L54 |
27,076 | hyperledger/burrow | vent/service/consumer.go | Health | func (c *Consumer) Health() error {
if c.Closing {
return errors.New("closing service")
}
// check db status
if c.DB == nil {
return errors.New("database disconnected")
}
if err := c.DB.Ping(); err != nil {
return errors.New("database unavailable")
}
// check grpc connection status
if c.GRPCConnection... | go | func (c *Consumer) Health() error {
if c.Closing {
return errors.New("closing service")
}
// check db status
if c.DB == nil {
return errors.New("database disconnected")
}
if err := c.DB.Ping(); err != nil {
return errors.New("database unavailable")
}
// check grpc connection status
if c.GRPCConnection... | [
"func",
"(",
"c",
"*",
"Consumer",
")",
"Health",
"(",
")",
"error",
"{",
"if",
"c",
".",
"Closing",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// check db status",
"if",
"c",
".",
"DB",
"==",
"nil",
"{",
"retu... | // Health returns the health status for the consumer | [
"Health",
"returns",
"the",
"health",
"status",
"for",
"the",
"consumer"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/service/consumer.go#L320-L344 |
27,077 | hyperledger/burrow | vent/service/consumer.go | Shutdown | func (c *Consumer) Shutdown() {
c.Log.Info("msg", "Shutting down vent consumer...")
c.Closing = true
c.GRPCConnection.Close()
} | go | func (c *Consumer) Shutdown() {
c.Log.Info("msg", "Shutting down vent consumer...")
c.Closing = true
c.GRPCConnection.Close()
} | [
"func",
"(",
"c",
"*",
"Consumer",
")",
"Shutdown",
"(",
")",
"{",
"c",
".",
"Log",
".",
"Info",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"c",
".",
"Closing",
"=",
"true",
"\n",
"c",
".",
"GRPCConnection",
".",
"Close",
"(",
")",
"\n",
"}... | // Shutdown gracefully shuts down the events consumer | [
"Shutdown",
"gracefully",
"shuts",
"down",
"the",
"events",
"consumer"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/service/consumer.go#L347-L351 |
27,078 | hyperledger/burrow | vent/sqlsol/block_data.go | NewBlockData | func NewBlockData(height uint64) *BlockData {
data := types.EventData{
Tables: make(map[string]types.EventDataTable),
BlockHeight: height,
}
return &BlockData{
Data: data,
}
} | go | func NewBlockData(height uint64) *BlockData {
data := types.EventData{
Tables: make(map[string]types.EventDataTable),
BlockHeight: height,
}
return &BlockData{
Data: data,
}
} | [
"func",
"NewBlockData",
"(",
"height",
"uint64",
")",
"*",
"BlockData",
"{",
"data",
":=",
"types",
".",
"EventData",
"{",
"Tables",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"types",
".",
"EventDataTable",
")",
",",
"BlockHeight",
":",
"height",
",",... | // NewBlockData returns a pointer to an empty BlockData structure | [
"NewBlockData",
"returns",
"a",
"pointer",
"to",
"an",
"empty",
"BlockData",
"structure"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqlsol/block_data.go#L15-L24 |
27,079 | hyperledger/burrow | vent/sqlsol/block_data.go | AddRow | func (b *BlockData) AddRow(tableName string, row types.EventDataRow) {
if _, ok := b.Data.Tables[tableName]; !ok {
b.Data.Tables[tableName] = types.EventDataTable{}
}
b.Data.Tables[tableName] = append(b.Data.Tables[tableName], row)
} | go | func (b *BlockData) AddRow(tableName string, row types.EventDataRow) {
if _, ok := b.Data.Tables[tableName]; !ok {
b.Data.Tables[tableName] = types.EventDataTable{}
}
b.Data.Tables[tableName] = append(b.Data.Tables[tableName], row)
} | [
"func",
"(",
"b",
"*",
"BlockData",
")",
"AddRow",
"(",
"tableName",
"string",
",",
"row",
"types",
".",
"EventDataRow",
")",
"{",
"if",
"_",
",",
"ok",
":=",
"b",
".",
"Data",
".",
"Tables",
"[",
"tableName",
"]",
";",
"!",
"ok",
"{",
"b",
".",
... | // AddRow appends a row to a specific table name in structure | [
"AddRow",
"appends",
"a",
"row",
"to",
"a",
"specific",
"table",
"name",
"in",
"structure"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqlsol/block_data.go#L27-L32 |
27,080 | hyperledger/burrow | vent/sqlsol/block_data.go | GetRows | func (b *BlockData) GetRows(tableName string) (types.EventDataTable, error) {
if table, ok := b.Data.Tables[tableName]; ok {
return table, nil
}
return nil, fmt.Errorf("GetRows: tableName does not exists as a table in data structure: %s ", tableName)
} | go | func (b *BlockData) GetRows(tableName string) (types.EventDataTable, error) {
if table, ok := b.Data.Tables[tableName]; ok {
return table, nil
}
return nil, fmt.Errorf("GetRows: tableName does not exists as a table in data structure: %s ", tableName)
} | [
"func",
"(",
"b",
"*",
"BlockData",
")",
"GetRows",
"(",
"tableName",
"string",
")",
"(",
"types",
".",
"EventDataTable",
",",
"error",
")",
"{",
"if",
"table",
",",
"ok",
":=",
"b",
".",
"Data",
".",
"Tables",
"[",
"tableName",
"]",
";",
"ok",
"{"... | // GetRows gets data rows for a given table name from structure | [
"GetRows",
"gets",
"data",
"rows",
"for",
"a",
"given",
"table",
"name",
"from",
"structure"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqlsol/block_data.go#L35-L40 |
27,081 | hyperledger/burrow | vent/sqlsol/block_data.go | PendingRows | func (b *BlockData) PendingRows(height uint64) bool {
hasRows := false
// TODO: understand why the guard on height is needed - what does it prevent?
if b.Data.BlockHeight == height && len(b.Data.Tables) > 0 {
hasRows = true
}
return hasRows
} | go | func (b *BlockData) PendingRows(height uint64) bool {
hasRows := false
// TODO: understand why the guard on height is needed - what does it prevent?
if b.Data.BlockHeight == height && len(b.Data.Tables) > 0 {
hasRows = true
}
return hasRows
} | [
"func",
"(",
"b",
"*",
"BlockData",
")",
"PendingRows",
"(",
"height",
"uint64",
")",
"bool",
"{",
"hasRows",
":=",
"false",
"\n",
"// TODO: understand why the guard on height is needed - what does it prevent?",
"if",
"b",
".",
"Data",
".",
"BlockHeight",
"==",
"hei... | // PendingRows returns true if the given block has at least one pending row to upsert | [
"PendingRows",
"returns",
"true",
"if",
"the",
"given",
"block",
"has",
"at",
"least",
"one",
"pending",
"row",
"to",
"upsert"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqlsol/block_data.go#L43-L50 |
27,082 | hyperledger/burrow | execution/evm/memory.go | NewDynamicMemory | func NewDynamicMemory(initialCapacity, maximumCapacity uint64, errSink errors.Sink) Memory {
return &dynamicMemory{
slice: make([]byte, initialCapacity),
maximumCapacity: maximumCapacity,
errSink: errSink,
}
} | go | func NewDynamicMemory(initialCapacity, maximumCapacity uint64, errSink errors.Sink) Memory {
return &dynamicMemory{
slice: make([]byte, initialCapacity),
maximumCapacity: maximumCapacity,
errSink: errSink,
}
} | [
"func",
"NewDynamicMemory",
"(",
"initialCapacity",
",",
"maximumCapacity",
"uint64",
",",
"errSink",
"errors",
".",
"Sink",
")",
"Memory",
"{",
"return",
"&",
"dynamicMemory",
"{",
"slice",
":",
"make",
"(",
"[",
"]",
"byte",
",",
"initialCapacity",
")",
",... | // Get a new DynamicMemory (note that although we take a maximumCapacity of uint64 we currently
// limit the maximum to int32 at runtime because we are using a single slice which we cannot guarantee
// to be indexable above int32 or all validators | [
"Get",
"a",
"new",
"DynamicMemory",
"(",
"note",
"that",
"although",
"we",
"take",
"a",
"maximumCapacity",
"of",
"uint64",
"we",
"currently",
"limit",
"the",
"maximum",
"to",
"int32",
"at",
"runtime",
"because",
"we",
"are",
"using",
"a",
"single",
"slice",
... | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/evm/memory.go#L48-L54 |
27,083 | hyperledger/burrow | execution/simulated_call.go | CallSim | func CallSim(reader acmstate.Reader, tip bcm.BlockchainInfo, fromAddress, address crypto.Address, data []byte,
logger *logging.Logger) (*exec.TxExecution, error) {
cache := acmstate.NewCache(reader)
exe := contexts.CallContext{
RunCall: true,
StateWriter: cache,
Blockchain: tip,
Logger: logger,
}... | go | func CallSim(reader acmstate.Reader, tip bcm.BlockchainInfo, fromAddress, address crypto.Address, data []byte,
logger *logging.Logger) (*exec.TxExecution, error) {
cache := acmstate.NewCache(reader)
exe := contexts.CallContext{
RunCall: true,
StateWriter: cache,
Blockchain: tip,
Logger: logger,
}... | [
"func",
"CallSim",
"(",
"reader",
"acmstate",
".",
"Reader",
",",
"tip",
"bcm",
".",
"BlockchainInfo",
",",
"fromAddress",
",",
"address",
"crypto",
".",
"Address",
",",
"data",
"[",
"]",
"byte",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"(",
... | // Run a contract's code on an isolated and unpersisted state
// Cannot be used to create new contracts | [
"Run",
"a",
"contract",
"s",
"code",
"on",
"an",
"isolated",
"and",
"unpersisted",
"state",
"Cannot",
"be",
"used",
"to",
"create",
"new",
"contracts"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/simulated_call.go#L17-L41 |
27,084 | hyperledger/burrow | execution/simulated_call.go | CallCodeSim | func CallCodeSim(reader acmstate.Reader, tip bcm.BlockchainInfo, fromAddress, address crypto.Address, code, data []byte,
logger *logging.Logger) (*exec.TxExecution, error) {
// Attach code to target account (overwriting target)
cache := acmstate.NewCache(reader)
err := cache.UpdateAccount(&acm.Account{
Address: ... | go | func CallCodeSim(reader acmstate.Reader, tip bcm.BlockchainInfo, fromAddress, address crypto.Address, code, data []byte,
logger *logging.Logger) (*exec.TxExecution, error) {
// Attach code to target account (overwriting target)
cache := acmstate.NewCache(reader)
err := cache.UpdateAccount(&acm.Account{
Address: ... | [
"func",
"CallCodeSim",
"(",
"reader",
"acmstate",
".",
"Reader",
",",
"tip",
"bcm",
".",
"BlockchainInfo",
",",
"fromAddress",
",",
"address",
"crypto",
".",
"Address",
",",
"code",
",",
"data",
"[",
"]",
"byte",
",",
"logger",
"*",
"logging",
".",
"Logg... | // Run the given code on an isolated and unpersisted state
// Cannot be used to create new contracts. | [
"Run",
"the",
"given",
"code",
"on",
"an",
"isolated",
"and",
"unpersisted",
"state",
"Cannot",
"be",
"used",
"to",
"create",
"new",
"contracts",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/execution/simulated_call.go#L45-L59 |
27,085 | hyperledger/burrow | core/config.go | LoadKeysFromConfig | func (kern *Kernel) LoadKeysFromConfig(conf *keys.KeysConfig) (err error) {
kern.keyStore = keys.NewKeyStore(conf.KeysDirectory, conf.AllowBadFilePermissions)
if conf.RemoteAddress != "" {
kern.keyClient, err = keys.NewRemoteKeyClient(conf.RemoteAddress, kern.Logger)
if err != nil {
return err
}
} else {
... | go | func (kern *Kernel) LoadKeysFromConfig(conf *keys.KeysConfig) (err error) {
kern.keyStore = keys.NewKeyStore(conf.KeysDirectory, conf.AllowBadFilePermissions)
if conf.RemoteAddress != "" {
kern.keyClient, err = keys.NewRemoteKeyClient(conf.RemoteAddress, kern.Logger)
if err != nil {
return err
}
} else {
... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"LoadKeysFromConfig",
"(",
"conf",
"*",
"keys",
".",
"KeysConfig",
")",
"(",
"err",
"error",
")",
"{",
"kern",
".",
"keyStore",
"=",
"keys",
".",
"NewKeyStore",
"(",
"conf",
".",
"KeysDirectory",
",",
"conf",
".... | // LoadKeysFromConfig sets the keyClient & keyStore based on the given config | [
"LoadKeysFromConfig",
"sets",
"the",
"keyClient",
"&",
"keyStore",
"based",
"on",
"the",
"given",
"config"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/config.go#L23-L34 |
27,086 | hyperledger/burrow | core/config.go | LoadLoggerFromConfig | func (kern *Kernel) LoadLoggerFromConfig(conf *logconfig.LoggingConfig) error {
logger, err := lifecycle.NewLoggerFromLoggingConfig(conf)
kern.SetLogger(logger)
return err
} | go | func (kern *Kernel) LoadLoggerFromConfig(conf *logconfig.LoggingConfig) error {
logger, err := lifecycle.NewLoggerFromLoggingConfig(conf)
kern.SetLogger(logger)
return err
} | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"LoadLoggerFromConfig",
"(",
"conf",
"*",
"logconfig",
".",
"LoggingConfig",
")",
"error",
"{",
"logger",
",",
"err",
":=",
"lifecycle",
".",
"NewLoggerFromLoggingConfig",
"(",
"conf",
")",
"\n",
"kern",
".",
"SetLogg... | // LoadLoggerFromConfig adds a logging configuration to the kernel | [
"LoadLoggerFromConfig",
"adds",
"a",
"logging",
"configuration",
"to",
"the",
"kernel"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/config.go#L37-L41 |
27,087 | hyperledger/burrow | core/config.go | LoadExecutionOptionsFromConfig | func (kern *Kernel) LoadExecutionOptionsFromConfig(conf *execution.ExecutionConfig) error {
if conf != nil {
exeOptions, err := conf.ExecutionOptions()
if err != nil {
return err
}
kern.exeOptions = exeOptions
kern.timeoutFactor = conf.TimeoutFactor
}
return nil
} | go | func (kern *Kernel) LoadExecutionOptionsFromConfig(conf *execution.ExecutionConfig) error {
if conf != nil {
exeOptions, err := conf.ExecutionOptions()
if err != nil {
return err
}
kern.exeOptions = exeOptions
kern.timeoutFactor = conf.TimeoutFactor
}
return nil
} | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"LoadExecutionOptionsFromConfig",
"(",
"conf",
"*",
"execution",
".",
"ExecutionConfig",
")",
"error",
"{",
"if",
"conf",
"!=",
"nil",
"{",
"exeOptions",
",",
"err",
":=",
"conf",
".",
"ExecutionOptions",
"(",
")",
... | // LoadExecutionOptionsFromConfig builds the execution options for the kernel | [
"LoadExecutionOptionsFromConfig",
"builds",
"the",
"execution",
"options",
"for",
"the",
"kernel"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/config.go#L44-L54 |
27,088 | hyperledger/burrow | core/config.go | LoadTendermintFromConfig | func (kern *Kernel) LoadTendermintFromConfig(conf *config.BurrowConfig, privVal tmTypes.PrivValidator) (err error) {
if conf.Tendermint == nil || !conf.Tendermint.Enabled {
return nil
}
authorizedPeersProvider := conf.Tendermint.DefaultAuthorizedPeersProvider()
kern.database.Stats()
kern.info = fmt.Sprintf("Bu... | go | func (kern *Kernel) LoadTendermintFromConfig(conf *config.BurrowConfig, privVal tmTypes.PrivValidator) (err error) {
if conf.Tendermint == nil || !conf.Tendermint.Enabled {
return nil
}
authorizedPeersProvider := conf.Tendermint.DefaultAuthorizedPeersProvider()
kern.database.Stats()
kern.info = fmt.Sprintf("Bu... | [
"func",
"(",
"kern",
"*",
"Kernel",
")",
"LoadTendermintFromConfig",
"(",
"conf",
"*",
"config",
".",
"BurrowConfig",
",",
"privVal",
"tmTypes",
".",
"PrivValidator",
")",
"(",
"err",
"error",
")",
"{",
"if",
"conf",
".",
"Tendermint",
"==",
"nil",
"||",
... | // LoadTendermintFromConfig loads our consensus engine into the kernel | [
"LoadTendermintFromConfig",
"loads",
"our",
"consensus",
"engine",
"into",
"the",
"kernel"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/config.go#L57-L101 |
27,089 | hyperledger/burrow | core/config.go | LoadKernelFromConfig | func LoadKernelFromConfig(conf *config.BurrowConfig) (*Kernel, error) {
kern, err := NewKernel(conf.BurrowDir)
if err != nil {
return nil, fmt.Errorf("could not create initial kernel: %v", err)
}
if err = kern.LoadLoggerFromConfig(conf.Logging); err != nil {
return nil, fmt.Errorf("could not configure logger: ... | go | func LoadKernelFromConfig(conf *config.BurrowConfig) (*Kernel, error) {
kern, err := NewKernel(conf.BurrowDir)
if err != nil {
return nil, fmt.Errorf("could not create initial kernel: %v", err)
}
if err = kern.LoadLoggerFromConfig(conf.Logging); err != nil {
return nil, fmt.Errorf("could not configure logger: ... | [
"func",
"LoadKernelFromConfig",
"(",
"conf",
"*",
"config",
".",
"BurrowConfig",
")",
"(",
"*",
"Kernel",
",",
"error",
")",
"{",
"kern",
",",
"err",
":=",
"NewKernel",
"(",
"conf",
".",
"BurrowDir",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // LoadKernelFromConfig builds and returns a Kernel based solely on the supplied configuration | [
"LoadKernelFromConfig",
"builds",
"and",
"returns",
"a",
"Kernel",
"based",
"solely",
"on",
"the",
"supplied",
"configuration"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/core/config.go#L104-L145 |
27,090 | hyperledger/burrow | binary/integer.go | U256 | func U256(x *big.Int) *big.Int {
// Note that the And operation induces big.Int to hold a positive representation of a negative number
return new(big.Int).And(x, tt256m1)
} | go | func U256(x *big.Int) *big.Int {
// Note that the And operation induces big.Int to hold a positive representation of a negative number
return new(big.Int).And(x, tt256m1)
} | [
"func",
"U256",
"(",
"x",
"*",
"big",
".",
"Int",
")",
"*",
"big",
".",
"Int",
"{",
"// Note that the And operation induces big.Int to hold a positive representation of a negative number",
"return",
"new",
"(",
"big",
".",
"Int",
")",
".",
"And",
"(",
"x",
",",
... | // Converts a possibly negative big int x into a positive big int encoding a twos complement representation of x
// truncated to 32 bytes | [
"Converts",
"a",
"possibly",
"negative",
"big",
"int",
"x",
"into",
"a",
"positive",
"big",
"int",
"encoding",
"a",
"twos",
"complement",
"representation",
"of",
"x",
"truncated",
"to",
"32",
"bytes"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/binary/integer.go#L70-L73 |
27,091 | hyperledger/burrow | binary/integer.go | SignExtend | func SignExtend(back uint64, x *big.Int) *big.Int {
// we assume x contains a signed integer of back + 1 bytes width
// most significant bit of the back'th byte,
signBit := back*8 + 7
// single bit set at sign bit position
mask := new(big.Int).Lsh(big1, uint(signBit))
// all bits below sign bit set to 1 all above... | go | func SignExtend(back uint64, x *big.Int) *big.Int {
// we assume x contains a signed integer of back + 1 bytes width
// most significant bit of the back'th byte,
signBit := back*8 + 7
// single bit set at sign bit position
mask := new(big.Int).Lsh(big1, uint(signBit))
// all bits below sign bit set to 1 all above... | [
"func",
"SignExtend",
"(",
"back",
"uint64",
",",
"x",
"*",
"big",
".",
"Int",
")",
"*",
"big",
".",
"Int",
"{",
"// we assume x contains a signed integer of back + 1 bytes width",
"// most significant bit of the back'th byte,",
"signBit",
":=",
"back",
"*",
"8",
"+",... | // Treats the positive big int x as if it contains an embedded a back + 1 byte signed integer in its least significant
// bits and extends that sign | [
"Treats",
"the",
"positive",
"big",
"int",
"x",
"as",
"if",
"it",
"contains",
"an",
"embedded",
"a",
"back",
"+",
"1",
"byte",
"signed",
"integer",
"in",
"its",
"least",
"significant",
"bits",
"and",
"extends",
"that",
"sign"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/binary/integer.go#L88-L103 |
27,092 | hyperledger/burrow | keys/key_client.go | HealthCheck | func (l *remoteKeyClient) HealthCheck() error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
_, err := l.kc.List(ctx, &ListRequest{})
return err
} | go | func (l *remoteKeyClient) HealthCheck() error {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
_, err := l.kc.List(ctx, &ListRequest{})
return err
} | [
"func",
"(",
"l",
"*",
"remoteKeyClient",
")",
"HealthCheck",
"(",
")",
"error",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"10",
"*",
"time",
".",
"Second",
")",
"\n",
"defer",
"... | // HealthCheck returns nil if the keys instance is healthy, error otherwise | [
"HealthCheck",
"returns",
"nil",
"if",
"the",
"keys",
"instance",
"is",
"healthy",
"error",
"otherwise"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/keys/key_client.go#L177-L182 |
27,093 | hyperledger/burrow | keys/key_client.go | NewRemoteKeyClient | func NewRemoteKeyClient(rpcAddress string, logger *logging.Logger) (KeyClient, error) {
logger = logger.WithScope("RemoteKeyClient")
var opts []grpc.DialOption
opts = append(opts, grpc.WithInsecure())
conn, err := grpc.Dial(rpcAddress, opts...)
if err != nil {
return nil, err
}
kc := NewKeysClient(conn)
retu... | go | func NewRemoteKeyClient(rpcAddress string, logger *logging.Logger) (KeyClient, error) {
logger = logger.WithScope("RemoteKeyClient")
var opts []grpc.DialOption
opts = append(opts, grpc.WithInsecure())
conn, err := grpc.Dial(rpcAddress, opts...)
if err != nil {
return nil, err
}
kc := NewKeysClient(conn)
retu... | [
"func",
"NewRemoteKeyClient",
"(",
"rpcAddress",
"string",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"(",
"KeyClient",
",",
"error",
")",
"{",
"logger",
"=",
"logger",
".",
"WithScope",
"(",
"\"",
"\"",
")",
"\n",
"var",
"opts",
"[",
"]",
"grp... | // NewRemoteKeyClient returns a new keys client for provided rpc location | [
"NewRemoteKeyClient",
"returns",
"a",
"new",
"keys",
"client",
"for",
"provided",
"rpc",
"location"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/keys/key_client.go#L185-L196 |
27,094 | hyperledger/burrow | keys/key_client.go | NewLocalKeyClient | func NewLocalKeyClient(ks *KeyStore, logger *logging.Logger) KeyClient {
logger = logger.WithScope("LocalKeyClient")
return &localKeyClient{ks: ks, logger: logger}
} | go | func NewLocalKeyClient(ks *KeyStore, logger *logging.Logger) KeyClient {
logger = logger.WithScope("LocalKeyClient")
return &localKeyClient{ks: ks, logger: logger}
} | [
"func",
"NewLocalKeyClient",
"(",
"ks",
"*",
"KeyStore",
",",
"logger",
"*",
"logging",
".",
"Logger",
")",
"KeyClient",
"{",
"logger",
"=",
"logger",
".",
"WithScope",
"(",
"\"",
"\"",
")",
"\n",
"return",
"&",
"localKeyClient",
"{",
"ks",
":",
"ks",
... | // NewLocalKeyClient returns a new keys client, backed by the local filesystem | [
"NewLocalKeyClient",
"returns",
"a",
"new",
"keys",
"client",
"backed",
"by",
"the",
"local",
"filesystem"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/keys/key_client.go#L199-L202 |
27,095 | hyperledger/burrow | keys/key_client.go | AddressableSigner | func AddressableSigner(keyClient KeyClient, address crypto.Address) (*Signer, error) {
publicKey, err := keyClient.PublicKey(address)
if err != nil {
return nil, err
}
// TODO: we can do better than this and return a typed signature when we reform the keys service
return &Signer{
keyClient: keyClient,
addres... | go | func AddressableSigner(keyClient KeyClient, address crypto.Address) (*Signer, error) {
publicKey, err := keyClient.PublicKey(address)
if err != nil {
return nil, err
}
// TODO: we can do better than this and return a typed signature when we reform the keys service
return &Signer{
keyClient: keyClient,
addres... | [
"func",
"AddressableSigner",
"(",
"keyClient",
"KeyClient",
",",
"address",
"crypto",
".",
"Address",
")",
"(",
"*",
"Signer",
",",
"error",
")",
"{",
"publicKey",
",",
"err",
":=",
"keyClient",
".",
"PublicKey",
"(",
"address",
")",
"\n",
"if",
"err",
"... | // AddressableSigner creates a signer that assumes the address holds an Ed25519 key | [
"AddressableSigner",
"creates",
"a",
"signer",
"that",
"assumes",
"the",
"address",
"holds",
"an",
"Ed25519",
"key"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/keys/key_client.go#L211-L222 |
27,096 | hyperledger/burrow | vent/sqldb/adapters/sqlite_adapter.go | Open | func (adapter *SQLiteAdapter) Open(dbURL string) (*sql.DB, error) {
db, err := sql.Open("sqlite3", dbURL)
if err != nil {
adapter.Log.Info("msg", "Error creating database connection", "err", err)
return nil, err
}
return db, nil
} | go | func (adapter *SQLiteAdapter) Open(dbURL string) (*sql.DB, error) {
db, err := sql.Open("sqlite3", dbURL)
if err != nil {
adapter.Log.Info("msg", "Error creating database connection", "err", err)
return nil, err
}
return db, nil
} | [
"func",
"(",
"adapter",
"*",
"SQLiteAdapter",
")",
"Open",
"(",
"dbURL",
"string",
")",
"(",
"*",
"sql",
".",
"DB",
",",
"error",
")",
"{",
"db",
",",
"err",
":=",
"sql",
".",
"Open",
"(",
"\"",
"\"",
",",
"dbURL",
")",
"\n",
"if",
"err",
"!=",... | // Open connects to a SQLiteQL database, opens it & create default schema if provided | [
"Open",
"connects",
"to",
"a",
"SQLiteQL",
"database",
"opens",
"it",
"&",
"create",
"default",
"schema",
"if",
"provided"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/adapters/sqlite_adapter.go#L42-L50 |
27,097 | hyperledger/burrow | vent/sqldb/adapters/sqlite_adapter.go | AlterColumnQuery | func (adapter *SQLiteAdapter) AlterColumnQuery(tableName, columnName string, sqlColumnType types.SQLColumnType, length, order int) (string, string) {
sqlType, _ := adapter.TypeMapping(sqlColumnType)
if length > 0 {
sqlType = Cleanf("%s(%d)", sqlType, length)
}
query := Cleanf("ALTER TABLE %s ADD COLUMN %s %s;",
... | go | func (adapter *SQLiteAdapter) AlterColumnQuery(tableName, columnName string, sqlColumnType types.SQLColumnType, length, order int) (string, string) {
sqlType, _ := adapter.TypeMapping(sqlColumnType)
if length > 0 {
sqlType = Cleanf("%s(%d)", sqlType, length)
}
query := Cleanf("ALTER TABLE %s ADD COLUMN %s %s;",
... | [
"func",
"(",
"adapter",
"*",
"SQLiteAdapter",
")",
"AlterColumnQuery",
"(",
"tableName",
",",
"columnName",
"string",
",",
"sqlColumnType",
"types",
".",
"SQLColumnType",
",",
"length",
",",
"order",
"int",
")",
"(",
"string",
",",
"string",
")",
"{",
"sqlTy... | // AlterColumnQuery returns a query for adding a new column to a table | [
"AlterColumnQuery",
"returns",
"a",
"query",
"for",
"adding",
"a",
"new",
"column",
"to",
"a",
"table"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/vent/sqldb/adapters/sqlite_adapter.go#L184-L208 |
27,098 | hyperledger/burrow | permission/perm_flag.go | String | func (pf PermFlag) String() string {
switch pf {
case AllPermFlags:
return AllString
case Root:
return RootString
case Send:
return SendString
case Call:
return CallString
case CreateContract:
return CreateContractString
case CreateAccount:
return CreateAccountString
case Bond:
return BondString
... | go | func (pf PermFlag) String() string {
switch pf {
case AllPermFlags:
return AllString
case Root:
return RootString
case Send:
return SendString
case Call:
return CallString
case CreateContract:
return CreateContractString
case CreateAccount:
return CreateAccountString
case Bond:
return BondString
... | [
"func",
"(",
"pf",
"PermFlag",
")",
"String",
"(",
")",
"string",
"{",
"switch",
"pf",
"{",
"case",
"AllPermFlags",
":",
"return",
"AllString",
"\n",
"case",
"Root",
":",
"return",
"RootString",
"\n",
"case",
"Send",
":",
"return",
"SendString",
"\n",
"c... | // Returns the string name of a single bit non-composite PermFlag, or otherwise UnknownString
// See BasePermissionsToStringList to generate a string representation of a composite PermFlag | [
"Returns",
"the",
"string",
"name",
"of",
"a",
"single",
"bit",
"non",
"-",
"composite",
"PermFlag",
"or",
"otherwise",
"UnknownString",
"See",
"BasePermissionsToStringList",
"to",
"generate",
"a",
"string",
"representation",
"of",
"a",
"composite",
"PermFlag"
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/perm_flag.go#L95-L136 |
27,099 | hyperledger/burrow | permission/perm_flag.go | PermStringToFlag | func PermStringToFlag(perm string) (PermFlag, error) {
switch strings.ToLower(perm) {
case AllString:
return AllPermFlags, nil
case RootString:
return Root, nil
case SendString:
return Send, nil
case CallString:
return Call, nil
case CreateContractString, "createcontract", "create_contract":
return Crea... | go | func PermStringToFlag(perm string) (PermFlag, error) {
switch strings.ToLower(perm) {
case AllString:
return AllPermFlags, nil
case RootString:
return Root, nil
case SendString:
return Send, nil
case CallString:
return Call, nil
case CreateContractString, "createcontract", "create_contract":
return Crea... | [
"func",
"PermStringToFlag",
"(",
"perm",
"string",
")",
"(",
"PermFlag",
",",
"error",
")",
"{",
"switch",
"strings",
".",
"ToLower",
"(",
"perm",
")",
"{",
"case",
"AllString",
":",
"return",
"AllPermFlags",
",",
"nil",
"\n",
"case",
"RootString",
":",
... | // PermStringToFlag maps camel- and snake case strings to the
// the corresponding permission flag. | [
"PermStringToFlag",
"maps",
"camel",
"-",
"and",
"snake",
"case",
"strings",
"to",
"the",
"the",
"corresponding",
"permission",
"flag",
"."
] | 59993f5aad71a8e16ab6ed4e57e138e2398eae4e | https://github.com/hyperledger/burrow/blob/59993f5aad71a8e16ab6ed4e57e138e2398eae4e/permission/perm_flag.go#L140-L181 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.