(t *testing.T)
| 285 | assert.Equal(t, true, api.IsAPIEnvError(err)) |
| 286 | } |
| 287 | func TestCheckTx(t *testing.T) { |
| 288 | exec, q := initEnv(types.ReadFile("../cmd/chain33/chain33.test.toml")) |
| 289 | cfg := exec.client.GetConfig() |
| 290 | |
| 291 | store := store.New(cfg) |
| 292 | store.SetQueueClient(q.Client()) |
| 293 | defer store.Close() |
| 294 | |
| 295 | addr, priv := util.Genaddress() |
| 296 | |
| 297 | tx := util.CreateCoinsTx(cfg, priv, addr, types.DefaultCoinPrecision) |
| 298 | tx.Execer = []byte("user.xxx") |
| 299 | tx.To = address.ExecAddress("user.xxx") |
| 300 | tx.Fee = 2 * types.DefaultCoinPrecision |
| 301 | tx.Sign(types.SECP256K1, priv) |
| 302 | |
| 303 | var txs []*types.Transaction |
| 304 | txs = append(txs, tx) |
| 305 | ctx := &executorCtx{ |
| 306 | stateHash: nil, |
| 307 | height: 0, |
| 308 | blocktime: time.Now().Unix(), |
| 309 | difficulty: 1, |
| 310 | mainHash: nil, |
| 311 | parentHash: nil, |
| 312 | } |
| 313 | execute := newExecutor(ctx, exec, nil, txs, nil) |
| 314 | err := execute.execCheckTx(tx, 0) |
| 315 | assert.Equal(t, err, types.ErrNoBalance) |
| 316 | } |
| 317 | |
| 318 | func TestExecutorUpgradeMsg(t *testing.T) { |
| 319 | exec, q := initEnv(types.GetDefaultCfgstring()) |
nothing calls this directly
no test coverage detected