Skip to content

Commit

Permalink
Update ContractClient.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ranabd36 authored Sep 4, 2019
1 parent 31c8dba commit cb3b8b4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Methods/ContractClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class ContractClient extends AbstractMethods

/**
* eth
*
* @var Eth
*/
protected $eth;
Expand Down Expand Up @@ -151,7 +150,6 @@ public function at($address)
throw new InvalidArgumentException('Please make sure address is valid.');
}
$this->toAddress = AddressFormatter::format($address);

return $this;
}

Expand Down Expand Up @@ -217,7 +215,6 @@ public function abi($abi)
}
}
$this->abi = $abiArray;

return $this;
}

Expand Down Expand Up @@ -300,7 +297,7 @@ public function new()

$transaction->data = '0x' . $this->bytecode . Util::stripZero($data);

return Eth::sendTransaction($transaction);
return (new EthClient($this->client))->sendTransaction($transaction);
}
}

Expand All @@ -323,7 +320,7 @@ public function send()

$transaction = $this->getTransaction($arguments, $method);

return Eth::sendTransaction($transaction);
return (new EthClient($this->client))->sendTransaction($transaction);
}
}

Expand Down Expand Up @@ -394,9 +391,8 @@ public function call()
if (!is_string($method)) {
throw new InvalidArgumentException('Please make sure the method is string.');
}

$transaction = $this->getTransaction($arguments, $method);
$response = Eth::call($transaction, new BlockNumber());
$response = (new EthClient($this->client))->call($transaction, new BlockNumber());
return current($this->ethabi->decodeParameters($this->function, $response));
}
return null;
Expand Down Expand Up @@ -442,7 +438,7 @@ public function estimateGas()
$transaction = $this->getTransaction($arguments, $method);
}

return Eth::estimateGas($transaction);
return (new EthClient($this->client))->estimateGas($transaction);
}
return null;
}
Expand Down

0 comments on commit cb3b8b4

Please sign in to comment.