Skip to content

Commit 28a221c

Browse files
committed
fix(cmd/testnetify): use gen doc provider from cosmos sdk
Signed-off-by: Artur Troian <[email protected]>
1 parent 853b18a commit 28a221c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

cmd/akash/cmd/testnetify/testnetify.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"golang.org/x/sync/errgroup"
1818

1919
cmtcfg "github.com/cometbft/cometbft/config"
20-
"github.com/cometbft/cometbft/crypto/tmhash"
2120
"github.com/cometbft/cometbft/node"
2221
pvm "github.com/cometbft/cometbft/privval"
2322
cmtstate "github.com/cometbft/cometbft/proto/tendermint/state"
@@ -303,7 +302,7 @@ func testnetify(sctx *sdksrv.Context, tcfg TestnetConfig, testnetAppCreator type
303302
}
304303

305304
// Load the comet genesis doc provider.
306-
genDocProvider := node.DefaultGenesisDocProviderFunc(config)
305+
genDocProvider := sdksrv.GetGenDocProvider(config)
307306

308307
// Initialize blockStore and stateDB.
309308
blockStoreDB, err := cmtcfg.DefaultDBProvider(&cmtcfg.DBContext{ID: "blockstore", Config: config})
@@ -325,14 +324,17 @@ func testnetify(sctx *sdksrv.Context, tcfg TestnetConfig, testnetAppCreator type
325324
_ = stateDB.Close()
326325
}()
327326

328-
jsonBlob, err := os.ReadFile(config.GenesisFile())
329-
if err != nil {
330-
return nil, fmt.Errorf("couldn't read GenesisDoc file: %w", err)
327+
var updatedChecksum []byte
328+
{
329+
genDoc, err := genDocProvider()
330+
if err != nil {
331+
return nil, err
332+
}
333+
334+
updatedChecksum = genDoc.Sha256Checksum
331335
}
332336

333337
// Since we modified the chainID, we set the new genesisDocHash in the stateDB.
334-
updatedChecksum := tmhash.Sum(jsonBlob)
335-
336338
if err = stateDB.SetSync(node.GenesisDocHashKey, updatedChecksum); err != nil {
337339
return nil, node.ErrSaveGenesisDocHash{Err: err}
338340
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ replace (
5959
// use akash fork of cometbft
6060
github.com/cometbft/cometbft => github.com/akash-network/cometbft v0.38.19-akash.1
6161
// use akash fork of cosmos sdk
62-
github.com/cosmos/cosmos-sdk => github.com/akash-network/cosmos-sdk v0.53.4-akash.7
62+
github.com/cosmos/cosmos-sdk => github.com/akash-network/cosmos-sdk v0.53.4-akash.b.10
6363

6464
github.com/cosmos/gogoproto => github.com/akash-network/gogoproto v1.7.0-akash.2
6565

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,8 +1281,8 @@ github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3
12811281
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
12821282
github.com/akash-network/cometbft v0.38.19-akash.1 h1:am45M/0vjs1FEwh1WiLv/cp92Yskj2Dls997phjnxso=
12831283
github.com/akash-network/cometbft v0.38.19-akash.1/go.mod h1:UCu8dlHqvkAsmAFmWDRWNZJPlu6ya2fTWZlDrWsivwo=
1284-
github.com/akash-network/cosmos-sdk v0.53.4-akash.7 h1:Z/hD79JXHigTPsIDzTtcQl3hGYiPqy45pqKBVOqH9nI=
1285-
github.com/akash-network/cosmos-sdk v0.53.4-akash.7/go.mod h1:IZwPUVJ6FYETzU2GIZdYzCqi9IcXT6idNx6QcrtuG3M=
1284+
github.com/akash-network/cosmos-sdk v0.53.4-akash.b.10 h1:zPQVFSuBQKE3orKGgePPLU6eWn7kTAMCfuqFFa1Gc3Y=
1285+
github.com/akash-network/cosmos-sdk v0.53.4-akash.b.10/go.mod h1:gZcyUJu6h94FfxgJbuBpiW7RPCFEV/+GJdy4UAJ3Y1Q=
12861286
github.com/akash-network/gogoproto v1.7.0-akash.2 h1:zY5seM6kBOLMBWn15t8vrY1ao4J1HjrhNaEeO/Soro0=
12871287
github.com/akash-network/gogoproto v1.7.0-akash.2/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0=
12881288
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=

0 commit comments

Comments
 (0)