(t *testing.T)
| 253 | } |
| 254 | |
| 255 | func TestExecutorErrAPIEnv(t *testing.T) { |
| 256 | exec, q := initEnv(types.GetDefaultCfgstring()) |
| 257 | types.AllowUserExec = append(types.AllowUserExec, []byte("demo")) |
| 258 | exec.disableLocal = true |
| 259 | cfg := exec.client.GetConfig() |
| 260 | cfg.SetMinFee(0) |
| 261 | Register(cfg) |
| 262 | execInit(cfg) |
| 263 | |
| 264 | store := store.New(cfg) |
| 265 | store.SetQueueClient(q.Client()) |
| 266 | defer store.Close() |
| 267 | |
| 268 | var txs []*types.Transaction |
| 269 | genkey := util.TestPrivkeyList[0] |
| 270 | txs = append(txs, util.CreateTxWithExecer(cfg, genkey, "demo")) |
| 271 | txlist := &types.ExecTxList{ |
| 272 | StateHash: nil, |
| 273 | Height: 1, |
| 274 | BlockTime: time.Now().Unix(), |
| 275 | Difficulty: 1, |
| 276 | MainHash: nil, |
| 277 | MainHeight: 1, |
| 278 | ParentHash: nil, |
| 279 | Txs: txs, |
| 280 | } |
| 281 | msg := queue.NewMessage(0, "", 1, txlist) |
| 282 | exec.procExecTxList(msg) |
| 283 | _, err := exec.client.WaitTimeout(msg, 100*time.Second) |
| 284 | fmt.Println(err) |
| 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() |
nothing calls this directly
no test coverage detected