accounts/abi: improve type handling, add event support (#14743)

This commit is contained in:
RJ Catalano
2017-10-17 06:07:08 -05:00
committed by Felix Lange
parent e9295163aa
commit dec8bba9d4
15 changed files with 906 additions and 850 deletions

View File

@ -61,8 +61,9 @@ func packElement(t Type, reflectValue reflect.Value) []byte {
reflectValue = mustArrayToByteSlice(reflectValue)
}
return common.RightPadBytes(reflectValue.Bytes(), 32)
default:
panic("abi: fatal error")
}
panic("abi: fatal error")
}
// packNum packs the given number (using the reflect value) and will cast it to appropriate number representation
@ -74,6 +75,8 @@ func packNum(value reflect.Value) []byte {
return U256(big.NewInt(value.Int()))
case reflect.Ptr:
return U256(value.Interface().(*big.Int))
default:
panic("abi: fatal error")
}
return nil
}