aboutsummaryrefslogtreecommitdiffstats
path: root/common/bytes_test.go
Commit message (Collapse)AuthorAgeFilesLines
* common: improve IsHexAddress and add tests (#15551)Steven Roose2017-12-051-13/+21
| | | | | Also unexport isHex, hasHexPrefix because IsHexAddress is the only caller. Fixes #15550
* common: fix hex utils to handle 1 byte address conversionsPéter Szilágyi2017-11-291-2/+11
|
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-108/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: remove CurrencyToString Move denomination values to params instead. * common: delete dead code * common: move big integer operations to common/math This commit consolidates all big integer operations into common/math and adds tests and documentation. There should be no change in semantics for BigPow, BigMin, BigMax, S256, U256, Exp and their behaviour is now locked in by tests. The BigD, BytesToBig and Bytes2Big functions don't provide additional value, all uses are replaced by new(big.Int).SetBytes(). BigToBytes is now called PaddedBigBytes, its minimum output size parameter is now specified as the number of bytes instead of bits. The single use of this function is in the EVM's MSTORE instruction. Big and String2Big are replaced by ParseBig, which is slightly stricter. It previously accepted leading zeros for hexadecimal inputs but treated decimal inputs as octal if a leading zero digit was present. ParseUint64 is used in places where String2Big was used to decode a uint64. The new functions MustParseBig and MustParseUint64 are now used in many places where parsing errors were previously ignored. * common: delete unused big integer variables * accounts/abi: replace uses of BytesToBig with use of encoding/binary * common: remove BytesToBig * common: remove Bytes2Big * common: remove BigTrue * cmd/utils: add BigFlag and use it for error-checked integer flags While here, remove environment variable processing for DirectoryFlag because we don't use it. * core: add missing error checks in genesis block parser * common: remove String2Big * cmd/evm: use utils.BigFlag * common/math: check for 256 bit overflow in ParseBig This is supposed to prevent silent overflow/truncation of values in the genesis block JSON. Without this check, a genesis block that set a balance larger than 256 bits would lead to weird behaviour in the VM. * cmd/utils: fixup import
* all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-071-2/+2
|
* common: Remove dead codeRicardo Catalinas Jiménez2016-02-221-20/+0
|
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: update license informationFelix Lange2015-07-071-0/+16
|
* common: delete BinaryLengthFelix Lange2015-04-221-14/+0
| | | | | The test is failing the 32bit build and the function is not used anywhere.
* Move ToHex/FromHex into bytesTaylor Gerring2015-03-221-0/+21
|
* Moved ethutil => commonobscuren2015-03-161-0/+193