fix: update budget wire format

This commit is contained in:
Michael Vines 2018-10-26 22:42:09 -07:00
parent ec2a3690b2
commit 9839c087d7
1 changed files with 2 additions and 8 deletions

View File

@ -186,12 +186,9 @@ export class BudgetProgram {
): Transaction {
const userdata = Buffer.alloc(1024);
let pos = 0;
userdata.writeUInt32LE(0, pos); // NewContract instruction
userdata.writeUInt32LE(0, pos); // NewBudget instruction
pos += 4;
userdata.writeUInt32LE(amount, pos); // Contract.tokens
pos += 8;
switch (conditions.length) {
case 0:
userdata.writeUInt32LE(0, pos); // Budget enum = Pay
@ -267,12 +264,9 @@ export class BudgetProgram {
): Transaction {
const userdata = Buffer.alloc(1024);
let pos = 0;
userdata.writeUInt32LE(0, pos); // NewContract instruction
userdata.writeUInt32LE(0, pos); // NewBudget instruction
pos += 4;
userdata.writeUInt32LE(amount, pos); // Contract.tokens
pos += 8;
userdata.writeUInt32LE(3, pos); // Budget enum = And
pos += 4;