mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
write a default 0x0 when encoutering missing struct data
This commit is contained in:
parent
823719b9e1
commit
c54ba9b435
1 changed files with 4 additions and 0 deletions
|
|
@ -493,6 +493,10 @@ func (typedData *TypedData) EncodeData(primaryType string, data map[string]inter
|
||||||
|
|
||||||
buffer.Write(crypto.Keccak256(arrayBuffer.Bytes()))
|
buffer.Write(crypto.Keccak256(arrayBuffer.Bytes()))
|
||||||
} else if typedData.Types[field.Type] != nil {
|
} else if typedData.Types[field.Type] != nil {
|
||||||
|
if encValue == nil {
|
||||||
|
buffer.Write(common.Hash{}.Bytes())
|
||||||
|
continue
|
||||||
|
}
|
||||||
mapValue, ok := encValue.(map[string]interface{})
|
mapValue, ok := encValue.(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, dataMismatchError(encType, encValue)
|
return nil, dataMismatchError(encType, encValue)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue