aboutsummaryrefslogtreecommitdiffstats
path: root/common/types.go
Commit message (Collapse)AuthorAgeFilesLines
* common: improve IsHexAddress and add tests (#15551)Steven Roose2017-12-051-6/+3
| | | | | Also unexport isHex, hasHexPrefix because IsHexAddress is the only caller. Fixes #15550
* common: improve documentation of Hash.SetBytes (#15062)Martin Holst Swende2017-09-081-2/+2
| | | Fixes #15004
* common: Address.Hex() outputs EIP55-compliant stringJim McDonald2017-07-161-1/+23
|
* common/hexutil: wrap errors in json.UnmarshalTypeErrorFelix Lange2017-06-271-0/+15
| | | | | | | This adds type and struct field context to error messages. Instead of "hex string of odd length" users will now see "json: cannot unmarshal hex string of odd length into Go struct field SendTxArgs.from of type common.Address".
* common: add UnprefixedHash, UnprefixedAddressFelix Lange2017-03-231-14/+30
|
* common/hexutil: implement TextMarshaler, TextUnmarshalerFelix Lange2017-03-021-12/+12
| | | | | | | | | | | | | This commit makes the wrapper types more generally applicable. encoding.TextMarshaler is supported by most codec implementations (e.g. for yaml). The tests now ensure that package json actually recognizes the custom marshaler implementation irrespective of how it is implemented. The Uint type has new tests, too. These are tricky because uint size depends on the CPU word size. Turns out that there was one incorrect case where decoding returned ErrUint64Range instead of ErrUintRange.
* all: next batch of log polishes to contextual versionsPéter Szilágyi2017-02-281-2/+11
|
* common, eth/downloader, log: support terminal log formattingPéter Szilágyi2017-02-281-0/+18
|
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* common: use package hexutil for fixed size type encodingFelix Lange2016-11-281-49/+9
|
* mobile: initial wrappers for mobile supportPéter Szilágyi2016-11-141-1/+4
|
* common: Add tests for Address#UnmarshalJSONPaulo L F Casaretto2016-04-261-1/+1
|
* common: added Hash unmarshal json length validationJeffrey Wilcke2016-04-011-0/+13
|
* rpc: new RPC implementation with pub/sub supportBas van Kervel2015-12-141-0/+49
|
* common: fix #2008, wrong hex prefix checkPéter Szilágyi2015-11-281-2/+2
|
* cmd, common, core, eth, node, rpc, tests, whisper, xeth: use protocol stacksPéter Szilágyi2015-11-271-8/+20
|
* 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
|
* core/state, core/vm: reworked storage get / set to use common.Hashobscuren2015-06-171-0/+4
|
* core: reduce max allowed queued txs per addressobscuren2015-06-151-0/+11
| | | | | Transactions in the queue are now capped to a maximum of 200 transactions. This number is completely arbitrary.
* common: add Hash.GenerateFelix Lange2015-04-301-1/+14
|
* copy over loopobscuren2015-03-201-9/+2
|
* Added Hex methodsobscuren2015-03-181-0/+2
|
* Merge branch 'develop' into conversionobscuren2015-03-171-7/+2
|\ | | | | | | | | Conflicts: common/types.go
| * tmpobscuren2015-03-161-2/+2
| |
* | updated blockpoolobscuren2015-03-171-0/+3
| |
* | converted vmobscuren2015-03-171-18/+27
| |
* | conversion stateobscuren2015-03-171-3/+5
| |
* | Getters shouldn't need to be pointer receiverobscuren2015-03-161-8/+7
| |
* | compilable trie (tests fail)obscuren2015-03-161-5/+5
| |
* | Added functions to Hash & Addressobscuren2015-03-161-1/+37
| | | | | | | | | | * Set, SetString, SetBytes * StringTo*, BytesTo*
* | Added ToString methodsobscuren2015-03-161-3/+6
| |
* | new type + additional methodsobscuren2015-03-161-0/+36
|/
* Moved ethutil => commonobscuren2015-03-161-0/+6