Skip to content

Commit

Permalink
Merge pull request #444 from GrKamil/dev
Browse files Browse the repository at this point in the history
fix buy coin tx
  • Loading branch information
danil-lashin committed Oct 14, 2020
2 parents 4b70a57 + 851dfcd commit b0e4185
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/transaction/buy_coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ func TestBuyCoinTxToMaximumValueToSellReached(t *testing.T) {
coinToBuyID, sellCoinID := createTestCoin(cState), types.GetBaseCoinID()

valueToBuy := big.NewInt(2e18)
cState.Accounts.AddBalance(addr, sellCoinID, valueToBuy)
//cState.Accounts.AddBalance(addr, sellCoinID, valueToBuy)
cState.Coins.AddVolume(sellCoinID, valueToBuy)

data := BuyCoinData{
Expand Down Expand Up @@ -1246,6 +1246,8 @@ func TestBuyCoinTxToMaximumValueToSellReached(t *testing.T) {
coinToSellID := cState.App.GetNextCoinID()
cState.App.SetCoinsCount(coinToSellID.Uint32())

cState.Accounts.AddBalance(types.Address{0}, coinToSellID, helpers.BipToPip(big.NewInt(100000)))

data.CoinToBuy = coinToBuyID
data.CoinToSell = coinToSellID
data.MaximumValueToSell = big.NewInt(1)
Expand All @@ -1269,7 +1271,7 @@ func TestBuyCoinTxToMaximumValueToSellReached(t *testing.T) {
t.Fatalf("Response code is not %d. Error %s", code.MaximumValueToSellReached, response.Log)
}

data.MaximumValueToSell = big.NewInt(2000360064812986923)
data.MaximumValueToSell = big.NewInt(1000360064812986923)
encodedData, err = rlp.EncodeToBytes(data)
if err != nil {
panic(err)
Expand Down

0 comments on commit b0e4185

Please sign in to comment.