github.com/n1ghtfa1l/go-vnt@v0.6.4-alpha.6/core/wavm/tests/mapping.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": "mapping/MappingTest.compress", 35 "abi": "mapping/abi.json", 36 "initcase": { 37 "needinit": true, 38 "input": [] 39 }, 40 "tests": [ 41 { 42 "function": "setAddrMapping1", 43 "input": [ 44 { 45 "data": "KEY", 46 "type": "string" 47 }, 48 { 49 "data": "0x11111", 50 "type": "address" 51 } 52 ], 53 "wanted": {} 54 }, 55 { 56 "function": "getAddrMapping1", 57 "input": [ 58 { 59 "data": "KEY", 60 "type": "string" 61 } 62 ], 63 "wanted": { 64 "data": "0x11111", 65 "type": "address" 66 } 67 }, 68 { 69 "function": "getAddrMapping1", 70 "input": [ 71 { 72 "data": "KEYNOEXIST", 73 "type": "string" 74 } 75 ], 76 "wanted": { 77 "data": "0x0", 78 "type": "address" 79 } 80 }, 81 { 82 "function": "setAddrMapping2", 83 "input": [], 84 "wanted": {} 85 }, 86 { 87 "function": "getAddrMapping1", 88 "input": [ 89 { 90 "data": "customkey", 91 "type": "string" 92 } 93 ], 94 "wanted": { 95 "data": "0x88888888888", 96 "type": "address" 97 } 98 }, 99 { 100 "function": "setStrMapping1", 101 "input": [ 102 { 103 "data": "KEY", 104 "type": "string" 105 }, 106 { 107 "data": "0x11111", 108 "type": "string" 109 } 110 ], 111 "wanted": {} 112 }, 113 { 114 "function": "getStrMapping1", 115 "input": [ 116 { 117 "data": "KEY", 118 "type": "string" 119 } 120 ], 121 "wanted": { 122 "data": "0x11111", 123 "type": "string" 124 } 125 }, 126 { 127 "function": "getStrMapping1", 128 "input": [ 129 { 130 "data": "KEYNOEXIST", 131 "type": "string" 132 } 133 ], 134 "wanted": { 135 "data": "", 136 "type": "string" 137 } 138 }, 139 { 140 "function": "setStrMapping2", 141 "input": [], 142 "wanted": {} 143 }, 144 { 145 "function": "getStrMapping1", 146 "input": [ 147 { 148 "data": "customkey", 149 "type": "string" 150 } 151 ], 152 "wanted": { 153 "data": "0x88888888888", 154 "type": "string" 155 } 156 }, 157 { 158 "function": "setMapStruct1", 159 "input": [ 160 { 161 "data": "customkey", 162 "type": "string" 163 }, 164 { 165 "data": "-1", 166 "type": "int32" 167 }, 168 { 169 "data": "-2", 170 "type": "int64" 171 }, 172 { 173 "data": "1", 174 "type": "uint32" 175 }, 176 { 177 "data": "2", 178 "type": "uint64" 179 }, 180 { 181 "data": "value", 182 "type": "string" 183 }, 184 { 185 "data": "0x111", 186 "type": "address" 187 }, 188 { 189 "data": "false", 190 "type": "bool" 191 }, 192 { 193 "data": "111111111111", 194 "type": "uint256" 195 } 196 ], 197 "wanted": { 198 "data": "0", 199 "type": "int32" 200 } 201 }, 202 { 203 "function": "getMapStructA", 204 "input": [ 205 { 206 "data": "customkey", 207 "type": "string" 208 } 209 ], 210 "wanted": { 211 "data": "-1", 212 "type": "int32" 213 } 214 }, 215 { 216 "function": "getMapStructB", 217 "input": [ 218 { 219 "data": "customkey", 220 "type": "string" 221 } 222 ], 223 "wanted": { 224 "data": "-2", 225 "type": "int64" 226 } 227 }, 228 { 229 "function": "getMapStructC", 230 "input": [ 231 { 232 "data": "customkey", 233 "type": "string" 234 } 235 ], 236 "wanted": { 237 "data": "1", 238 "type": "uint32" 239 } 240 }, 241 { 242 "function": "getMapStructD", 243 "input": [ 244 { 245 "data": "customkey", 246 "type": "string" 247 } 248 ], 249 "wanted": { 250 "data": "2", 251 "type": "uint64" 252 } 253 }, 254 { 255 "function": "getMapStructE", 256 "input": [ 257 { 258 "data": "customkey", 259 "type": "string" 260 } 261 ], 262 "wanted": { 263 "data": "value", 264 "type": "string" 265 } 266 }, 267 { 268 "function": "getMapStructF", 269 "input": [ 270 { 271 "data": "customkey", 272 "type": "string" 273 } 274 ], 275 "wanted": { 276 "data": "0x111", 277 "type": "address" 278 } 279 }, 280 { 281 "function": "getMapStructG", 282 "input": [ 283 { 284 "data": "customkey", 285 "type": "string" 286 } 287 ], 288 "wanted": { 289 "data": "false", 290 "type": "bool" 291 } 292 }, 293 { 294 "function": "getMapStructH", 295 "input": [ 296 { 297 "data": "customkey", 298 "type": "string" 299 } 300 ], 301 "wanted": { 302 "data": "111111111111", 303 "type": "uint256" 304 } 305 }, 306 { 307 "function": "setMapStruct2", 308 "input": [ 309 { 310 "data": "customkey", 311 "type": "string" 312 }, 313 { 314 "data": "-11", 315 "type": "int32" 316 }, 317 { 318 "data": "-22", 319 "type": "int64" 320 }, 321 { 322 "data": "11", 323 "type": "uint32" 324 }, 325 { 326 "data": "22", 327 "type": "uint64" 328 }, 329 { 330 "data": "value1", 331 "type": "string" 332 }, 333 { 334 "data": "0x1111", 335 "type": "address" 336 }, 337 { 338 "data": "true", 339 "type": "bool" 340 }, 341 { 342 "data": "1111111111111", 343 "type": "uint256" 344 } 345 ], 346 "wanted": { 347 "data": "0", 348 "type": "int32" 349 } 350 }, 351 { 352 "function": "getMapStructA", 353 "input": [ 354 { 355 "data": "customkey", 356 "type": "string" 357 } 358 ], 359 "wanted": { 360 "data": "-11", 361 "type": "int32" 362 } 363 }, 364 { 365 "function": "getMapStructB", 366 "input": [ 367 { 368 "data": "customkey", 369 "type": "string" 370 } 371 ], 372 "wanted": { 373 "data": "-22", 374 "type": "int64" 375 } 376 }, 377 { 378 "function": "getMapStructC", 379 "input": [ 380 { 381 "data": "customkey", 382 "type": "string" 383 } 384 ], 385 "wanted": { 386 "data": "11", 387 "type": "uint32" 388 } 389 }, 390 { 391 "function": "getMapStructD", 392 "input": [ 393 { 394 "data": "customkey", 395 "type": "string" 396 } 397 ], 398 "wanted": { 399 "data": "22", 400 "type": "uint64" 401 } 402 }, 403 { 404 "function": "getMapStructE", 405 "input": [ 406 { 407 "data": "customkey", 408 "type": "string" 409 } 410 ], 411 "wanted": { 412 "data": "value1", 413 "type": "string" 414 } 415 }, 416 { 417 "function": "getMapStructF", 418 "input": [ 419 { 420 "data": "customkey", 421 "type": "string" 422 } 423 ], 424 "wanted": { 425 "data": "0x1111", 426 "type": "address" 427 } 428 }, 429 { 430 "function": "getMapStructG", 431 "input": [ 432 { 433 "data": "customkey", 434 "type": "string" 435 } 436 ], 437 "wanted": { 438 "data": "true", 439 "type": "bool" 440 } 441 }, 442 { 443 "function": "getMapStructH", 444 "input": [ 445 { 446 "data": "customkey", 447 "type": "string" 448 } 449 ], 450 "wanted": { 451 "data": "1111111111111", 452 "type": "uint256" 453 } 454 }, 455 { 456 "function": "setMapStruct3", 457 "input": [ 458 { 459 "data": "customkey", 460 "type": "string" 461 }, 462 { 463 "data": "-111", 464 "type": "int32" 465 }, 466 { 467 "data": "-222", 468 "type": "int64" 469 }, 470 { 471 "data": "111", 472 "type": "uint32" 473 }, 474 { 475 "data": "222", 476 "type": "uint64" 477 }, 478 { 479 "data": "value11", 480 "type": "string" 481 }, 482 { 483 "data": "0x11111", 484 "type": "address" 485 }, 486 { 487 "data": "false", 488 "type": "bool" 489 }, 490 { 491 "data": "11111111111111", 492 "type": "uint256" 493 } 494 ], 495 "wanted": { 496 "data": "0", 497 "type": "int32" 498 } 499 }, 500 { 501 "function": "getMapStructA", 502 "input": [ 503 { 504 "data": "customkey", 505 "type": "string" 506 } 507 ], 508 "wanted": { 509 "data": "-111", 510 "type": "int32" 511 } 512 }, 513 { 514 "function": "getMapStructB", 515 "input": [ 516 { 517 "data": "customkey", 518 "type": "string" 519 } 520 ], 521 "wanted": { 522 "data": "-222", 523 "type": "int64" 524 } 525 }, 526 { 527 "function": "getMapStructC", 528 "input": [ 529 { 530 "data": "customkey", 531 "type": "string" 532 } 533 ], 534 "wanted": { 535 "data": "111", 536 "type": "uint32" 537 } 538 }, 539 { 540 "function": "getMapStructD", 541 "input": [ 542 { 543 "data": "customkey", 544 "type": "string" 545 } 546 ], 547 "wanted": { 548 "data": "222", 549 "type": "uint64" 550 } 551 }, 552 { 553 "function": "getMapStructE", 554 "input": [ 555 { 556 "data": "customkey", 557 "type": "string" 558 } 559 ], 560 "wanted": { 561 "data": "value11", 562 "type": "string" 563 } 564 }, 565 { 566 "function": "getMapStructF", 567 "input": [ 568 { 569 "data": "customkey", 570 "type": "string" 571 } 572 ], 573 "wanted": { 574 "data": "0x11111", 575 "type": "address" 576 } 577 }, 578 { 579 "function": "getMapStructG", 580 "input": [ 581 { 582 "data": "customkey", 583 "type": "string" 584 } 585 ], 586 "wanted": { 587 "data": "false", 588 "type": "bool" 589 } 590 }, 591 { 592 "function": "getMapStructH", 593 "input": [ 594 { 595 "data": "customkey", 596 "type": "string" 597 } 598 ], 599 "wanted": { 600 "data": "11111111111111", 601 "type": "uint256" 602 } 603 }, 604 { 605 "function": "getMapStructA1", 606 "input": [ 607 { 608 "data": "customkey", 609 "type": "string" 610 } 611 ], 612 "wanted": { 613 "data": "-111", 614 "type": "int32" 615 } 616 }, 617 { 618 "function": "getMapStructB1", 619 "input": [ 620 { 621 "data": "customkey", 622 "type": "string" 623 } 624 ], 625 "wanted": { 626 "data": "-222", 627 "type": "int64" 628 } 629 }, 630 { 631 "function": "getMapStructC1", 632 "input": [ 633 { 634 "data": "customkey", 635 "type": "string" 636 } 637 ], 638 "wanted": { 639 "data": "111", 640 "type": "uint32" 641 } 642 }, 643 { 644 "function": "getMapStructD1", 645 "input": [ 646 { 647 "data": "customkey", 648 "type": "string" 649 } 650 ], 651 "wanted": { 652 "data": "222", 653 "type": "uint64" 654 } 655 }, 656 { 657 "function": "getMapStructE1", 658 "input": [ 659 { 660 "data": "customkey", 661 "type": "string" 662 } 663 ], 664 "wanted": { 665 "data": "value11", 666 "type": "string" 667 } 668 }, 669 { 670 "function": "getMapStructF1", 671 "input": [ 672 { 673 "data": "customkey", 674 "type": "string" 675 } 676 ], 677 "wanted": { 678 "data": "0x11111", 679 "type": "address" 680 } 681 }, 682 { 683 "function": "getMapStructG1", 684 "input": [ 685 { 686 "data": "customkey", 687 "type": "string" 688 } 689 ], 690 "wanted": { 691 "data": "false", 692 "type": "bool" 693 } 694 }, 695 { 696 "function": "getMapStructH1", 697 "input": [ 698 { 699 "data": "customkey", 700 "type": "string" 701 } 702 ], 703 "wanted": { 704 "data": "11111111111111", 705 "type": "uint256" 706 } 707 }, 708 { 709 "function": "setMapWithMap", 710 "input": [ 711 { 712 "data": "key1", 713 "type": "string" 714 }, 715 { 716 "data": "key2", 717 "type": "string" 718 }, 719 { 720 "data": "value", 721 "type": "string" 722 } 723 ], 724 "wanted": { 725 "data": "0", 726 "type": "int32" 727 } 728 }, 729 { 730 "function": "getMapWithMap", 731 "input": [ 732 { 733 "data": "key1", 734 "type": "string" 735 }, 736 { 737 "data": "key2", 738 "type": "string" 739 } 740 ], 741 "wanted": { 742 "data": "value", 743 "type": "string" 744 } 745 }, 746 { 747 "function": "getMapWithMapWithoutPointer", 748 "input": [ 749 { 750 "data": "key1", 751 "type": "string" 752 }, 753 { 754 "data": "key2", 755 "type": "string" 756 } 757 ], 758 "wanted": { 759 "data": "", 760 "type": "string" 761 } 762 }, 763 { 764 "function": "setMapWithMap1", 765 "input": [ 766 { 767 "data": "key11", 768 "type": "string" 769 }, 770 { 771 "data": "key22", 772 "type": "string" 773 }, 774 { 775 "data": "value11", 776 "type": "string" 777 } 778 ], 779 "wanted": { 780 "data": "0", 781 "type": "int32" 782 } 783 }, 784 { 785 "function": "getMapWithMap1", 786 "input": [ 787 { 788 "data": "key11", 789 "type": "string" 790 }, 791 { 792 "data": "key22", 793 "type": "string" 794 } 795 ], 796 "wanted": { 797 "data": "", 798 "type": "string" 799 } 800 } 801 ] 802 } 803 ] 804 }