Skip to content

Commit 1aa3701

Browse files
committed
print outputroot
1 parent 9ace9c7 commit 1aa3701

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

executor/db.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package executor
22

33
import (
44
"context"
5+
"encoding/base64"
56
"encoding/json"
67
"fmt"
78
"math/bits"
89
"time"
910

11+
ophosttypes "github.com/initia-labs/OPinit/x/ophost/types"
1012
dbtypes "github.com/initia-labs/opinit-bots/db/types"
1113
executortypes "github.com/initia-labs/opinit-bots/executor/types"
1214
merkletypes "github.com/initia-labs/opinit-bots/merkle/types"
@@ -227,7 +229,10 @@ func Migration0192(ctx context.Context, db types.DB, rpcClient *rpcclient.RPCCli
227229
if err != nil {
228230
return true, err
229231
}
230-
fmt.Printf("finalized tree index: %d, start leaf index: %d, leaf count: %d, block height: %d, block hash: %X\n", tree.TreeIndex, tree.StartLeafIndex, tree.LeafCount, extraData.BlockNumber, extraData.BlockHash)
232+
outputRoot := ophosttypes.GenerateOutputRoot(1, tree.Root, extraData.BlockHash)
233+
outputRootStr := base64.StdEncoding.EncodeToString(outputRoot[:])
234+
235+
fmt.Printf("finalized tree index: %d, start leaf index: %d, leaf count: %d, block height: %d, block hash: %X, outputRoot: %s\n", tree.TreeIndex, tree.StartLeafIndex, tree.LeafCount, extraData.BlockNumber, extraData.BlockHash, outputRootStr)
231236
return false, nil
232237
})
233238
}

0 commit comments

Comments
 (0)