Commit graph

28 commits

Author SHA1 Message Date
Daniel Liu
6e5f466df9
common: remove duplicate test cases #32624 (#1556) 2025-09-22 20:43:50 +08:00
Daniel Liu
d2859ecb9c
common, common/hexutil: use reflect.TypeFor #32321 (#1434)
Co-authored-by: cui <cuiweixie@gmail.com>
2025-09-06 17:13:56 +08:00
Daniel Liu
1b09e585ab
common/hexutil: replace customized bit sizer with bit.Uintsize #32304 (#1433) 2025-09-06 17:13:17 +08:00
Tarun Sharma
c14f2e17aa test: Updated test cases to include MaxInt64, MinInt64 and MaxUint64, also rename testcase to TestHas0xPrefix to cover Has0xPrefix public method in hexutil package 2025-05-16 12:55:45 +04:00
Tarun Sharma
631be3cc04 refactor: Removed IsValidHexString and make has0xPrefix as public as per review comment 2025-05-16 12:33:25 +04:00
Tarun Sharma
78e82ac8a9 test: updated test cases to cover hex and number support for XDPoS_getV2BlockByNumber 2025-05-09 14:32:01 +04:00
Tarun Sharma
47d4bf4bf6 common: add public method to check for valid hex string 2025-05-08 17:56:48 +04:00
Daniel Liu
ff13d16fe5 core/vm: make structlog/json-log stack hex again (#28628) 2024-12-28 09:06:31 +08:00
lmittmann
49dc5e85e1 common/hexutil: improve performance of EncodeBig (#23780)
- use Text instead of fmt.Sprintf
- reduced allocs from 6 to 2
- improved speed
2024-12-28 09:06:30 +08:00
Daniel Liu
dd318fc563 common/hexutil: remove redundant conversion (#21903) 2024-12-28 09:06:30 +08:00
olumuyiwadad
b5abbfed79 new EVM Upgrade
- Solidity Upgraded up to v0.8.0
-  Fixed and Added eth_chainId
- Fix error in TransactionRecipet
- Reward halving issue fixed
2021-09-21 16:53:46 +05:30
olumuyiwadad
571c41f891 FIx Bad block error. 2021-09-17 17:59:06 +05:30
Jianrong
0fdab2027c add linting as the first CI task 2021-08-07 14:27:08 +10:00
diglspacedavid
474cc37036 upgrade codebase with ethereum:v1.8.13 2020-11-23 13:40:30 +05:30
AnilChinchawale
f272b5d8cb Change prefix to xdc 2019-03-17 16:14:04 +05:30
kiel barry
d0fd8d6fc2 common: all golint warnings removed (#16852)
* common: all golint warnings removed

* common: fixups
2018-06-14 12:52:50 +03:00
ferhat elmas
86f6568f66 build: enable unconvert linter (#15456)
* build: enable unconvert linter

 - fixes #15453
 - update code base for failing cases

* cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter
2017-11-10 19:06:45 +02:00
Egon Elbre
392151e251 common: fix megacheck warnings 2017-08-07 13:16:56 +03:00
Felix Lange
4a741df757 common/hexutil: wrap errors in json.UnmarshalTypeError
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".
2017-06-27 13:15:12 +02:00
Felix Lange
b4547a560b common/hexutil: add UnmarshalFixedUnprefixedText 2017-03-23 15:58:42 +01:00
Felix Lange
280f08be84 common/hexutil: ensure negative big.Int is encoded sensibly
Restricting encoding is silly.
2017-03-02 14:05:46 +01:00
Felix Lange
d304da3803 common/hexutil: implement TextMarshaler, TextUnmarshaler
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.
2017-03-02 14:05:46 +01:00
Felix Lange
357d00cdb1 common/hexutil: don't leak encoding/hex errors in Decode
All other functions return errors from package hexutil, ensure that
Decode does too.
2017-03-02 14:05:46 +01:00
Felix Lange
f3b7dcc5bd common/hexutil: reject big integer inputs > 256 bits
This follows the change to common/math big integer parsing in PR #3699.
2017-03-02 14:05:46 +01:00
Felix Lange
51f6b6d33f common/hexutil: fix EncodeBig, Big.MarshalJSON
The code was too clever and failed to include zeros on a big.Word
boundary.
2017-01-16 10:32:40 +01:00
Felix Lange
01f6f2d741 common/hexutil: allow empty strings when decoding JSON (#3559) 2017-01-13 09:45:40 +01:00
Felix Lange
318ad3c1e4 common/hexutil: fix Test{Decode,Unmarshal}Uint64 on 32bit arch (#3363) 2016-11-28 13:55:56 +01:00
Felix Lange
ec75953f50 common/hexutil: new package for 0x hex encoding
The new package is purpose-built to handle the encoding consumed and
produced by the RPC API.
2016-11-28 11:22:52 +01:00