コード例 #1
0
 def rule_remove_child(
     self,
     st_contract: Contract,
     child_token: int = "st_token",
 ):
     if st_contract.ownerOf(child_token) == self.xhibit:
         from_token = self.xhibit.ownerOfChild(st_contract, child_token)[1]
         self.xhibit.transferChild(from_token, self.alice, st_contract,
                                   child_token, {"from": self.alice})
         self.state.remove_child(from_token, str(st_contract), child_token)
コード例 #2
0
 def rule_receive_child(
     self,
     st_contract: Contract,
     token_id: int = "st_token",
     receiving_token: int = "st_token",
 ):
     if st_contract.ownerOf(token_id) == self.alice:
         st_contract.safeTransferFrom(self.alice, self.xhibit, token_id,
                                      receiving_token, {"from": self.alice})
         self.state.receive_child(receiving_token, str(st_contract),
                                  token_id)