-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: any.sender #584
feat: any.sender #584
Conversation
hash := sha256.Sum256(message) | ||
return ethcrypto.Sign(hash[:], &pk.ecdsa) | ||
func (pk PrivateKey) Sign(hash []byte) (signature []byte, err error) { | ||
// hash := sha256.Sum256(message) |
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.
commentedOutCode: may want to remove commented-out code (from gocritic
)
"relayContractAddress": encoding.EncodeHexZeroX(relayContractAddress), | ||
"signature": encoding.EncodeHexZeroX(signature), | ||
}). | ||
// SetBody(sendReq{ |
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.
commentedOutCode: may want to remove commented-out code (from gocritic
)
} | ||
if response.StatusCode() != 200 { | ||
return errors.Errorf("request: %+v\nresponse: %+v\n", req.Body, response.String()) | ||
// return errors.New(response.String()) |
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.
commentedOutCode: may want to remove commented-out code (from gocritic
)
) | ||
|
||
// NewSender create new API client | ||
func NewSender(address string, relayContractAddress, rpcURL string) (*Sender, error) { |
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.
paramTypeCombine: func(address string, relayContractAddress, rpcURL string) (*Sender, error) could be replaced with func(address, relayContractAddress, rpcURL string) (*Sender, error) (from gocritic
)
return nil | ||
} | ||
|
||
func (e Sender) encode(to []byte, from []byte, data []byte, deadline int64, refund int64, gas int64, relayContract []byte) ([]byte, error) { |
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.
paramTypeCombine: func(to []byte, from []byte, data []byte, deadline int64, refund int64, gas int64, relayContract []byte) ([]byte, error) could be replaced with func(to, from, data []byte, deadline, refund, gas int64, relayContract []byte) ([]byte, error) (from gocritic
)
return err | ||
} | ||
currentBlock, err := ethClient.BlockByNumber(ctx, nil) | ||
if err != nil { |
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.
only one cuddle assignment allowed before if statement (from wsl
)
if err != nil { | ||
return err | ||
} | ||
toAddress := common.BytesToAddress(to) |
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.
assignments should only be cuddled with other assignments (from wsl
)
if err != nil { | ||
return err | ||
} | ||
deadline := currentBlock.Number().Int64() + 500 // this is an arbitrary number |
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.
assignments should only be cuddled with other assignments (from wsl
)
if response.StatusCode() != 200 { | ||
return errors.Errorf("request: %+v\nresponse: %+v\n", req.Body, response.String()) | ||
// return errors.New(response.String()) | ||
} |
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.
block should not end with a whitespace (or comment) (from wsl
)
println(fmt.Sprintf("%+v", req.Body)) | ||
return errors.WithStack(err) | ||
} | ||
if response.StatusCode() != 200 { |
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.
if statements should only be cuddled with assignments (from wsl
)
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Mailchain team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the |
ref #580