mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
accounts/abi: be very very very correct
Signed-off-by: RJ Catalano <rj@monax.io>
This commit is contained in:
parent
6d9295ea67
commit
1253f2cc58
1 changed files with 7 additions and 2 deletions
|
|
@ -166,10 +166,15 @@ func getBoolValue(b []byte) (bool, error) {
|
|||
return false, fmt.Errorf("abi: Improperly encoded boolean value.")
|
||||
}
|
||||
}
|
||||
if uint(b[31]) == 1 {
|
||||
switch uint(b[31]) {
|
||||
case 0:
|
||||
return false, nil
|
||||
case 1:
|
||||
return true, nil
|
||||
default:
|
||||
return false, fmt.Errorf("abi: Improperly encoded boolean value.")
|
||||
}
|
||||
return false, nil
|
||||
|
||||
}
|
||||
|
||||
// toGoType parses the input and casts it to the proper type defined by the ABI
|
||||
|
|
|
|||
Loading…
Reference in a new issue