(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestKeyAllow(t *testing.T) { |
| 116 | exect, _ := initEnv(types.GetDefaultCfgstring()) |
| 117 | execInit(nil) |
| 118 | key := []byte("mavl-coins-bty-exec-1wvmD6RNHzwhY4eN75WnM6JcaAvNQ4nHx:19xXg1WHzti5hzBRTUphkM8YmuX6jJkoAA") |
| 119 | exec := []byte("retrieve") |
| 120 | tx1 := "0a05636f696e73120e18010a0a1080c2d72f1a036f746520a08d0630f1cdebc8f7efa5e9283a22313271796f6361794e46374c7636433971573461767873324537553431664b536676" |
| 121 | tx11, _ := hex.DecodeString(tx1) |
| 122 | var tx12 types.Transaction |
| 123 | types.Decode(tx11, &tx12) |
| 124 | tx12.Execer = exec |
| 125 | ctx := &executorCtx{ |
| 126 | stateHash: nil, |
| 127 | height: 1, |
| 128 | blocktime: time.Now().Unix(), |
| 129 | difficulty: 1, |
| 130 | mainHash: nil, |
| 131 | parentHash: nil, |
| 132 | } |
| 133 | execute := newExecutor(ctx, exect, nil, nil, nil) |
| 134 | if !isAllowKeyWrite(execute, key, exec, &tx12, 0) { |
| 135 | t.Error("retrieve can modify exec") |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | func TestKeyAllow_evm(t *testing.T) { |
| 140 | exect, _ := initEnv(types.GetDefaultCfgstring()) |
nothing calls this directly
no test coverage detected