Skip to content

Commit

Permalink
fix(test): remove strict owner-only strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Dec 14, 2023
1 parent 7cbcb3b commit a7ab15b
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/actions/write/transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,21 @@ describe('transferTokens', () => {
expect(result.message).toEqual('Invalid token transfer');
});

it('should throw if not contract owner', async () => {
const initState = {
...baselineAntState,
balances: { [''.padEnd(43, '1')]: 1 },
};
const result = await transferTokens(initState, {
caller: ''.padEnd(43, '1'),
input: {
function: 'transfer',
target: ''.padEnd(43, '2'),
},
}).catch((e) => e);
expect(result.message).toEqual(NON_CONTRACT_OWNER_MESSAGE);
});
// taken out due to UCM not being the owner. Need to allow anyone with a balance to transfer ownership - might be a good idea to change the ownership strategy.
// it('should throw if not contract owner', async () => {
// const initState = {
// ...baselineAntState,
// balances: { [''.padEnd(43, '1')]: 1 },
// };
// const result = await transferTokens(initState, {
// caller: ''.padEnd(43, '1'),
// input: {
// function: 'transfer',
// target: ''.padEnd(43, '2'),
// },
// }).catch((e) => e);
// expect(result.message).toEqual(NON_CONTRACT_OWNER_MESSAGE);
// });

it('should transfer ownership', async () => {
const result = (await transferTokens(baselineAntState, {
Expand Down

0 comments on commit a7ab15b

Please sign in to comment.