github.com/n1ghtfa1l/go-vnt@v0.6.4-alpha.6/core/wavm/tests/safemath.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 "code": "safemath/TestSafeMath.compress", 34 "abi": "safemath/abi.json", 35 "initcase": { 36 "needinit": true, 37 "input": [] 38 }, 39 "tests": [{ 40 "function": "Test_U256SafeMul_overflow", 41 "input": [], 42 "wanted": { 43 "data": "false", 44 "type": "bool" 45 }, 46 "error": "wavm: execution reverted" 47 }, { 48 "function": "Test_U256SafeMul_zero", 49 "input": [], 50 "wanted": { 51 "data": "0", 52 "type": "uint256" 53 } 54 }, { 55 "function": "Test_U256SafeMul_custom", 56 "input": [], 57 "wanted": { 58 "data": "57896044618658097711785492504343953926634992332820282019728792003956564819968", 59 "type": "uint256" 60 } 61 }, { 62 "function": "Test_U256SafeDiv_zero", 63 "input": [], 64 "error": "wavm: execution reverted" 65 }, { 66 "function": "Test_U256SafeDiv_custom", 67 "input": [], 68 "wanted": { 69 "data": "28948022309329048855892746252171976963317496166410141009864396001978282409984", 70 "type": "uint256" 71 } 72 }, { 73 "function": "Test_U256SafeSub_overflow", 74 "input": [], 75 "error": "wavm: execution reverted" 76 }, { 77 "function": "Test_U256SafeSub_custom", 78 "input": [], 79 "wanted": { 80 "data": "0", 81 "type": "uint256" 82 } 83 }, { 84 "function": "Test_U256SafeAdd_overflow", 85 "input": [], 86 "error": "wavm: execution reverted" 87 }, { 88 "function": "Test_U256SafeAdd_custom", 89 "input": [], 90 "wanted": { 91 "data": "115792089237316195423570985008687907853269984665640564039457584007913129639935", 92 "type": "uint256" 93 } 94 }] 95 }] 96 }