-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: failing due to cel-app panic with InitChain
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package state | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"github.com/celestiaorg/celestia-app/app" | ||
apptypes "github.com/celestiaorg/celestia-app/x/payment/types" | ||
"github.com/celestiaorg/celestia-node/core" | ||
"github.com/cosmos/cosmos-sdk/crypto/hd" | ||
"github.com/cosmos/cosmos-sdk/crypto/keyring" | ||
"github.com/cosmos/cosmos-sdk/testutil" | ||
"github.com/stretchr/testify/require" | ||
"github.com/tendermint/spm/cosmoscmd" | ||
"os" | ||
"testing" | ||
|
||
apputil "github.com/celestiaorg/celestia-app/testutil" | ||
) | ||
|
||
func TestCoreAccess(t *testing.T) { | ||
// create signer + acct | ||
dir := t.TempDir() | ||
ring, err := keyring.New("celestia", "test", dir, os.Stdin) | ||
require.NoError(t, err) | ||
acc, err := ring.NewAccount("something", testutil.TestMnemonic, "", "", hd.Secp256k1) | ||
require.NoError(t, err) | ||
signer := apptypes.NewKeyringSigner(ring, acc.GetName(), "test") | ||
// make encoding config | ||
encCfg := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) | ||
|
||
// create app and start core node | ||
celapp := apputil.SetupTestApp(t, acc.GetAddress()) | ||
nd := core.StartMockNode(celapp) | ||
defer nd.Stop() //nolint:errcheck | ||
_, ip := core.GetRemoteEndpoint(nd) | ||
grpcEndpoint := fmt.Sprintf("%s:9090", ip) | ||
|
||
// create CoreAccess with the grpc endpoint to mock core node | ||
ca, err := NewCoreAccessor(signer, encCfg, grpcEndpoint) | ||
require.NoError(t, err) | ||
bal, err := ca.Balance(context.Background()) | ||
require.NoError(t, err) | ||
t.Log("BAL: ", bal) | ||
} | ||
|