-
Notifications
You must be signed in to change notification settings - Fork 112
contracts/swap, swap: refactor contractAddress, remove backend as inputParam, function order in contracts/swap #1748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. just one question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -130,7 +129,7 @@ func createOwner(prvkey *ecdsa.PrivateKey) *Owner { | |||
|
|||
// DeploySuccess is for convenience log output | |||
func (s *Swap) DeploySuccess() string { | |||
return fmt.Sprintf("contract: %s, owner: %s, deposit: %v, signer: %x", s.owner.Contract.Hex(), s.owner.address.Hex(), s.params.InitialDepositAmount, s.owner.publicKey) | |||
return fmt.Sprintf("contract: %s, owner: %s, deposit: %v, signer: %x", s.GetParams().ContractAddress.Hex(), s.owner.address.Hex(), s.params.InitialDepositAmount, s.owner.publicKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but your change reminds me of it: signer: %x........,s.owner.publickey
actually prints garbage. Can you open an issue where we'd print the hex value of it? Thanks.
As it is a very small change, you could do it as part of this PR if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice PR, it brings more simplification and clarity to the actual Swap elements.
This PR includes a small refactor with regards to where the chequebook contractAddress is stored.
Previously, it was stored explicitly in
swap.owner.Contract
, while it was also implicitly stored in swap.contract (otherwise we would not be able to do calls to the contract).This PR removes
swap.owner.Contract
as a place to store the contractAddress and exposes the contractAddress viaswap.getParams()
.Additionally, two other refactors were included:
swap
functions which haveswap
as a receiver (instead, use swap.backend)