diff --git a/src/Contracts/Types/Address.php b/src/Contracts/Types/Address.php index a73b589..2e31714 100644 --- a/src/Contracts/Types/Address.php +++ b/src/Contracts/Types/Address.php @@ -55,10 +55,10 @@ public function isDynamicType() * to do: iban * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { $value = (string) $value; diff --git a/src/Contracts/Types/BaseArray.php b/src/Contracts/Types/BaseArray.php index 3fb70fa..820920b 100644 --- a/src/Contracts/Types/BaseArray.php +++ b/src/Contracts/Types/BaseArray.php @@ -94,23 +94,23 @@ public function encodeElements($value, $name) * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { - return implode('', $this->encodeElements($value, $name)); + return implode('', $this->encodeElements($value, $abiType)); } /** * outputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function outputFormat($value, $name) - { - throw new InvalidArgumentException('Should not call outputFormat in BaseArray directly'); - } + // public function outputFormat($value, $abiType) + // { + // throw new InvalidArgumentException('Should not call outputFormat in BaseArray directly'); + // } } \ No newline at end of file diff --git a/src/Contracts/Types/Boolean.php b/src/Contracts/Types/Boolean.php index f5b6e77..048aa1a 100644 --- a/src/Contracts/Types/Boolean.php +++ b/src/Contracts/Types/Boolean.php @@ -52,10 +52,10 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { if (!is_bool($value)) { throw new InvalidArgumentException('The value to inputFormat function must be boolean.'); diff --git a/src/Contracts/Types/Bytes.php b/src/Contracts/Types/Bytes.php index 913d7a5..8af0b1b 100644 --- a/src/Contracts/Types/Bytes.php +++ b/src/Contracts/Types/Bytes.php @@ -53,10 +53,10 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { if (!Utils::isHex($value)) { throw new InvalidArgumentException('The value to inputFormat must be hex bytes.'); diff --git a/src/Contracts/Types/DynamicArray.php b/src/Contracts/Types/DynamicArray.php index a4f40f4..6ce3247 100644 --- a/src/Contracts/Types/DynamicArray.php +++ b/src/Contracts/Types/DynamicArray.php @@ -53,12 +53,12 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { - $results = $this->encodeElements($value, $name); + $results = $this->encodeElements($value, $abiType); $encodeSize = IntegerFormatter::format(count($value)); return $encodeSize . implode('', $results); } diff --git a/src/Contracts/Types/DynamicBytes.php b/src/Contracts/Types/DynamicBytes.php index 0adbce6..f959884 100644 --- a/src/Contracts/Types/DynamicBytes.php +++ b/src/Contracts/Types/DynamicBytes.php @@ -53,10 +53,10 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { if (!Utils::isHex($value)) { throw new InvalidArgumentException('The value to inputFormat must be hex bytes.'); diff --git a/src/Contracts/Types/IType.php b/src/Contracts/Types/IType.php index 6dc9cc3..e669977 100644 --- a/src/Contracts/Types/IType.php +++ b/src/Contracts/Types/IType.php @@ -32,8 +32,8 @@ public function isDynamicType(); * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name); + public function inputFormat($value, $abiType); } \ No newline at end of file diff --git a/src/Contracts/Types/Integer.php b/src/Contracts/Types/Integer.php index a149594..d0279de 100644 --- a/src/Contracts/Types/Integer.php +++ b/src/Contracts/Types/Integer.php @@ -54,10 +54,10 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { return IntegerFormatter::format($value); } diff --git a/src/Contracts/Types/Str.php b/src/Contracts/Types/Str.php index 2bee6d0..a8b968f 100644 --- a/src/Contracts/Types/Str.php +++ b/src/Contracts/Types/Str.php @@ -54,10 +54,10 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { $value = Utils::toHex($value); $prefix = IntegerFormatter::format(mb_strlen($value) / 2); diff --git a/src/Contracts/Types/Tuple.php b/src/Contracts/Types/Tuple.php index b95841f..8e1eb33 100644 --- a/src/Contracts/Types/Tuple.php +++ b/src/Contracts/Types/Tuple.php @@ -54,15 +54,15 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $abiTypes + * @param string $abiType * @return string */ - public function inputFormat($params, $abiTypes) + public function inputFormat($params, $abiType) { $result = []; $rawHead = []; $tail = []; - foreach ($abiTypes['coders'] as $key => $abiType) { + foreach ($abiType['coders'] as $key => $abiType) { if ($abiType['dynamic']) { $rawHead[] = null; $tail[] = $abiType['solidityType']->encode($params[$key], $abiType); @@ -105,14 +105,14 @@ public function inputFormat($params, $abiTypes) * outputFormat * * @param string $value - * @param array $abiTypes + * @param array $abiType * @return string */ - public function outputFormat($value, $abiTypes) + public function outputFormat($value, $abiType) { $results = []; $staticOffset = 0; - foreach ($abiTypes['coders'] as $key => $abiType) { + foreach ($abiType['coders'] as $key => $abiType) { if ($abiType['dynamic']) { $startPosHex = mb_substr($value, $staticOffset, 64); $startPos = Utils::hexToNumber($startPosHex); diff --git a/src/Contracts/Types/Uinteger.php b/src/Contracts/Types/Uinteger.php index 9b528c4..086768d 100644 --- a/src/Contracts/Types/Uinteger.php +++ b/src/Contracts/Types/Uinteger.php @@ -54,10 +54,10 @@ public function isDynamicType() * inputFormat * * @param mixed $value - * @param string $name + * @param array $abiType * @return string */ - public function inputFormat($value, $name) + public function inputFormat($value, $abiType) { return IntegerFormatter::format($value); }