Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -598,7 +598,7 @@ exports.defineProperties = function (self, fields, data) { | |||
function setter (v) { | ||||
v = exports.toBuffer(v) | ||||
|
||||
if (v.toString('hex') === '00' && !field.allowZero) { | ||||
if (v.toString('hex').match(/^0+$/) !== null && !field.allowZero) { | ||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Silur
Author
Contributor
|
self[field.name] = field.default |
in case of
parentHash
, the default value is utils.zeros(32)
and we fall line 602 and the assert line 609 fails.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
wanderer
Jul 18, 2017
Member
@Silur i think we should just revert this change. I don't see the point of using regex here
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
yann300
Jul 18, 2017
sorry I didn't see your previous post.
setting previousHash => allowZero : true, empty: false
would make sense I guess cause the default already is non empty and 00..
Are you sure about this fix? cause that breaks remix (when using the
parentHash
property - we use the default value)==> https://github.com/ethereumjs/ethereumjs-block/blob/master/header.js#L25