• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版718345d7daa6d2fc3148ea53d3de1652518607c1 (tree)
时间2020-03-10 19:06:10
作者shenao78 <shenao.78@163....>
Commitershenao78

Log Message

fix_mov_contract_test

更改概述

差异

--- a/protocol/validation/tx_test.go
+++ b/protocol/validation/tx_test.go
@@ -922,8 +922,10 @@ func TestMagneticContractTx(t *testing.T) {
922922 types.NewSpendInput([][]byte{vm.Int64Bytes(1), vm.Int64Bytes(1)}, bc.Hash{V0: 20}, sellerArgs.RequestedAsset, 200000000, 0, programBuyer),
923923 },
924924 Outputs: []*types.TxOutput{
925- types.NewIntraChainOutput(sellerArgs.RequestedAsset, 200000000, sellerArgs.SellerProgram),
926- types.NewIntraChainOutput(buyerArgs.RequestedAsset, 100000000, buyerArgs.SellerProgram),
925+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 199800000, sellerArgs.SellerProgram),
926+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 99900000, buyerArgs.SellerProgram),
927+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 200000, []byte{0x51}),
928+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 100000, []byte{0x51}),
927929 },
928930 }),
929931 },
@@ -942,9 +944,11 @@ func TestMagneticContractTx(t *testing.T) {
942944 types.NewSpendInput([][]byte{vm.Int64Bytes(2), vm.Int64Bytes(1)}, bc.Hash{V0: 20}, sellerArgs.RequestedAsset, 100000000, 0, programBuyer),
943945 },
944946 Outputs: []*types.TxOutput{
945- types.NewIntraChainOutput(sellerArgs.RequestedAsset, 100000000, sellerArgs.SellerProgram),
947+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 99900000, sellerArgs.SellerProgram),
946948 types.NewIntraChainOutput(buyerArgs.RequestedAsset, 150000000, programSeller),
947- types.NewIntraChainOutput(buyerArgs.RequestedAsset, 50000000, buyerArgs.SellerProgram),
949+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 49950000, buyerArgs.SellerProgram),
950+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 100000, []byte{0x51}),
951+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 50000, []byte{0x51}),
948952 },
949953 }),
950954 },
@@ -963,9 +967,11 @@ func TestMagneticContractTx(t *testing.T) {
963967 types.NewSpendInput([][]byte{vm.Int64Bytes(100000000), vm.Int64Bytes(1), vm.Int64Bytes(0)}, bc.Hash{V0: 20}, sellerArgs.RequestedAsset, 300000000, 0, programBuyer),
964968 },
965969 Outputs: []*types.TxOutput{
966- types.NewIntraChainOutput(sellerArgs.RequestedAsset, 200000000, sellerArgs.SellerProgram),
967- types.NewIntraChainOutput(buyerArgs.RequestedAsset, 100000000, buyerArgs.SellerProgram),
970+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 199800000, sellerArgs.SellerProgram),
971+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 99900000, buyerArgs.SellerProgram),
968972 types.NewIntraChainOutput(sellerArgs.RequestedAsset, 100000000, programBuyer),
973+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 200000, []byte{0x51}),
974+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 100000, []byte{0x51}),
969975 },
970976 }),
971977 },
@@ -1063,9 +1069,11 @@ func TestMagneticContractTx(t *testing.T) {
10631069 types.NewSpendInput([][]byte{vm.Int64Bytes(2), vm.Int64Bytes(1)}, bc.Hash{V0: 20}, sellerArgs.RequestedAsset, 100000000, 0, programBuyer),
10641070 },
10651071 Outputs: []*types.TxOutput{
1066- types.NewIntraChainOutput(sellerArgs.RequestedAsset, 100000000, sellerArgs.SellerProgram),
1072+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 99900000, sellerArgs.SellerProgram),
10671073 types.NewIntraChainOutput(buyerArgs.RequestedAsset, 150000000, []byte{0x55}),
1068- types.NewIntraChainOutput(buyerArgs.RequestedAsset, 50000000, buyerArgs.SellerProgram),
1074+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 49950000, buyerArgs.SellerProgram),
1075+ types.NewIntraChainOutput(sellerArgs.RequestedAsset, 100000, []byte{0x51}),
1076+ types.NewIntraChainOutput(buyerArgs.RequestedAsset, 50000, []byte{0x51}),
10691077 },
10701078 }),
10711079 },
@@ -1139,9 +1147,12 @@ func TestRingMagneticContractTx(t *testing.T) {
11391147 types.NewSpendInput([][]byte{vm.Int64Bytes(2), vm.Int64Bytes(1)}, bc.Hash{V0: 30}, bobArgs.RequestedAsset, 400000000, 0, jackProgram),
11401148 },
11411149 Outputs: []*types.TxOutput{
1142- types.NewIntraChainOutput(aliceArgs.RequestedAsset, 200000000, aliceArgs.SellerProgram),
1143- types.NewIntraChainOutput(bobArgs.RequestedAsset, 400000000, bobArgs.SellerProgram),
1144- types.NewIntraChainOutput(jackArgs.RequestedAsset, 100000000, jackArgs.SellerProgram),
1150+ types.NewIntraChainOutput(aliceArgs.RequestedAsset, 199800000, aliceArgs.SellerProgram),
1151+ types.NewIntraChainOutput(bobArgs.RequestedAsset, 399600000, bobArgs.SellerProgram),
1152+ types.NewIntraChainOutput(jackArgs.RequestedAsset, 99900000, jackArgs.SellerProgram),
1153+ types.NewIntraChainOutput(aliceArgs.RequestedAsset, 200000, []byte{0x51}),
1154+ types.NewIntraChainOutput(bobArgs.RequestedAsset, 400000, []byte{0x51}),
1155+ types.NewIntraChainOutput(jackArgs.RequestedAsset, 100000, []byte{0x51}),
11451156 },
11461157 }),
11471158 },
Show on old repository browser