Improve budget-program tests
This commit is contained in:
parent
a15a2424f4
commit
ffbc23684c
|
@ -16,7 +16,8 @@ test('pay', () => {
|
||||||
123,
|
123,
|
||||||
);
|
);
|
||||||
console.log('Pay:', transaction);
|
console.log('Pay:', transaction);
|
||||||
// TODO: Validate transaction contents
|
expect(transaction.keys).toHaveLength(2);
|
||||||
|
// TODO: Validate transaction contents more
|
||||||
|
|
||||||
transaction = BudgetProgram.pay(
|
transaction = BudgetProgram.pay(
|
||||||
from.publicKey,
|
from.publicKey,
|
||||||
|
@ -26,7 +27,8 @@ test('pay', () => {
|
||||||
BudgetProgram.signatureCondition(from.publicKey),
|
BudgetProgram.signatureCondition(from.publicKey),
|
||||||
);
|
);
|
||||||
console.log('After:', transaction);
|
console.log('After:', transaction);
|
||||||
// TODO: Validate transaction contents
|
expect(transaction.keys).toHaveLength(3);
|
||||||
|
// TODO: Validate transaction contents more
|
||||||
|
|
||||||
transaction = BudgetProgram.pay(
|
transaction = BudgetProgram.pay(
|
||||||
from.publicKey,
|
from.publicKey,
|
||||||
|
@ -37,6 +39,33 @@ test('pay', () => {
|
||||||
BudgetProgram.timestampCondition(from.publicKey, new Date()),
|
BudgetProgram.timestampCondition(from.publicKey, new Date()),
|
||||||
);
|
);
|
||||||
console.log('Or:', transaction);
|
console.log('Or:', transaction);
|
||||||
// TODO: Validate transaction contents
|
expect(transaction.keys).toHaveLength(3);
|
||||||
|
// TODO: Validate transaction contents more
|
||||||
|
});
|
||||||
|
|
||||||
|
test('apply', () => {
|
||||||
|
const from = new Account();
|
||||||
|
const program = new Account();
|
||||||
|
const to = new Account();
|
||||||
|
let transaction;
|
||||||
|
|
||||||
|
transaction = BudgetProgram.applyTimestamp(
|
||||||
|
from.publicKey,
|
||||||
|
program.publicKey,
|
||||||
|
to.publicKey,
|
||||||
|
new Date(),
|
||||||
|
);
|
||||||
|
console.log('applyTimestamp:', transaction);
|
||||||
|
expect(transaction.keys).toHaveLength(3);
|
||||||
|
// TODO: Validate transaction contents more
|
||||||
|
|
||||||
|
transaction = BudgetProgram.applySignature(
|
||||||
|
from.publicKey,
|
||||||
|
program.publicKey,
|
||||||
|
to.publicKey,
|
||||||
|
);
|
||||||
|
console.log('applySignature:', transaction);
|
||||||
|
expect(transaction.keys).toHaveLength(3);
|
||||||
|
// TODO: Validate transaction contents more
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue