Given:
wallet::1 {
balance: 100
}
wallet::2 {
balance: 50
}
transaction::1 {
source: wallet::1,
target: wallet::2
amount: 30
status: pending
nature: walletToWallet
}
==> Now I want to do all of these in 1 transaction
- check balance of wallet::1 if there is enough money.
- update transaction::1.status from "pending" to "success"
- update wallet::1.balance = 70
- update wallet::2.balance = 80
Given:
wallet::sc {
balance: 100
}
wallet::lw {
balance: 100
}
wallet::1 {
balance: 100
}
wallet::2 {
balance: 50
}
transaction::1 {
source: wallet::1,
target: wallet::2
amount: 30
status: pending
nature: walletToWallet
}
==> Now I want to do all of these in 1 transaction
- check balance of wallet::1 if there is enough money.
- update transaction::1.status from "pending" to "success"
- update wallet::1.balance = 70
- update wallet::2.balance = 80
- create a new transaction
transaction::2 {
source: wallet::sc,
target: wallet::lw
amount: 0.03,
nature: Commission
originTransaction: transaction::1
status: success
}
- update wallet::sc.balance = 100-0.03
- update wallet::lw.balance = 100+0.03
- if there is not enough money in the wallet SC to pay the commission (0.03 EUR) then throw error and rollback everything
Using the C# SDK
- Create 2 random wallets
- Create N transactions to send money back and forth between these two wallets
- We want to benchmark how many transactions per second we can make to have a first impression about the perf.
- We want to avoid negative balance in wallets. We want to try to send 50 EUR from wallet::1 to wallet::2 two times concurently and see that only one trasaction can success.
- We want to query the transaction along with all the wallets (source+targent) information (join transaction + wallet) in the same request if possible.