Skip to content

Commit

Permalink
fix: integration test now works with BigInt's pointer receivers
Browse files Browse the repository at this point in the history
  • Loading branch information
randomshinichi committed Mar 27, 2019
1 parent edabb99 commit d373565
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestSpendTxWithNode(t *testing.T) {
if err != nil {
expectedAmount.SetInt64(10)
} else {
expectedAmount.Add(&recipientAccount.Balance.Int, big.NewInt(10))
expectedAmount.Add(recipientAccount.Balance.Int, big.NewInt(10))
fmt.Printf("Recipient already exists with balance %v, expectedAmount after test is %s\n", recipientAccount.Balance.String(), expectedAmount.String())
}

Expand All @@ -45,7 +45,7 @@ func TestSpendTxWithNode(t *testing.T) {

// create the SpendTransaction
tx := aeternity.NewSpendTx(sender, recipient, *amount, *fee, message, ttl, nonce)
base64TxMsg, err := aeternity.BaseEncodeTx(tx)
base64TxMsg, err := aeternity.BaseEncodeTx(&tx)
if err != nil {
t.Fatalf("Base64 encoding errored out: %v", err)
}
Expand Down Expand Up @@ -97,9 +97,9 @@ func TestSpendTxLargeWithNode(t *testing.T) {
// In case the recipient account already has funds, get recipient's account info. If it exists, expectedAmount = existing balance + amount + fee
recipientAccount, err := aeCli.APIGetAccount(recipient)
if err != nil {
expectedAmount.Set(&amount.Int)
expectedAmount.Set(amount.Int)
} else {
expectedAmount.Add(&recipientAccount.Balance.Int, &amount.Int)
expectedAmount.Add(recipientAccount.Balance.Int, amount.Int)
}

ttl, nonce, err := aeCli.GetTTLNonce(sender, aeternity.Config.Client.TTL)
Expand All @@ -109,7 +109,7 @@ func TestSpendTxLargeWithNode(t *testing.T) {

// create the SpendTransaction
tx := aeternity.NewSpendTx(sender, recipient, *amount, *fee, message, ttl, nonce)
base64TxMsg, err := aeternity.BaseEncodeTx(tx)
base64TxMsg, err := aeternity.BaseEncodeTx(&tx)
if err != nil {
t.Fatalf("Base64 encoding errored out: %v", err)
}
Expand All @@ -134,7 +134,7 @@ func TestSpendTxLargeWithNode(t *testing.T) {
t.Fatalf("Couldn't get recipient's account data: %v", err)
}

if recipientAccount.Balance.Cmp(&expectedAmount.Int) != 0 {
if recipientAccount.Balance.Cmp(expectedAmount.Int) != 0 {
t.Fatalf("Recipient should have %v, but has %v instead", expectedAmount.String(), recipientAccount.Balance.String())
}
}

0 comments on commit d373565

Please sign in to comment.