|
|
|
@ -6,6 +6,8 @@ import ( |
|
|
|
|
"log" |
|
|
|
|
"math/big" |
|
|
|
|
|
|
|
|
|
types2 "github.com/harmony-one/harmony/staking/types" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/crypto" |
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
@ -127,7 +129,7 @@ func fundFaucetContract(chain *core.BlockChain) { |
|
|
|
|
amount := 720000 |
|
|
|
|
tx, _ := types.SignTx(types.NewTransaction(nonce+uint64(4), StakingAddress, 0, big.NewInt(int64(amount)), params.TxGas, nil, nil), types.HomesteadSigner{}, FaucetPriKey) |
|
|
|
|
txs = append(txs, tx) |
|
|
|
|
err := contractworker.CommitTransactions(txs, testUserAddress) |
|
|
|
|
err := contractworker.CommitTransactions(txs, types2.StakingTransactions{}, testUserAddress) |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Println(err) |
|
|
|
|
} |
|
|
|
@ -165,7 +167,7 @@ func callFaucetContractToFundAnAddress(chain *core.BlockChain) { |
|
|
|
|
callEnc = append(callEnc, paddedAddress...) |
|
|
|
|
callfaucettx, _ := types.SignTx(types.NewTransaction(nonce+uint64(5), faucetContractAddress, 0, big.NewInt(0), params.TxGasContractCreation*10, nil, callEnc), types.HomesteadSigner{}, FaucetPriKey) |
|
|
|
|
|
|
|
|
|
err = contractworker.CommitTransactions(types.Transactions{callfaucettx}, testUserAddress) |
|
|
|
|
err = contractworker.CommitTransactions(types.Transactions{callfaucettx}, types2.StakingTransactions{}, testUserAddress) |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Println(err) |
|
|
|
|
} |
|
|
|
@ -243,7 +245,7 @@ func playStaking(chain *core.BlockChain) { |
|
|
|
|
tx, _ := types.SignTx(types.NewTransaction(0, stakeContractAddress, 0, big.NewInt(int64(stake)), params.TxGas*5, nil, callEncl), types.HomesteadSigner{}, allRandomUserKey[i]) |
|
|
|
|
stakingtxns = append(stakingtxns, tx) |
|
|
|
|
} |
|
|
|
|
err = contractworker.CommitTransactions(stakingtxns, common.Address{}) |
|
|
|
|
err = contractworker.CommitTransactions(stakingtxns, types2.StakingTransactions{}, common.Address{}) |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Println(err) |
|
|
|
@ -301,7 +303,7 @@ func playWithdrawStaking(chain *core.BlockChain) { |
|
|
|
|
withdrawstakingtxns = append(withdrawstakingtxns, tx) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err = contractworker.CommitTransactions(withdrawstakingtxns, common.Address{}) |
|
|
|
|
err = contractworker.CommitTransactions(withdrawstakingtxns, types2.StakingTransactions{}, common.Address{}) |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Println("error:") |
|
|
|
|
fmt.Println(err) |
|
|
|
|