Skip to content

Commit ab00d8e

Browse files
author
Daisuke Kanda
committed
fix review
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
1 parent 86e23b4 commit ab00d8e

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

chains/debug/chain.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ func (c *Chain) ChainID() string {
2222
return c.OriginChain.ChainID()
2323
}
2424

25-
func (c *Chain) Config() ChainConfig {
26-
return c.config
27-
}
28-
2925
func (c *Chain) Codec() codec.ProtoCodecMarshaler {
3026
return c.OriginChain.Codec()
3127
}

chains/debug/module/module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var _ config.ModuleI = (*Module)(nil)
1313

1414
// Name returns the name of the module
1515
func (Module) Name() string {
16-
return "debug"
16+
return "debug.chain"
1717
}
1818

1919
// RegisterInterfaces register the module interfaces to protobuf Any.

chains/debug/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func debugFakeLost(ctx context.Context, chain *Chain, queryHeight ibcexported.He
2020
logger := log.GetLogger()
2121
env := fmt.Sprintf("DEBUG_RELAYER_PRUNE_AFTER_BLOCKS_CHAIN_%s", chain.ChainID())
2222
if val, ok := os.LookupEnv(env); ok {
23-
logger.Debug(env, "chain", chain.ChainID(), "value", val)
23+
logger.DebugContext(ctx, env, "chain", chain.ChainID(), "value", val)
2424

2525
threshold, err := strconv.Atoi(val)
2626
if err != nil {

provers/debug/module/module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var _ config.ModuleI = (*Module)(nil)
1313

1414
// Name returns the name of the module
1515
func (Module) Name() string {
16-
return "debug-client"
16+
return "debug.prover"
1717
}
1818

1919
// RegisterInterfaces register the module interfaces to protobuf Any.

provers/debug/prover.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func debugFakeLost(ctx context.Context, chain core.Chain, queryHeight exported.H
1919
logger := log.GetLogger()
2020
env := fmt.Sprintf("DEBUG_RELAYER_PRUNE_AFTER_BLOCKS_PROVER_%s", chain.ChainID())
2121
if val, ok := os.LookupEnv(env); ok {
22-
logger.Info(fmt.Sprintf(">%s: chain=%s: '%v'", env, chain.ChainID(), val))
22+
logger.DebugContext(ctx, fmt.Sprintf(">%s: chain=%s: '%v'", env, chain.ChainID(), val))
2323

2424
threshold, err := strconv.Atoi(val)
2525
if err != nil {
@@ -86,7 +86,7 @@ func (pr *Prover) SetupHeadersForUpdate(ctx context.Context, counterparty core.F
8686
env := fmt.Sprintf("DEBUG_RELAYER_SHFU_WAIT_%s", pr.chain.ChainID())
8787

8888
if val, ok := os.LookupEnv(env); ok {
89-
logger.Debug(env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "value", val)
89+
logger.DebugContext(ctx, env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "value", val)
9090
t, err := strconv.Atoi(val)
9191
if err != nil {
9292
logger.ErrorContext(ctx, "malformed value", err, "value", val)
@@ -96,12 +96,12 @@ func (pr *Prover) SetupHeadersForUpdate(ctx context.Context, counterparty core.F
9696
lap := 60
9797
n := t / lap
9898
for i := 0; i < n; i++ {
99-
logger.Debug(env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "lap", fmt.Sprintf("%v/%v", (i+1)*lap, t))
99+
logger.DebugContext(ctx, env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "lap", fmt.Sprintf("%v/%v", (i+1)*lap, t))
100100
time.Sleep(time.Duration(lap) * time.Second)
101101
}
102-
logger.Debug(env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "lap", fmt.Sprintf("%v/%v", t-n*lap, t))
102+
logger.DebugContext(ctx, env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "lap", fmt.Sprintf("%v/%v", t-n*lap, t))
103103
time.Sleep(time.Duration(t-n*lap) * time.Second)
104-
logger.Debug(env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "done", t)
104+
logger.DebugContext(ctx, env, "chain", pr.chain.ChainID(), "cp", counterparty.ChainID(), "done", t)
105105
}
106106
return headerStream, nil
107107
}

0 commit comments

Comments
 (0)