1. 10 1月, 2019 2 次提交
  2. 29 12月, 2018 1 次提交
    • M
      accounts/abi: change unpacking of abi fields w/ underscores (#16513) · a4af7343
      Matt K 提交于
      * accounts/abi: fix name styling when unpacking abi fields w/ underscores
      
      ABI fields with underscores that are being unpacked
      into structs expect structs with following form:
      
      int_one -> Int_one
      
      whereas in abigen the generated structs are camelcased
      
      int_one -> IntOne
      
      so updated the unpack method to expect camelcased structs as well.
      a4af7343
  3. 28 12月, 2018 1 次提交
  4. 22 12月, 2018 1 次提交
  5. 17 12月, 2018 1 次提交
  6. 04 9月, 2018 1 次提交
  7. 04 4月, 2018 1 次提交
  8. 05 3月, 2018 1 次提交
    • P
      accounts/abi: Abi binding support for nested arrays, fixes #15648, including... · 0b814d32
      protolambda 提交于
      accounts/abi: Abi binding support for nested arrays, fixes #15648, including nested array unpack fix (#15676)
      
      * accounts/abi/bind: support for multi-dim arrays
      
      Also:
      - reduce usage of regexes a bit.
      - fix minor Java syntax problems
      
      Fixes #15648
      
      * accounts/abi/bind: Add some more documentation
      
      * accounts/abi/bind: Improve code readability
      
      * accounts/abi: bugfix for unpacking nested arrays
      
      The code previously assumed the arrays/slices were always 1 level
      deep. While the packing supports nested arrays (!!!).
      
      The current code for unpacking doesn't return the "consumed" length, so
      this fix had to work around that by calculating it (i.e. packing and
       getting resulting length) after the unpacking of the array element.
      It's far from ideal, but unpacking behaviour is fixed now.
      
      * accounts/abi: Fix unpacking of nested arrays
      
      Removed the temporary workaround of packing to calculate size, which was
      incorrect for slice-like types anyway.
      Full size of nested arrays is used now.
      
      * accounts/abi: deeply nested array unpack test
      
      Test unpacking of an array nested more than one level.
      
      * accounts/abi: Add deeply nested array pack test
      
      Same as the deep nested array unpack test, but the other way around.
      
      * accounts/abi/bind: deeply nested arrays bind test
      
      Test the usage of bindings that were generated
      for methods with multi-dimensional (and not
      just a single extra dimension, like foo[2][3])
      array arguments and returns.
      
      edit: trigger rebuild, CI failed to fetch linter module.
      
      * accounts/abi/bind: improve array binding
      
      wrapArray uses a regex now, and arrayBindingJava is improved.
      
      * accounts/abi: Improve naming of element size func
      
      The full step size for unpacking an array
       is now retrieved with "getFullElemSize".
      
      * accounts/abi: support nested nested array args
      
      Previously, the code only considered the outer-size of the array,
      ignoring the size of the contents. This was fine for most types,
      but nested arrays are packed directly into it, and count towards
      the total size. This resulted in arguments following a nested
      array to replicate some of the binary contents of the array.
      
      The fix: for arrays, calculate their complete contents size:
       count the arg.Type.Elem.Size when Elem is an Array, and
       repeat when their child is an array too, etc.
      The count is the number of 32 byte elements, similar to how it
       previously counted, but nested.
      
      * accounts/abi: Test deep nested arr multi-arguments
      
      Arguments with a deeply nested array should not cause the next arguments
      to be read from the wrong position.
      0b814d32
  9. 21 2月, 2018 2 次提交
  10. 14 2月, 2018 1 次提交
  11. 23 1月, 2018 1 次提交
  12. 31 12月, 2017 1 次提交
  13. 30 12月, 2017 1 次提交
  14. 21 12月, 2017 2 次提交
  15. 20 12月, 2017 1 次提交
  16. 13 12月, 2017 1 次提交
  17. 08 11月, 2017 1 次提交
  18. 17 10月, 2017 1 次提交
  19. 27 6月, 2017 1 次提交
  20. 09 1月, 2017 1 次提交
  21. 06 1月, 2017 1 次提交
  22. 05 1月, 2017 1 次提交
  23. 22 12月, 2016 1 次提交
  24. 04 11月, 2016 1 次提交
  25. 12 5月, 2016 1 次提交
  26. 11 5月, 2016 1 次提交
    • J
      accounts/abi: fixed unpacking in to already slice interfaces · 91a7a4a7
      Jeffrey Wilcke 提交于
      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.
      91a7a4a7
  27. 28 4月, 2016 3 次提交
  28. 20 4月, 2016 1 次提交
    • J
      accouns/abi: refactored ABI package · 5127ec10
      Jeffrey Wilcke 提交于
      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
      5127ec10
  29. 05 4月, 2016 3 次提交
  30. 24 3月, 2016 1 次提交
  31. 15 3月, 2016 1 次提交
  32. 22 2月, 2016 1 次提交
  33. 15 2月, 2016 1 次提交