Commit some new networking code, adding integration, broker still not 100%, hasn't been committed

This commit is contained in:
Josip Milovac 2023-04-26 13:02:27 +10:00
parent 1af6d56e2d
commit 050e69e23f
18 changed files with 1829 additions and 359 deletions

View file

@ -19,6 +19,9 @@ class Wallet {
//TODO: API for multiple outputs
//returns Transaction
createPayment(rewardAmount, outputs, blockchain) {
console.log(`${outputs}`);
console.log(`${rewardAmount}`);
const balance = blockchain.getBalanceCopy(this.publicKey);
if (balance.counter > this.counter) {
@ -49,7 +52,7 @@ class Wallet {
//TODO: API for multiple sensors
//returns Transaction
createIntegration(rewardAmount, outputs, blockchain) {
createIntegration(rewardAmount, witnessCount, outputs, blockchain) {
const balance = blockchain.getBalanceCopy(this.publicKey);
if (balance.counter > this.counter) {
@ -69,7 +72,7 @@ class Wallet {
const counterToUse = this.counter + 1;
this.counter++;
return new Integration(this.keyPair, counterToUse, outputs, rewardAmount);
return new Integration(this.keyPair, counterToUse, outputs, witnessCount, rewardAmount);
}
createIntegrationAsTransaction(rewardAmount, outputs, blockchain) {