aboutsummaryrefslogtreecommitdiffstats
path: root/common/big.go
Commit message (Collapse)AuthorAgeFilesLines
* common: fix big scan from bytes (#157)johnliu-dexon2019-04-091-1/+5
| | | | | | We store string of number, not bytes value into database 10 is stored as 0x3130, not 0x0a Use UnmarshalText instead of SetBytes
* common: add utilities for Big type (#104)Meng-Ying Yang2019-04-091-0/+6
| | | | | - Add String() for common usage which call original `big.Int`'s `String()` - Add ToBigInt() for type convertion
* core: add database/sql support for more types (#102)Meng-Ying Yang2019-04-091-1/+36
| | | | | | | | | * core: types: add database/sql support for BlockNonce * common: add database/sql support with Big New Big type is declared to let big.Int support database/sql by implementing Scan() and Value() on new type.
* core, vm, common: define constantinople fork + shift (#16045)Martin Holst Swende2018-02-231-1/+1
| | | | | | | | | | | | * core, vm, common: define constantinople fork, start implementation of shift instructions * vm: more testcases * vm: add tests for intpool erroneous intpool handling * core, vm, common: fix constantinople review concerns * vm: add string<->op definitions for new opcodes
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-133/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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, crypto: add ICAP functionsGustav Simonsson2015-10-131-0/+3
|
* 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
|
* types: block json unmarshal method addedobscuren2015-06-041-4/+4
|
* xeth: set balance max balance to from in call. Closes #951obscuren2015-05-161-0/+1
|
* Move Big* vars to big.goTaylor Gerring2015-03-221-0/+13
|
* Removed more castsobscuren2015-03-201-2/+2
|
* Moved ethutil => commonobscuren2015-03-161-0/+123