github.com/Bytom/bytom@v1.1.2-0.20210127130405-ae40204c0b09/test/testdata/tx_tests/tx_tests.json (about)

     1  {
     2    "keys": [
     3      {"name": "alice", "password": "alice"},
     4      {"name": "bob", "password": "bob"}
     5    ],
     6    "accounts": [
     7      {"name": "alice", "keys": ["alice"], "quorum": 1},
     8      {"name": "bob", "keys": ["bob"], "quorum": 1},
     9      {"name": "multi-sig", "keys": ["alice", "bob"], "quorum": 2}
    10    ],
    11    "transactions": [
    12      {
    13        "describe": "normal single sign btm tx",
    14        "passwords": ["alice"],
    15        "inputs": [
    16          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"}
    17        ],
    18        "outputs": [
    19          {"type": "output", "name": "bob", "amount": 40000000000, "asset": "BTM"}
    20        ],
    21        "valid": true,
    22        "gas_only": false,
    23        "tx_fee": 60000000000
    24      },
    25      {
    26        "describe": "single sign btm tx, out of gas",
    27        "passwords": ["alice"],
    28        "inputs": [
    29          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"}
    30        ],
    31        "outputs": [
    32          {"type": "output", "name": "bob", "amount": 100000000000, "asset": "BTM"}
    33        ],
    34        "gas_only": false,
    35        "valid": false
    36      },
    37      {
    38        "describe": "normal multi utxo btm tx",
    39        "passwords": ["alice", "bob"],
    40        "inputs": [
    41          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
    42          {"type": "spend_account", "name": "bob", "amount": 100000000000, "asset": "BTM"}
    43        ],
    44        "outputs": [
    45          {"type": "output", "name": "bob", "amount": 30000000000, "asset": "BTM"},
    46          {"type": "output", "name": "alice", "amount": 30000000000, "asset": "BTM"}
    47        ],
    48        "valid": true,
    49        "gas_only": false,
    50        "tx_fee": 140000000000
    51      },
    52      {
    53        "describe": "single sign asset tx",
    54        "passwords": ["alice"],
    55        "inputs": [
    56          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
    57          {"type": "issue", "name": "alice", "amount": 100, "asset": "GOLD"}
    58        ],
    59        "outputs": [
    60          {"type": "output", "name": "alice", "amount": 30000000000, "asset": "BTM"},
    61          {"type": "output", "name": "alice", "amount": 100, "asset": "GOLD"}
    62        ],
    63        "valid": true,
    64        "gas_only": false,
    65        "tx_fee": 70000000000
    66      },
    67      {
    68        "describe": "single sign asset, out of gas",
    69        "passwords": ["alice"],
    70        "inputs": [
    71          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
    72          {"type": "issue", "name": "alice", "amount": 100, "asset": "RMB"}
    73        ],
    74        "outputs": [
    75          {"type": "output", "name": "alice", "amount": 100000000000, "asset": "BTM"},
    76          {"type": "output", "name": "alice", "amount": 100, "asset": "RMB"}
    77        ],
    78        "valid": false,
    79        "gas_only": false
    80      },
    81      {
    82        "describe": "single sign asset, input not equal with output",
    83        "passwords": ["alice"],
    84        "inputs": [
    85          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
    86          {"type": "issue", "name": "alice", "amount": 100, "asset": "SILVER"}
    87        ],
    88        "outputs": [
    89          {"type": "output", "name": "alice", "amount": 30000000000, "asset": "BTM"},
    90          {"type": "output", "name": "alice", "amount": 50, "asset": "SILVER"}
    91        ],
    92        "valid": false,
    93        "gas_only": false
    94      },
    95      {
    96        "describe": "normal single sign with retire",
    97        "passwords": ["alice"],
    98        "inputs": [
    99          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
   100          {"type": "spend_account", "name": "alice", "amount": 100, "asset": "GOLD"}
   101        ],
   102        "outputs": [
   103          {"type": "output", "name": "alice", "amount": 30000000000, "asset": "BTM"},
   104          {"type": "retire", "name": "alice", "amount": 100, "asset": "GOLD"}
   105        ],
   106        "valid": true,
   107        "gas_only": false,
   108        "tx_fee": 70000000000
   109      },
   110      {
   111        "describe": "gas only tx",
   112        "passwords": ["alice"],
   113        "inputs": [
   114          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
   115          {"type": "spend_account", "name": "bob", "amount": 100, "asset": "GOLD"}
   116        ],
   117        "outputs": [
   118          {"type": "output", "name": "alice", "amount": 30000000000, "asset": "BTM"},
   119          {"type": "retire", "name": "alice", "amount": 100, "asset": "GOLD"}
   120        ],
   121        "valid": false,
   122        "gas_only": true,
   123        "tx_fee": 70000000000
   124      },
   125      {
   126        "describe": "normal multi-sig asset with issue and retire",
   127        "passwords": ["alice", "bob"],
   128        "inputs": [
   129          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
   130          {"type": "spend_account", "name": "bob", "amount": 100000000000, "asset": "BTM"},
   131          {"type": "issue", "name": "multi-sig", "amount": 100, "asset": "MULTI-SIGN-ASSET"},
   132          {"type": "spend_account", "name": "alice", "amount": 10, "asset": "GOLD"}
   133        ],
   134        "outputs": [
   135          {"type": "output", "name": "multi-sig", "amount": 199500000000, "asset": "BTM"},
   136          {"type": "output", "name": "multi-sig", "amount": 100, "asset": "MULTI-SIGN-ASSET"},
   137          {"type": "retire", "name": "alice", "amount": 10, "asset": "GOLD"}
   138        ],
   139        "valid": true,
   140        "gas_only": false,
   141        "tx_fee": 500000000
   142      },
   143      {
   144        "describe": "multi-sig asset with issue and retire, out of gas",
   145        "passwords": ["alice", "bob"],
   146        "inputs": [
   147          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
   148          {"type": "spend_account", "name": "bob", "amount": 100000000000, "asset": "BTM"},
   149          {"type": "issue", "name": "multi-sig", "amount": 100, "asset": "DOLLAR"},
   150          {"type": "spend_account", "name": "alice", "amount": 10, "asset": "GOLD"}
   151        ],
   152        "outputs": [
   153          {"type": "output", "name": "multi-sig", "amount": 200000000000, "asset": "BTM"},
   154          {"type": "output", "name": "multi-sig", "amount": 100, "asset": "DOLLAR"},
   155          {"type": "retire", "name": "alice", "amount": 10, "asset": "GOLD"}
   156        ],
   157        "gas_only": false,
   158        "valid": false
   159      },
   160      {
   161        "describe": "multi utxo btm tx, wrong sig",
   162        "passwords": ["alice"],
   163        "inputs": [
   164          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
   165          {"type": "spend_account", "name": "bob", "amount": 100000000000, "asset": "BTM"}
   166        ],
   167        "outputs": [
   168          {"type": "output", "name": "bob", "amount": 30000000000, "asset": "BTM"},
   169          {"type": "output", "name": "alice", "amount": 30000000000, "asset": "BTM"}
   170        ],
   171        "gas_only": false,
   172        "valid": false
   173      },
   174      {
   175        "describe": "multi utxo btm tx, output large than input",
   176        "passwords": ["alice", "bob"],
   177        "inputs": [
   178          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"},
   179          {"type": "spend_account", "name": "bob", "amount": 100000000000, "asset": "BTM"}
   180        ],
   181        "outputs": [
   182          {"type": "output", "name": "bob", "amount": 90000000000, "asset": "BTM"},
   183          {"type": "output", "name": "alice", "amount": 200000000000, "asset": "BTM"}
   184        ],
   185        "gas_only": false,
   186        "valid": false
   187      },
   188      {
   189        "describe": "version is 0",
   190        "passwords": ["alice"],
   191        "version": 0,
   192        "inputs": [
   193          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"}
   194        ],
   195        "outputs": [
   196          {"type": "output", "name": "bob", "amount": 90000000000, "asset": "BTM"}
   197        ],
   198        "gas_only": false,
   199        "valid": false
   200      },
   201      {
   202        "describe": "version is 1",
   203        "passwords": ["alice"],
   204        "version": 1,
   205        "inputs": [
   206          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"}
   207        ],
   208        "outputs": [
   209          {"type": "output", "name": "bob", "amount": 90000000000, "asset": "BTM"}
   210        ],
   211        "tx_fee": 10000000000,
   212        "gas_only": false,
   213        "valid": true
   214      },
   215      {
   216        "describe": "version greater than block version(1)",
   217        "passwords": ["alice"],
   218        "version": 12,
   219        "inputs": [
   220          {"type": "spend_account", "name": "alice", "amount": 100000000000, "asset": "BTM"}
   221        ],
   222        "outputs": [
   223          {"type": "output", "name": "bob", "amount": 90000000000, "asset": "BTM"}
   224        ],
   225        "gas_only": false,
   226        "valid": false
   227      }
   228    ]
   229  }