test: add delegate mismatch test case
This commit is contained in:
@ -448,9 +448,10 @@ test('invalid approve', async () => {
|
|||||||
const owner = await newAccountWithTokens(connection);
|
const owner = await newAccountWithTokens(connection);
|
||||||
|
|
||||||
const account1 = await testToken.newAccount(owner);
|
const account1 = await testToken.newAccount(owner);
|
||||||
|
const account1Delegate = await testToken.newAccount(owner, account1);
|
||||||
const account2 = await testToken.newAccount(owner);
|
const account2 = await testToken.newAccount(owner);
|
||||||
|
|
||||||
// account2 is not a delegate account
|
// account2 is not a delegate account of account1
|
||||||
expect(
|
expect(
|
||||||
testToken.approve(
|
testToken.approve(
|
||||||
owner,
|
owner,
|
||||||
@ -459,6 +460,16 @@ test('invalid approve', async () => {
|
|||||||
123
|
123
|
||||||
)
|
)
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
|
|
||||||
|
// account1Delegate is not a delegate account of account2
|
||||||
|
expect(
|
||||||
|
testToken.approve(
|
||||||
|
owner,
|
||||||
|
account2,
|
||||||
|
account1Delegate,
|
||||||
|
123
|
||||||
|
)
|
||||||
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user