MCPcopy Create free account
hub / github.com/ethstorage/es-node / DecodeUint256String

Function DecodeUint256String

cmd/es-utils/utils/utils.go:292–306  ·  view source on GitHub ↗
(hexOrDecimal string)

Source from the content-addressed store, hash-verified

290}
291
292func DecodeUint256String(hexOrDecimal string) (*uint256.Int, error) {
293 var base = 10
294 if strings.HasPrefix(hexOrDecimal, "0x") {
295 base = 16
296 }
297 b, ok := new(big.Int).SetString(hexOrDecimal, base)
298 if !ok {
299 return nil, fmt.Errorf("invalid value")
300 }
301 val256, nok := uint256.FromBig(b)
302 if nok {
303 return nil, fmt.Errorf("value is too big")
304 }
305 return val256, nil
306}
307
308// upload blobs and call putBlobs(bytes32[] memory keys)
309// and returns the kv indexes and the data hashes

Callers 1

SendBlobTxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected