OpenST / mosaic-contracts

Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps
https://discuss.openst.org/c/mosaic
MIT License
114 stars 31 forks source link

Check an existence of an active stake request against gateway #766

Closed pgev closed 5 years ago

pgev commented 5 years ago

The following assert from OSTComposer::requestStake

require(
    stakeRequestHashes[msg.sender][address(_gateway)] == bytes32(0),
    "Request for this staker at this gateway is already in process."
);

should be replaced by checking an active stake request existence for the current staker from _gateway input of OSTComposer::requestStake.

A proposal is to introduce a new external function within gateway that returns boolean wrt existence of an active stake request for the passed staker address.

benjaminbollen commented 5 years ago

stakeRequest is different state from ongoing stakes in gateway