@@ -123,160 +123,6 @@ contract('UFragments:setMonetaryPolicy:accessControl', function (accounts) {
123123 } ) ;
124124} ) ;
125125
126- contract ( 'UFragments:PauseRebase' , function ( accounts ) {
127- const policy = accounts [ 1 ] ;
128- const A = accounts [ 2 ] ;
129- const B = accounts [ 3 ] ;
130-
131- before ( 'setup UFragments contract' , async function ( ) {
132- await setupContracts ( ) ;
133- await uFragments . setMonetaryPolicy ( policy , { from : deployer } ) ;
134- r = await uFragments . setRebasePaused ( true ) ;
135- } ) ;
136-
137- it ( 'should emit pause event' , async function ( ) {
138- const log = r . logs [ 0 ] ;
139- expect ( log ) . to . exist ;
140- expect ( log . event ) . to . eq ( 'LogRebasePaused' ) ;
141- expect ( log . args . paused ) . to . be . true ;
142- } ) ;
143-
144- it ( 'should not allow calling rebase' , async function ( ) {
145- expect (
146- await chain . isEthException ( uFragments . rebase ( 1 , toUFrgDenomination ( 500 ) , { from : policy } ) )
147- ) . to . be . true ;
148- } ) ;
149-
150- it ( 'should allow calling transfer' , async function ( ) {
151- await uFragments . transfer ( A , transferAmount , { from : deployer } ) ;
152- } ) ;
153-
154- it ( 'should allow calling approve' , async function ( ) {
155- await uFragments . approve ( A , transferAmount , { from : deployer } ) ;
156- } ) ;
157-
158- it ( 'should allow calling allowance' , async function ( ) {
159- await uFragments . allowance . call ( deployer , A ) ;
160- } ) ;
161-
162- it ( 'should allow calling transferFrom' , async function ( ) {
163- await uFragments . transferFrom ( deployer , B , transferAmount , { from : A } ) ;
164- } ) ;
165-
166- it ( 'should allow calling increaseAllowance' , async function ( ) {
167- await uFragments . increaseAllowance ( A , transferAmount , { from : deployer } ) ;
168- } ) ;
169-
170- it ( 'should allow calling decreaseAllowance' , async function ( ) {
171- await uFragments . decreaseAllowance ( A , 10 , { from : deployer } ) ;
172- } ) ;
173-
174- it ( 'should allow calling balanceOf' , async function ( ) {
175- await uFragments . balanceOf . call ( deployer ) ;
176- } ) ;
177-
178- it ( 'should allow calling totalSupply' , async function ( ) {
179- await uFragments . totalSupply . call ( ) ;
180- } ) ;
181- } ) ;
182-
183- contract ( 'UFragments:PauseRebase:accessControl' , function ( accounts ) {
184- before ( 'setup UFragments contract' , setupContracts ) ;
185-
186- it ( 'should be callable by owner' , async function ( ) {
187- expect (
188- await chain . isEthException ( uFragments . setRebasePaused ( true , { from : deployer } ) )
189- ) . to . be . false ;
190- } ) ;
191-
192- it ( 'should NOT be callable by non-owner' , async function ( ) {
193- expect (
194- await chain . isEthException ( uFragments . setRebasePaused ( true , { from : user } ) )
195- ) . to . be . true ;
196- } ) ;
197- } ) ;
198-
199- contract ( 'UFragments:PauseToken' , function ( accounts ) {
200- const policy = accounts [ 1 ] ;
201- const A = accounts [ 2 ] ;
202- const B = accounts [ 3 ] ;
203-
204- before ( 'setup UFragments contract' , async function ( ) {
205- await setupContracts ( ) ;
206- await uFragments . setMonetaryPolicy ( policy , { from : deployer } ) ;
207- r = await uFragments . setTokenPaused ( true ) ;
208- } ) ;
209-
210- it ( 'should emit pause event' , async function ( ) {
211- const log = r . logs [ 0 ] ;
212- expect ( log ) . to . exist ;
213- expect ( log . event ) . to . eq ( 'LogTokenPaused' ) ;
214- expect ( log . args . paused ) . to . be . true ;
215- } ) ;
216-
217- it ( 'should allow calling rebase' , async function ( ) {
218- await uFragments . rebase ( 1 , toUFrgDenomination ( 500 ) , { from : policy } ) ;
219- } ) ;
220-
221- it ( 'should not allow calling transfer' , async function ( ) {
222- expect (
223- await chain . isEthException ( uFragments . transfer ( A , transferAmount , { from : deployer } ) )
224- ) . to . be . true ;
225- } ) ;
226-
227- it ( 'should not allow calling approve' , async function ( ) {
228- expect (
229- await chain . isEthException ( uFragments . approve ( A , transferAmount , { from : deployer } ) )
230- ) . to . be . true ;
231- } ) ;
232-
233- it ( 'should allow calling allowance' , async function ( ) {
234- await uFragments . allowance . call ( deployer , A ) ;
235- } ) ;
236-
237- it ( 'should not allow calling transferFrom' , async function ( ) {
238- expect (
239- await chain . isEthException ( uFragments . transferFrom ( deployer , B , transferAmount , { from : A } ) )
240- ) . to . be . true ;
241- } ) ;
242-
243- it ( 'should not allow calling increaseAllowance' , async function ( ) {
244- expect (
245- await chain . isEthException ( uFragments . increaseAllowance ( A , transferAmount , { from : deployer } ) )
246- ) . to . be . true ;
247- } ) ;
248-
249- it ( 'should not allow calling decreaseAllowance' , async function ( ) {
250- expect (
251- await chain . isEthException ( uFragments . decreaseAllowance ( A , transferAmount , { from : deployer } ) )
252- ) . to . be . true ;
253- } ) ;
254-
255- it ( 'should allow calling balanceOf' , async function ( ) {
256- await uFragments . balanceOf . call ( deployer ) ;
257- } ) ;
258-
259- it ( 'should allow calling totalSupply' , async function ( ) {
260- await uFragments . totalSupply . call ( ) ;
261- } ) ;
262- } ) ;
263-
264- contract ( 'UFragments:PauseToken:accessControl' , function ( accounts ) {
265- before ( 'setup UFragments contract' , setupContracts ) ;
266-
267- it ( 'should be callable by owner' , async function ( ) {
268- expect (
269- await chain . isEthException ( uFragments . setTokenPaused ( true , { from : deployer } ) )
270- ) . to . be . false ;
271- } ) ;
272-
273- it ( 'should NOT be callable by non-owner' , async function ( ) {
274- expect (
275- await chain . isEthException ( uFragments . setTokenPaused ( true , { from : user } ) )
276- ) . to . be . true ;
277- } ) ;
278- } ) ;
279-
280126contract ( 'UFragments:Rebase:accessControl' , function ( accounts ) {
281127 before ( 'setup UFragments contract' , async function ( ) {
282128 await setupContracts ( ) ;
0 commit comments