Skip to content

Commit

Permalink
Map zap Debug level to post-rs Trace
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed May 23, 2023
1 parent 50cd5e1 commit 4214647
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/postrs/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
oncer sync.Once

levelMap = map[zapcore.Level]C.Level{
zapcore.DebugLevel: C.Debug,
zapcore.DebugLevel: C.Trace,
zapcore.InfoLevel: C.Info,
zapcore.WarnLevel: C.Warn,
zapcore.ErrorLevel: C.Error,
Expand Down
4 changes: 3 additions & 1 deletion verifying/verifying_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ func Test_Verify(t *testing.T) {
commitmentAtxId := make([]byte, 32)
ch := make(shared.Challenge, 32)

logger := zaptest.NewLogger(t, zaptest.Level(zap.DebugLevel))
cfg, opts := getTestConfig(t)
init, err := initialization.NewInitializer(
initialization.WithNodeId(nodeId),
initialization.WithCommitmentAtxId(commitmentAtxId),
initialization.WithConfig(cfg),
initialization.WithInitOpts(opts),
initialization.WithLogger(logger),
)
r.NoError(err)
r.NoError(init.Initialize(context.Background()))
Expand All @@ -58,7 +60,7 @@ func Test_Verify(t *testing.T) {
)
r.NoError(err)

r.NoError(Verify(proof, proofMetadata, cfg, zaptest.NewLogger(t, zaptest.Level(zap.DebugLevel))))
r.NoError(Verify(proof, proofMetadata, cfg, logger))
}

func Test_Verify_Detects_invalid_proof(t *testing.T) {
Expand Down

0 comments on commit 4214647

Please sign in to comment.