Skip to content
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: return public key type #533

Closed
wants to merge 5 commits into from
Closed

feat: return public key type #533

wants to merge 5 commits into from

Conversation

robdefeo
Copy link
Member

@robdefeo robdefeo commented Feb 2, 2020

fixes #381

nikosk686 and others added 5 commits February 1, 2020 20:33
- Adds skeleton for sending substrate transactions functionality
- Example code that actually can send a transaction on edgeware test network (see Test_SubstrateCallExample)
- Removes subkey dependency
- Coarse grained verify usage for testing singer sing method
@robdefeo
Copy link
Member Author

robdefeo commented Feb 2, 2020

opened against incorrect branch

@robdefeo robdefeo closed this Feb 2, 2020
@robdefeo robdefeo deleted the issue/381 branch February 2, 2020 20:27
Xt types.Extrinsic
}

//func New(address string) (*SubstrateRPC, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commentFormatting: put a space between // and comment text (from gocritic)


func (e Signer) createSignature(signedData []byte) (*types.MultiSignature, error) {
sig := types.NewSignature(signedData)
switch e.privateKey.(type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type switch statements should only be cuddled with variables switched (from wsl)

if err != nil {
return nil, err
}
era := opts.Era
Copy link
Contributor

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)

return nil, err
}
era := opts.Era
if !opts.Era.IsMortalEra {
Copy link
Contributor

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 !opts.Era.IsMortalEra {
era = types.ExtrinsicEra{IsImmortalEra: true}
}
payload := types.ExtrinsicPayloadV3{
Copy link
Contributor

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)

return nil, err
}
signedData, err := e.privateKey.Sign(data)
if err != nil {
Copy link
Contributor

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)

return nil, err
}
signature, err := e.createSignature(signedData)
if err != nil {
Copy link
Contributor

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)

ext := &opts.Extrinsic
ext.Signature = extSig
ext.Version |= types.ExtrinsicBitSigned
return ext, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return statements should not be cuddled if block has more than two lines (from wsl)

if (blockHash == types.Hash{}) {
return s.api.RPC.State.GetMetadataLatest()
}
return s.api.RPC.State.GetMetadata(blockHash)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return statements should not be cuddled if block has more than two lines (from wsl)

}

func (s SubstrateClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
return big.NewInt(32000), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mnd: Magic number: 32000, in detected (from gomnd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include curve-type when returning public key
3 participants