(ctx context.Context, t *testing.T, params uttypes.TestParams)
| 47 | var _ uttypes.TestWorker = (*postUpgrade)(nil) |
| 48 | |
| 49 | func (pu *postUpgrade) Run(ctx context.Context, t *testing.T, params uttypes.TestParams) { |
| 50 | encCfg := sdkutil.MakeEncodingConfig() |
| 51 | akash.ModuleBasics().RegisterInterfaces(encCfg.InterfaceRegistry) |
| 52 | rpcClient, err := arpcclient.NewClient(ctx, params.Node) |
| 53 | require.NoError(t, err) |
| 54 | |
| 55 | cctx := sdkclient.Context{}. |
| 56 | WithCodec(encCfg.Codec). |
| 57 | WithInterfaceRegistry(encCfg.InterfaceRegistry). |
| 58 | WithTxConfig(encCfg.TxConfig). |
| 59 | WithLegacyAmino(encCfg.Amino). |
| 60 | WithAccountRetriever(authtypes.AccountRetriever{}). |
| 61 | WithBroadcastMode(cflags.BroadcastBlock). |
| 62 | WithHomeDir(params.Home). |
| 63 | WithChainID(params.ChainID). |
| 64 | WithNodeURI(params.Node). |
| 65 | WithClient(rpcClient). |
| 66 | WithSkipConfirmation(true). |
| 67 | WithFrom(params.From). |
| 68 | WithKeyringDir(params.Home). |
| 69 | WithSignModeStr("direct") |
| 70 | |
| 71 | kr, err := sdkclient.NewKeyringFromBackend(cctx, params.KeyringBackend) |
| 72 | require.NoError(t, err) |
| 73 | |
| 74 | cctx = cctx.WithKeyring(kr) |
| 75 | |
| 76 | info, err := kr.Key(params.From) |
| 77 | require.NoError(t, err) |
| 78 | |
| 79 | mainAddr, err := info.GetAddress() |
| 80 | require.NoError(t, err) |
| 81 | |
| 82 | mainCctx := cctx.WithFromName(info.Name). |
| 83 | WithFromAddress(mainAddr) |
| 84 | |
| 85 | opts := []cltypes.ClientOption{ |
| 86 | cltypes.WithGasPrices("0.025uakt"), |
| 87 | cltypes.WithGas(cltypes.GasSetting{Simulate: false, Gas: 1000000}), |
| 88 | cltypes.WithGasAdjustment(2), |
| 89 | } |
| 90 | |
| 91 | mcl, err := client.DiscoverClient(ctx, mainCctx, opts...) |
| 92 | require.NoError(t, err) |
| 93 | require.NotNil(t, mcl) |
| 94 | |
| 95 | // should not be able to deploy smart contract directly |
| 96 | wasm, err := os.ReadFile(fmt.Sprintf("%s/tests/upgrade/testdata/hackatom.wasm", params.SourceDir)) |
| 97 | require.NoError(t, err) |
| 98 | |
| 99 | // gzip the wasm file |
| 100 | if ioutils.IsWasm(wasm) { |
| 101 | wasm, err = ioutils.GzipIt(wasm) |
| 102 | require.NoError(t, err) |
| 103 | } else { |
| 104 | require.True(t, ioutils.IsGzip(wasm)) |
| 105 | } |
| 106 |
nothing calls this directly
no test coverage detected