aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/abi.go
Commit message (Collapse)AuthorAgeFilesLines
* accounts/abi: tuple support (#18406)gary rong2019-01-101-2/+0
|
* accounts/abi: Brings out the msg defined at require statement in SC function ↵Jeff Prestes2018-12-221-1/+1
| | | | (#17328)
* accounts/abi: fix panic in MethodById lookup. Fixes #17797 (#17798)Martin Holst Swende2018-10-011-0/+3
|
* accounts/abi: address review concernsMartin Holst Swende2018-02-211-1/+1
|
* accounts/abi: Deduplicate code in unpackerMartin Holst Swende2018-02-211-1/+1
|
* accounts/abi: add another unpack interfaceMartin Holst Swende2018-02-211-3/+3
|
* accounts/abi/bind: support event filtering in abigenPéter Szilágyi2018-01-241-1/+0
|
* accounts/abi: merging of https://github.com/ethereum/go-ethereum/pull/15452 ↵Martin Holst Swende2017-12-231-0/+12
| | | | + lookup by id
* acounts/abi: refactor abi, generalize abi pack/unpack to ArgumentsMartin Holst Swende2017-12-231-24/+15
|
* accounts/abi: satisfy most of the linter warningsRobert Zaremba2017-12-211-1/+2
| | | | | | | + adding missing comments + small cleanups which won't significantly change function body. + unify Method receiver name
* accounts/abi: remove check for len%32==0 when unpacking events (#15670)Bob Glickstein2017-12-211-2/+6
| | | | | | This change inlines the logic of bytesAreProper at its sole callsite, ABI.Unpack, and applies the multiple-of-32 test only in the case of unpacking methods. Event data is not required to be a multiple of 32 bytes long.
* accounts/abi: improve type handling, add event support (#14743)RJ Catalano2017-10-171-99/+16
|
* accounts/abi: reorganizing package with small fixes (#14610)RJ Catalano2017-06-271-196/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * accounts/abi: reorganizing package and some notes and a quick correction of name. Signed-off-by: RJ Catalano <rj@monax.io> get rid of some imports Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: move file names Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix boolean decode function Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix for the array set and for creating a bool Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: be very very very correct Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix up error message and variable names Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: take out unnecessary argument in pack method Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: add bool unpack test and add a panic to readBool function Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix panic message Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: change from panic to basic error Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix nil to false Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fill out type regex tests and fill with the correct type for integers Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: move packNumbers into pack.go. Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: separation of the testing suite into appropriately named files. Signed-off-by: RJ Catalano <rj@monax.io> * account/abi: change to hex string tests. Signed-off-by: RJ Catalano <rj@monax.io> * account/abi: fix up rest of tests to hex Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: declare bool at the package level Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: use errors package in the error file. Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix ugly hack and fix error type declaration. Signed-off-by: RJ Catalano <rj@monax.io>
* common: move big integer math to common/math (#3699)Felix Lange2017-02-271-54/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* accounts/abi: fixed commentsJeffrey Wilcke2017-01-091-3/+2
|
* accounts/abi: support custom int slice typesThomas Bocek2017-01-091-3/+46
| | | | | | | | | | | | | | On solidity contract I have "uint32 []" type, when abigen creates Go bindings - they are also "[]uint32" type on Go side. Even though it looks like it should work - the actual type of the data coming from the chain is of type " []*big.Int". When executing contract function from Go side - getting unmarshal error: abi: cannot unmarshal []*big.Int in to []uint32 The fix is to create array with the correct type This fixed the issue reported in: https://github.com/ethereum/go-ethereum/issues/2802
* accounts/abi: add support for function types (#3405)RJ2017-01-051-2/+2
|
* accounts/abi: add support for "anonymous" and "indexed" for events (#3464)bas-vk2016-12-221-8/+10
|
* accounts/abi: differentiate between static and dynamic arrays (#3121)RJ2016-11-041-16/+36
| | | | | solves #3119 Signed-off-by: VoR0220 <rj@erisindustries.com>
* accounts/abi: fix typo in the comment (dummy commit)Péter Szilágyi2016-09-261-1/+1
|
* accounts/abi: fixed unpacking in to already slice interfacesJeffrey Wilcke2016-05-111-30/+29
| | | | | | | | | | | | | | | | Previously it was assumed that wheneven type `[]interface{}` was given that the interface was empty. The abigen rightfully assumed that interface slices which already have pre-allocated variable sets to be assigned. This PR fixes that by checking that the given `[]interface{}` is larger than zero and assigns each value using the generic `set` function (this function has also been moved to abi/reflect.go) and checks whether the assignment was possible. The generic assignment function `set` now also deals with pointers (useful for interface slice mentioned above) by dereferencing the pointer until it finds a setable type.
* accounts/abi: fixed string and fixed size bytes packingJeffrey Wilcke2016-04-281-4/+4
|
* accounts/abi: added unpacking "anything" in to interface{}Jeffrey Wilcke2016-04-281-0/+2
|
* accounts/abi: fixed strict go-like unpackingJeffrey Wilcke2016-04-281-5/+26
|
* accouns/abi: refactored ABI packageJeffrey Wilcke2016-04-201-47/+10
| | | | | | | | | | | | | | | | | Refactored the abi package parsing and type handling. Relying mostly on package reflect as opposed to most of our own type reflection. Our own type reflection is still used however for cases such as Bytes and FixedBytes (abi: bytes•). This also inclused several fixes for slice handling of arbitrary and fixed size for all supported types. This also further removes implicit type casting such as assigning, for example `[2]T{} = []T{1}` will fail, however `[2]T{} == []T{1, 2}` (notice assigning *slice* to fixed size *array*). Assigning arrays to slices will always succeed if they are of the same element type. Incidentally also fixes #2379
* abi: removed implicit type casting & refactored type parsingJeffrey Wilcke2016-04-051-1/+1
|
* abi: accept output slices of all supported typesJeffrey Wilcke2016-04-051-1/+71
|
* abi: accept input slices of all supported typesJeffrey Wilcke2016-04-051-4/+3
|
* accounts/abi/bind: constructor, auth utils and various backendsPéter Szilágyi2016-03-241-19/+27
|
* accounts/abi/bind, cmd/abigen: Go API generator around an EVM ABIPéter Szilágyi2016-03-241-22/+2
|
* Merge pull request #2348 from obscuren/abi-variable-inputPéter Szilágyi2016-03-171-2/+21
|\ | | | | accounts/abi: Fixed bytes input accept []byte and variable input support
| * accounts/abi: Fixed bytes input accept []byte and variable input supportJeffrey Wilcke2016-03-151-2/+21
| | | | | | | | | | | | | | | | | | Fixed up `[]byte` slice support such that `function print(bytes input)` accepts `[]byte` as input and treats it as 1 element rather than a slice of multiple elements. Added support for variable length input parameters like `bytes` and `strings`.
* | accounts/abi: handle the "constant" modifier for functionsPéter Szilágyi2016-03-161-7/+7
|/
* accounts/abi: support for typed arrayJeffrey Wilcke2016-02-151-12/+39
| | | | | Added support for fixed size and arbitrary length byte arrays to be marshallable in fixed size (typed) byte slices.
* accounts/abi: fixed return tuple and string, bytes return type parsingJeffrey Wilcke2016-02-111-30/+120
| | | | | | | | | | | | | Removed old unmarshalling of return types: `abi.Call(...).([]byte)`. This is now replaced by a new syntax: ``` var a []byte err := abi.Call(&a, ...) ``` It also addresses a few issues with Bytes and Strings and can also handle both fixed and arbitrary sized byte slices, including strings.
* account/abi: implements event parsingJeffrey Wilcke2016-02-021-4/+28
| | | | | | Implementation of basic event parsing and its input types. This separates methods and events and fixes an issue with go type parsing and validation.
* accounts/abi: added output parsing & added call mechanismJeffrey Wilcke2015-11-251-77/+69
| | | | Added calling mechanism and return value parsing
* accounts/abi: ABI fixes & added typesJeffrey Wilcke2015-10-301-6/+6
| | | | | | | Changed field `input` to new `inputs`. Addad Hash and Address as input types. Added bytes[N] and N validation
* 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
|
* Implemented contract ABIobscuren2015-01-271-0/+155