web3p / web3.php

A php interface for interacting with the Ethereum blockchain and ecosystem. Native ABI parsing and smart contract interactions.
MIT License
1.17k stars 550 forks source link

add: defaultBlock in Contract.call() method #155

Closed toknT closed 5 years ago

toknT commented 5 years ago

Add a protected property $defaultBlock in Contract.__construct()

from the rpc document eth.call can send defaultBlock but I can't find out how to use contract's call in pending block with current code.

codecov-io commented 5 years ago

Codecov Report

Merging #155 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #155      +/-   ##
============================================
+ Coverage     87.76%   87.77%   +<.01%     
  Complexity      717      717              
============================================
  Files            47       47              
  Lines          1569     1570       +1     
============================================
+ Hits           1377     1378       +1     
  Misses          192      192
Impacted Files Coverage Δ Complexity Δ
src/Contract.php 77.41% <100%> (+0.06%) 150 <28> (ø) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8a34582...79d7941. Read the comment docs.

sc0Vu commented 5 years ago

@toknT Thanks for your PR. It looks good.

But there is defaultBlock in these api (https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethdefaultblock):

IMHO we should add defaultBlock to Eth.php instead Contract.php.