File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const { expect } = require('chai');
33const Base64 = artifacts . require ( '$Base64' ) ;
44const Base64Dirty = artifacts . require ( '$Base64Dirty' ) ;
55
6- contract ( 'Strings ' , function ( ) {
6+ contract ( 'Base64 ' , function ( ) {
77 beforeEach ( async function ( ) {
88 this . base64 = await Base64 . new ( ) ;
99 } ) ;
@@ -32,12 +32,12 @@ contract('Strings', function () {
3232 } ) ;
3333 } ) ;
3434
35- it ( 'Encode reads beyond the input buffer into dirty memory' , async function ( ) {
35+ it . only ( 'Encode reads beyond the input buffer into dirty memory' , async function ( ) {
3636 const mock = await Base64Dirty . new ( ) ;
37- const buffer32 = web3 . utils . soliditySha3 ( 'example' ) ;
37+ const buffer32 = Buffer . from ( web3 . utils . soliditySha3 ( 'example' ) . replace ( / 0 x / , '' ) , 'hex ') ;
3838 const buffer31 = buffer32 . slice ( 0 , - 2 ) ;
3939
40- expect ( await mock . encode ( buffer31 ) ) . to . equal ( Buffer ( buffer31 ) . toString ( 'base64' ) ) ;
41- expect ( await mock . encode ( buffer32 ) ) . to . equal ( Buffer ( buffer32 ) . toString ( 'base64' ) ) ;
40+ expect ( await mock . encode ( buffer31 ) ) . to . equal ( buffer31 . toString ( 'base64' ) ) ;
41+ expect ( await mock . encode ( buffer32 ) ) . to . equal ( buffer32 . toString ( 'base64' ) ) ;
4242 } ) ;
4343} ) ;
You can’t perform that action at this time.
0 commit comments