@@ -319,23 +319,17 @@ contract('Bridge', async function (accounts) {
319319 it ( 'fail depositTo no wrapped currency set' , async function ( ) {
320320 const amount = web3 . utils . toWei ( '1' ) ;
321321 const wrbtc = await WRBTC . new ( { from : tokenOwner } ) ;
322- const decimals = ( await wrbtc . decimals ( ) ) . toString ( ) ;
323- const symbol = await wrbtc . symbol ( ) ;
324322
325323 await this . allowTokens . setToken ( wrbtc . address , this . typeId , { from : bridgeManager } ) ;
326- const originalBalance = await web3 . eth . getBalance ( tokenOwner ) ;
327324 await utils . expectThrow ( this . bridge . depositTo ( anAccount , { from : tokenOwner , value : amount } ) ) ;
328325 } ) ;
329326
330327 it ( 'call depositTo from a contract' , async function ( ) {
331328 const amount = web3 . utils . toWei ( '1' ) ;
332329 const wrbtc = await WRBTC . new ( { from : tokenOwner } ) ;
333- const decimals = ( await wrbtc . decimals ( ) ) . toString ( ) ;
334- const symbol = await wrbtc . symbol ( ) ;
335330 const mockContract = await mockReceiveTokensCall . new ( this . bridge . address )
336331 await this . bridge . setWrappedCurrency ( wrbtc . address , { from : bridgeManager } ) ;
337332 await this . allowTokens . setToken ( wrbtc . address , this . typeId , { from : bridgeManager } ) ;
338- await this . allowTokens . addAllowedContract ( mockContract . address , { from : bridgeManager } ) ;
339333 receipt = await mockContract . callDepositTo ( anAccount , { from : tokenOwner , value : amount } ) ;
340334 utils . checkRcpt ( receipt ) ;
341335
@@ -345,17 +339,6 @@ contract('Bridge', async function (accounts) {
345339 assert . equal ( isKnownToken , true ) ;
346340 } ) ;
347341
348- it ( 'fail call depositTo from a contract if not allowed' , async function ( ) {
349- const amount = web3 . utils . toWei ( '1' ) ;
350- const wrbtc = await WRBTC . new ( { from : tokenOwner } ) ;
351- const decimals = ( await wrbtc . decimals ( ) ) . toString ( ) ;
352- const symbol = await wrbtc . symbol ( ) ;
353- const mockContract = await mockReceiveTokensCall . new ( this . bridge . address )
354- await this . bridge . setWrappedCurrency ( wrbtc . address , { from : bridgeManager } ) ;
355- await this . allowTokens . setToken ( wrbtc . address , this . typeId , { from : bridgeManager } ) ;
356- await utils . expectThrow ( mockContract . callDepositTo ( anAccount , { from : tokenOwner , value : amount } ) ) ;
357- } ) ;
358-
359342 it ( 'receiveTokens approve and transferFrom for ERC777' , async function ( ) {
360343 const amount = web3 . utils . toWei ( '1000' ) ;
361344 const granularity = '1000' ;
@@ -467,13 +450,12 @@ contract('Bridge', async function (accounts) {
467450 assert . equal ( isKnownToken , true ) ;
468451 } ) ;
469452
470- it ( 'tokensReceived for ERC777 with whitelisted contract' , async function ( ) {
453+ it ( 'tokensReceived for ERC777 called with contract' , async function ( ) {
471454 const amount = web3 . utils . toWei ( '1000' ) ;
472455 const granularity = '100' ;
473456 const erc777 = await SideToken . new ( "ERC777" , "777" , tokenOwner , granularity , { from : tokenOwner } ) ;
474457 await this . allowTokens . setToken ( erc777 . address , this . typeId . toString ( ) , { from : bridgeManager } ) ;
475458 const mockContract = await mockReceiveTokensCall . new ( this . bridge . address ) ;
476- await this . allowTokens . addAllowedContract ( mockContract . address , { from : bridgeManager } ) ;
477459 await erc777 . mint ( mockContract . address , amount , "0x" , "0x" , { from : tokenOwner } ) ;
478460 const originalTokenBalance = await erc777 . balanceOf ( mockContract . address ) ;
479461 const userData = anAccount . toLowerCase ( ) ;
@@ -826,21 +808,13 @@ contract('Bridge', async function (accounts) {
826808 await utils . expectThrow ( this . bridge . receiveTokensTo ( newToken . address , tokenOwner , amount , { from : tokenOwner } ) ) ;
827809 } ) ;
828810
829- it ( 'receiveTokens should work calling from an allowed contract' , async function ( ) {
811+ it ( 'receiveTokens should work calling from a contract' , async function ( ) {
830812 let otherContract = await mockReceiveTokensCall . new ( this . bridge . address ) ;
831- this . allowTokens . addAllowedContract ( otherContract . address , { from : bridgeManager } ) ;
832813 const amount = web3 . utils . toWei ( '1000' ) ;
833814 await this . token . transfer ( otherContract . address , amount , { from : tokenOwner } ) ;
834815 await otherContract . callReceiveTokens ( this . token . address , tokenOwner , amount ) ;
835816 } ) ;
836817
837- it ( 'receiveTokens should reject calling from a contract' , async function ( ) {
838- let otherContract = await mockReceiveTokensCall . new ( this . bridge . address ) ;
839- const amount = web3 . utils . toWei ( '1000' ) ;
840- await this . token . transfer ( otherContract . address , amount , { from : tokenOwner } ) ;
841- await utils . expectThrow ( otherContract . callReceiveTokens ( this . token . address , tokenOwner , amount ) ) ;
842- } ) ;
843-
844818 it ( 'rejects to receive tokens greater than max tokens allowed 18 decimals' , async function ( ) {
845819 let limit = await this . allowTokens . typeLimits ( this . typeId ) ;
846820 let maxTokensAllowed = limit . max ;
0 commit comments