github.com/n1ghtfa1l/go-vnt@v0.6.4-alpha.6/core/wavm/tests/mutable.json (about) 1 { 2 "env": { 3 "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", 4 "currentNumber": 257, 5 "currentGasLimit": 4000000, 6 "currentDifficulty": 256, 7 "currentTimestamp": 1546273000, 8 "currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" 9 }, 10 "exec": { 11 "address": "0xcccccccccccccccccccccccccccccccccccccccc", 12 "value": 0, 13 "gas": 4000000, 14 "caller": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 15 "origin": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 16 "gasPrice": 1000000 17 }, 18 "pre": { 19 "0xcccccccccccccccccccccccccccccccccccccccc": { 20 "balance": "0xDE0B6B3A7640000", 21 "code": "", 22 "nonce": "0x00", 23 "storage": {} 24 }, 25 "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa": { 26 "balance": "0xDE0B6B3A7640000", 27 "code": "", 28 "nonce": "0x00", 29 "storage": {} 30 } 31 }, 32 "testcase": [ 33 { 34 "code": "mutableCall/$TestMutableCall.compress", 35 "abi": "mutableCall/$TestMutableCall.abi", 36 "initcase": { 37 "needinit": false, 38 "input": [] 39 }, 40 "tests": [] 41 }, 42 { 43 "code": "mutable/$TestMutable.compress", 44 "abi": "mutable/$TestMutable.abi", 45 "initcase": { 46 "needinit": true, 47 "input": [] 48 }, 49 "tests": [ 50 { 51 "function": "TestWriteWithMutable", 52 "input": [], 53 "wanted": { 54 "data": "false", 55 "type": "bool" 56 } 57 }, 58 { 59 "function": "TestWriteWithUnmutable", 60 "input": [], 61 "error": "Mutable Forbidden: This function is not a mutable function" 62 }, 63 { 64 "function": "TestEventWithMutable", 65 "input": [], 66 "wanted": { 67 "data": "false", 68 "type": "bool" 69 } 70 }, 71 { 72 "function": "TestEventWithUnmutable", 73 "input": [], 74 "error": "Mutable Forbidden: This function is not a mutable function" 75 }, 76 { 77 "function": "TestMutableCallWithMutable", 78 "input": [ 79 { 80 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 81 "type": "address" 82 }, 83 { 84 "data": "0", 85 "type": "uint256" 86 }, 87 { 88 "data": "50000", 89 "type": "uint64" 90 }, 91 { 92 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 93 "type": "address" 94 }, 95 { 96 "data": "0", 97 "type": "uint256" 98 } 99 ], 100 "wanted": { 101 "data": "false", 102 "type": "bool" 103 } 104 }, 105 { 106 "function": "TestMutableCallWithUnmutable", 107 "input": [ 108 { 109 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 110 "type": "address" 111 }, 112 { 113 "data": "0", 114 "type": "uint256" 115 }, 116 { 117 "data": "50000", 118 "type": "uint64" 119 } 120 ], 121 "wanted": { 122 "data": "false", 123 "type": "bool" 124 } 125 }, 126 { 127 "function": "TestMutableCallWithUnmutableString", 128 "input": [ 129 { 130 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 131 "type": "string" 132 }, 133 { 134 "data": "0", 135 "type": "uint256" 136 }, 137 { 138 "data": "50000", 139 "type": "uint64" 140 } 141 ], 142 "wanted": { 143 "data": "false", 144 "type": "bool" 145 } 146 }, 147 { 148 "function": "Call_testSHA3", 149 "input": [ 150 { 151 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 152 "type": "string" 153 }, 154 { 155 "data": "0", 156 "type": "uint256" 157 }, 158 { 159 "data": "50000", 160 "type": "uint64" 161 }, 162 { 163 "data": "aaaaaaaaaaaaaaaaaaa", 164 "type": "string" 165 } 166 ], 167 "wanted": { 168 "data": "0x9db3025b34b5ed7402fc01db6f1b69cd3d9a64a268e4c2275b498a7af5f67932", 169 "type": "string" 170 } 171 }, 172 { 173 "function": "TestUnmutableCallWithMutable", 174 "input": [ 175 { 176 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 177 "type": "address" 178 }, 179 { 180 "data": "0", 181 "type": "uint256" 182 }, 183 { 184 "data": "50000", 185 "type": "uint64" 186 }, 187 { 188 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 189 "type": "address" 190 }, 191 { 192 "data": "0", 193 "type": "uint256" 194 } 195 ], 196 "error": "failed to get result in contract call Reason : Mismatch mutable type, parent function type : unmutable, current function type : mutable" 197 }, 198 { 199 "function": "Call_TestCallGas", 200 "input": [ 201 { 202 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 203 "type": "string" 204 }, 205 { 206 "data": "0", 207 "type": "uint256" 208 }, 209 { 210 "data": "1200", 211 "type": "uint64" 212 } 213 ], 214 "wanted": { 215 "data": "call success", 216 "type": "string" 217 } 218 }, 219 { 220 "function": "Call_TestCallReturnBool", 221 "input": [ 222 { 223 "data": "0xcccccccccccccccccccccccccccccccccccccccc", 224 "type": "string" 225 }, 226 { 227 "data": "0", 228 "type": "uint256" 229 }, 230 { 231 "data": "1200", 232 "type": "uint64" 233 } 234 ], 235 "wanted": { 236 "data": "true", 237 "type": "bool" 238 } 239 } 240 ] 241 } 242 ] 243 }