File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -158,18 +158,27 @@ module.exports = {
158158 return new BN ( word . shrn ( ( 31 - pos . toNumber ( ) ) * 8 ) . andln ( 0xff ) )
159159 } ,
160160 SHL : function ( a , b , runState ) {
161+ if ( ! runState . _common . hardforkIsActiveOnBlock ( "constantinople" , runState . block . header . number ) ) {
162+ trap ( ERROR . INVALID_OPCODE )
163+ }
161164 if ( a . gten ( 256 ) ) {
162165 return new BN ( 0 )
163166 }
164167 return b . shln ( a . toNumber ( ) )
165168 } ,
166169 SHR : function ( a , b , runState ) {
170+ if ( ! runState . _common . hardforkIsActiveOnBlock ( "constantinople" , runState . block . header . number ) ) {
171+ trap ( ERROR . INVALID_OPCODE )
172+ }
167173 if ( a . gten ( 256 ) ) {
168174 return new BN ( 0 )
169175 }
170176 return b . shrn ( a . toNumber ( ) )
171177 } ,
172178 SAR : function ( a , b , runState ) {
179+ if ( ! runState . _common . hardforkIsActiveOnBlock ( "constantinople" , runState . block . header . number ) ) {
180+ trap ( ERROR . INVALID_OPCODE )
181+ }
173182 b = b . fromTwos ( 256 )
174183 if ( a . gten ( 256 ) ) {
175184 if ( b . ltn ( 0 ) ) {
You can’t perform that action at this time.
0 commit comments