X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=protocol%2Fvalidation%2Ftx_scene_test.go;h=47068663cbdbcd399ed3c51c2cfb1cec3d6e72ab;hp=8b0df29094fc0d0a6527c80ae508337c0e86f73a;hb=089cb9074ed375e28850d2ff8b5e91164a04046d;hpb=53784d9c76f1056423b57915f7e064a6f551100c diff --git a/protocol/validation/tx_scene_test.go b/protocol/validation/tx_scene_test.go index 8b0df290..47068663 100644 --- a/protocol/validation/tx_scene_test.go +++ b/protocol/validation/tx_scene_test.go @@ -145,70 +145,6 @@ func TestValidateTx(t *testing.T) { err: nil, }, { - desc: "single utxo, single sign, issuance, spend, retire, btm stanard transaction, gas sufficient", - txData: &types.TxData{ - Version: 1, - SerializedSize: 601, - Inputs: []*types.TxInput{ - types.NewSpendInput( - [][]byte{ - mustDecodeString("8aab6052cb935384ac8fcbd4c0857cbce2e19825a002635d0b242757f17e5fdd148d83eb3837baf91754bf539cd08e29f66975f4bc9843ac00e280f228026105"), - mustDecodeString("ca85ea98011ddd592d1f081ebd2a91ac0f4238784222ed85b9d95aeb654f1cf1"), - }, - bc.Hash{V0: 14760873410800997144, V1: 1698395500822741684, V2: 5965908492734661392, V3: 9445539829830863994}, - *consensus.BTMAssetID, 11818900000, 0, mustDecodeString("0014e6e1f8b11f1cfb7609037003b90f64837afd272c")), - types.NewIssuanceInput( - mustDecodeString("fd0aec4229deb281"), - 10000000000, - mustDecodeString("ae2054a71277cc162eb3eb21b5bd9fe54402829a53b294deaed91692a2cd8a081f9c5151ad"), - [][]byte{ - mustDecodeString("e8f301f7bd3b1e4ca853b15559b3a253a4f5f9c7efba233ab0f6896bec23adc6a816c350e08f6b8ac5bc23eb5720173f9190805328af581f34a7fe561358d100"), - }, - mustDecodeString("7b0a202022646563696d616c73223a20382c0a2020226465736372697074696f6e223a207b7d2c0a2020226e616d65223a2022222c0a20202273796d626f6c223a2022220a7d"), - ), - }, - Outputs: []*types.TxOutput{ - types.NewIntraChainOutput(*consensus.BTMAssetID, 1818900000, mustDecodeString("00147d6b00edfbbc758a5da6130a5fa1a4cfec8422c3")), - types.NewIntraChainOutput(*consensus.BTMAssetID, 9900000000, []byte{byte(vm.OP_FAIL)}), - types.NewIntraChainOutput(bc.AssetID{V0: 8879089148261671560, V1: 16875272676673176923, V2: 14627348561007036053, V3: 5774520766896450836}, 10000000000, mustDecodeString("0014447e597c1c326ad1a639f8023d3f87ae22a4e049")), - }, - }, - gasValid: true, - err: nil, - }, - { - desc: "single utxo, single sign, issuance, spend, retire, btm stanard transaction, gas insufficient", - txData: &types.TxData{ - Version: 1, - SerializedSize: 601, - Inputs: []*types.TxInput{ - types.NewSpendInput( - [][]byte{ - mustDecodeString("23ca3a6f8474b1b9ab8b77fcf3cf3fd9dfa761dff4e5d8551a72307dc065cd19100f3ca9fcca4df2f8842b71dba2fd29b73c1b06b3d8bddc2a71e8cc18842a04"), - mustDecodeString("ca85ea98011ddd592d1f081ebd2a91ac0f4238784222ed85b9d95aeb654f1cf1"), - }, - bc.Hash{V0: 14760873410800997144, V1: 1698395500822741684, V2: 5965908492734661392, V3: 9445539829830863994}, - *consensus.BTMAssetID, 11818900000, 0, mustDecodeString("0014e6e1f8b11f1cfb7609037003b90f64837afd272c")), - types.NewIssuanceInput( - mustDecodeString("4b6afc9344c3ce63"), - 10000000000, - mustDecodeString("ae2054a71277cc162eb3eb21b5bd9fe54402829a53b294deaed91692a2cd8a081f9c5151ad"), - [][]byte{ - mustDecodeString("e8f301f7bd3b1e4ca85f1f8acda3a91fb73e717c096b8b82b2c7ed9d25170c0f9fcd9b5e8039094bd1174886f1b5428272eb6c2af03946bf3c2037a4b499c77107b94b96a92088a0d0d3b15559b3a253a4f5f9c7efba233ab0f6896bec23adc6a816c350e08f6b8ac5bc23eb5720173f9190805328af581f34a7fe561358d100"), - }, - mustDecodeString("7b0a202022646563696d616c73223a20382c0a2020226465736372697074696f6e223a207b7d2c0a2020226e616d65223a2022222c0a20202273796d626f6c223a2022220a7d"), - ), - }, - Outputs: []*types.TxOutput{ - types.NewIntraChainOutput(*consensus.BTMAssetID, 1818900000, mustDecodeString("001482b7991d64d001009b673ffe3ca2b35eab14f142")), - types.NewIntraChainOutput(*consensus.BTMAssetID, 10000000000, []byte{byte(vm.OP_FAIL)}), - types.NewIntraChainOutput(bc.AssetID{V0: 8879089148261671560, V1: 16875272676673176923, V2: 14627348561007036053, V3: 5774520766896450836}, 10000000000, mustDecodeString("0014447e597c1c326ad1a639f8023d3f87ae22a4e049")), - }, - }, - gasValid: false, - err: vm.ErrRunLimitExceeded, - }, - { desc: "btm stanard transaction check signature is not passed", txData: &types.TxData{ Version: 1,