Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
5ad1dbf5
Unverified
Commit
5ad1dbf5
authored
6 years ago
by
Silas Davis
Browse files
Options
Downloads
Patches
Plain Diff
To be consistent with GenesisDoc GenesisSpec should use 'PublicKey' as
field name Signed-off-by:
Silas Davis
<
silas@monax.io
>
parent
989b62b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
genesis/spec/genesis_spec.go
+6
-6
6 additions, 6 deletions
genesis/spec/genesis_spec.go
with
6 additions
and
6 deletions
genesis/spec/genesis_spec.go
+
6
−
6
View file @
5ad1dbf5
...
...
@@ -33,9 +33,9 @@ type GenesisSpec struct {
type
TemplateAccount
struct
{
// Address is convenient to have in file for reference, but otherwise ignored since derived from PublicKey
Address
*
acm
.
Address
`json:",omitempty"`
PubKey
*
acm
.
PublicKey
`json:",omitempty"`
Amount
*
uint64
`json:",omitempty"`
Address
*
acm
.
Address
`json:",omitempty"`
Pub
lic
Key
*
acm
.
PublicKey
`json:",omitempty"`
Amount
*
uint64
`json:",omitempty"`
// If any bonded amount then this account is also a Validator
AmountBonded
*
uint64
`json:",omitempty"`
Name
string
`json:",omitempty"`
...
...
@@ -111,7 +111,7 @@ func (ta TemplateAccount) Account(keyClient keys.KeyClient, index int) (*genesis
// Adds a public key and address to the template. If PublicKey will try to fetch it by Address.
// If both PublicKey and Address are not set will use the keyClient to generate a new keypair
func
(
ta
TemplateAccount
)
RealisePubKeyAndAddress
(
keyClient
keys
.
KeyClient
)
(
pubKey
acm
.
PublicKey
,
address
acm
.
Address
,
err
error
)
{
if
ta
.
PubKey
==
nil
{
if
ta
.
Pub
lic
Key
==
nil
{
if
ta
.
Address
==
nil
{
// If neither PublicKey or Address set then generate a new one
address
,
err
=
keyClient
.
Generate
(
ta
.
Name
,
keys
.
KeyTypeEd25519Ripemd160
)
...
...
@@ -127,10 +127,10 @@ func (ta TemplateAccount) RealisePubKeyAndAddress(keyClient keys.KeyClient) (pub
return
}
}
else
{
address
:=
ta
.
PubKey
.
Address
()
address
:=
ta
.
Pub
lic
Key
.
Address
()
if
ta
.
Address
!=
nil
&&
*
ta
.
Address
!=
address
{
err
=
fmt
.
Errorf
(
"template address %s does not match public key derived address %s"
,
ta
.
Address
,
ta
.
PubKey
)
ta
.
Pub
lic
Key
)
}
}
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment