Skip to content

Commit

Permalink
go/staking: Update test vectors for new transaction types
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Dec 4, 2020
1 parent 643d5b7 commit be5ea4c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions go/staking/gen_vectors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,37 @@ func main() {
}
}
}

// Valid allow transactions.
beneficiary := memorySigner.NewTestSigner("oasis-core staking test vectors: Allow beneficiary")
beneficiaryAddr := staking.NewAddress(beneficiary.Public())
for _, amt := range []uint64{0, 1000, 10_000_000} {
for _, negative := range []bool{false, true} {
for _, tx := range []*transaction.Transaction{
staking.NewAllowTx(nonce, fee, &staking.Allow{
Beneficiary: beneficiaryAddr,
Negative: negative,
AmountChange: *quantity.NewFromUint64(amt),
}),
} {
vectors = append(vectors, testvectors.MakeTestVector("Withdraw", tx))
}
}
}

// Valid withdraw transactions.
withdrawSrc := memorySigner.NewTestSigner("oasis-core staking test vectors: Withdraw src")
withdrawSrcAddr := staking.NewAddress(withdrawSrc.Public())
for _, amt := range []uint64{0, 1000, 10_000_000} {
for _, tx := range []*transaction.Transaction{
staking.NewWithdrawTx(nonce, fee, &staking.Withdraw{
From: withdrawSrcAddr,
Amount: *quantity.NewFromUint64(amt),
}),
} {
vectors = append(vectors, testvectors.MakeTestVector("Withdraw", tx))
}
}
}
}

Expand Down

0 comments on commit be5ea4c

Please sign in to comment.