mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
accounts/abi: fix if statements
Signed-off-by: VoR0220 <rj@erisindustries.com>
This commit is contained in:
parent
b3e60b857a
commit
1ec212eeba
3 changed files with 4 additions and 5 deletions
|
|
@ -126,8 +126,7 @@ func toGoSlice(i int, t Argument, output []byte) (interface{}, error) {
|
||||||
|
|
||||||
// reslice to match the required size
|
// reslice to match the required size
|
||||||
slice = slice[:(size * 32)]
|
slice = slice[:(size * 32)]
|
||||||
}
|
} else if t.Type.IsArray {
|
||||||
if t.Type.IsArray {
|
|
||||||
//get the number of elements in the array
|
//get the number of elements in the array
|
||||||
size = t.Type.SliceSize
|
size = t.Type.SliceSize
|
||||||
|
|
||||||
|
|
@ -142,6 +141,7 @@ func toGoSlice(i int, t Argument, output []byte) (interface{}, error) {
|
||||||
return nil, fmt.Errorf("abi: cannot marshal in to go slice: insufficient size output %d require %d", len(output), offset+32+size*32)
|
return nil, fmt.Errorf("abi: cannot marshal in to go slice: insufficient size output %d require %d", len(output), offset+32+size*32)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < size; i++ {
|
for i := 0; i < size; i++ {
|
||||||
var (
|
var (
|
||||||
inter interface{} // interface type
|
inter interface{} // interface type
|
||||||
|
|
|
||||||
|
|
@ -180,8 +180,7 @@ func (t Type) pack(v reflect.Value) ([]byte, error) {
|
||||||
}
|
}
|
||||||
if t.IsSlice {
|
if t.IsSlice {
|
||||||
return packBytesSlice(packed, v.Len()), nil
|
return packBytesSlice(packed, v.Len()), nil
|
||||||
}
|
} else if t.IsArray {
|
||||||
if t.IsArray {
|
|
||||||
return packed, nil
|
return packed, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ func (n *Node) openDataDir() error {
|
||||||
// Try to open the instance directory as LevelDB storage. This creates a lock file
|
// Try to open the instance directory as LevelDB storage. This creates a lock file
|
||||||
// which prevents concurrent use by another instance as well as accidental use of the
|
// which prevents concurrent use by another instance as well as accidental use of the
|
||||||
// instance directory as a database.
|
// instance directory as a database.
|
||||||
storage, err := storage.OpenFile(instdir, true)
|
storage, err := storage.OpenFile(instdir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue