Allow overriding confirmedAtBlock and vetoed in JS API
This commit is contained in:
parent
1f91a13f06
commit
5e33381f2a
@ -41,6 +41,8 @@ class Contribution extends Record {
|
|||||||
|
|
||||||
async add (contributionAttr, callOptions = {}) {
|
async add (contributionAttr, callOptions = {}) {
|
||||||
const contribution = new ContributionSerializer(contributionAttr);
|
const contribution = new ContributionSerializer(contributionAttr);
|
||||||
|
const confirmedAtBlock = contributionAttr.confirmedAtBlock || 0;
|
||||||
|
const vetoed = contributionAttr.vetoed || false;
|
||||||
|
|
||||||
try { await contribution.validate(); }
|
try { await contribution.validate(); }
|
||||||
catch (error) { return Promise.reject(error); }
|
catch (error) { return Promise.reject(error); }
|
||||||
@ -56,9 +58,11 @@ class Contribution extends Record {
|
|||||||
ipfsHashAttr.hashDigest,
|
ipfsHashAttr.hashDigest,
|
||||||
ipfsHashAttr.hashFunction,
|
ipfsHashAttr.hashFunction,
|
||||||
ipfsHashAttr.hashSize,
|
ipfsHashAttr.hashSize,
|
||||||
|
confirmedAtBlock,
|
||||||
|
vetoed,
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.contract.add(...contribution, 0, false, callOptions);
|
return this.contract.add(...contribution, callOptions);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ class Reimbursement extends Record {
|
|||||||
const amount = parseInt(attrs.amount);
|
const amount = parseInt(attrs.amount);
|
||||||
const token = attrs.token;
|
const token = attrs.token;
|
||||||
const recipientId = attrs.recipientId;
|
const recipientId = attrs.recipientId;
|
||||||
|
const confirmedAtBlock = attrs.confirmedAtBlock || 0;
|
||||||
|
const vetoed = attrs.vetoed || false;
|
||||||
const expenses = attrs.expenses.map((e) => new ExpenseSerializer(e));
|
const expenses = attrs.expenses.map((e) => new ExpenseSerializer(e));
|
||||||
let errorMessage;
|
let errorMessage;
|
||||||
|
|
||||||
@ -56,6 +58,8 @@ class Reimbursement extends Record {
|
|||||||
ipfsHashAttr.hashDigest,
|
ipfsHashAttr.hashDigest,
|
||||||
ipfsHashAttr.hashFunction,
|
ipfsHashAttr.hashFunction,
|
||||||
ipfsHashAttr.hashSize,
|
ipfsHashAttr.hashSize,
|
||||||
|
confirmedAtBlock,
|
||||||
|
vetoed,
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.contract.add(...reimbursement, callOptions);
|
return this.contract.add(...reimbursement, callOptions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user