@@ -41,6 +41,7 @@ beforeEach(() => {
41
41
describe ( 'deposit' , ( ) => {
42
42
it ( 'should deposit MAS' , ( ) => {
43
43
switchUser ( user2Address ) ;
44
+ mockBalance ( user2Address , amount ) ;
44
45
mockTransferredCoins ( amount ) ;
45
46
deposit ( [ ] ) ;
46
47
const balance = balanceOf ( new Args ( ) . add ( user2Address ) . serialize ( ) ) ;
@@ -50,8 +51,10 @@ describe('deposit', () => {
50
51
} ) ;
51
52
it ( 'should not charge for storage for later deposits' , ( ) => {
52
53
switchUser ( user2Address ) ;
54
+ mockBalance ( user2Address , amount ) ;
53
55
mockTransferredCoins ( amount ) ;
54
56
deposit ( [ ] ) ;
57
+ mockBalance ( user2Address , amount ) ;
55
58
mockTransferredCoins ( amount ) ;
56
59
deposit ( [ ] ) ;
57
60
expect ( balanceOf ( new Args ( ) . add ( user2Address ) . serialize ( ) ) ) . toStrictEqual (
@@ -60,13 +63,15 @@ describe('deposit', () => {
60
63
} ) ;
61
64
it ( 'should reject operation not covering storage cost' , ( ) => {
62
65
switchUser ( user3Address ) ;
66
+ mockBalance ( user3Address , storageCost ) ;
63
67
mockTransferredCoins ( storageCost ) ;
64
68
expect ( ( ) => {
65
69
deposit ( [ ] ) ;
66
70
} ) . toThrow ( 'Transferred amount is not enough to cover storage cost' ) ;
67
71
} ) ;
68
72
it ( 'should deposit minimal amount' , ( ) => {
69
73
switchUser ( user3Address ) ;
74
+ mockBalance ( user3Address , storageCost + 1 ) ;
70
75
mockTransferredCoins ( storageCost + 1 ) ;
71
76
deposit ( [ ] ) ;
72
77
expect ( balanceOf ( new Args ( ) . add ( user3Address ) . serialize ( ) ) ) . toStrictEqual (
@@ -78,6 +83,7 @@ describe('deposit', () => {
78
83
describe ( 'withdraw' , ( ) => {
79
84
beforeEach ( ( ) => {
80
85
switchUser ( user2Address ) ;
86
+ mockBalance ( user2Address , amount ) ;
81
87
mockTransferredCoins ( amount ) ;
82
88
deposit ( [ ] ) ;
83
89
mockBalance ( contractAddr , amount ) ;
0 commit comments