Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0Vu committed Jan 28, 2024
1 parent 254344d commit d689759
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions src/Contracts/Types/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
16 changes: 8 additions & 8 deletions src/Contracts/Types/BaseArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
// }
}
4 changes: 2 additions & 2 deletions src/Contracts/Types/Boolean.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Types/Bytes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
6 changes: 3 additions & 3 deletions src/Contracts/Types/DynamicArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Types/DynamicBytes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Types/IType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions src/Contracts/Types/Integer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Types/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions src/Contracts/Types/Tuple.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Types/Uinteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d689759

Please sign in to comment.