Skip to content

Commit

Permalink
fix: modify key name; tendermint -> ostracon
Browse files Browse the repository at this point in the history
  • Loading branch information
egonspace committed Jul 8, 2021
1 parent 5c8e180 commit 39067a6
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ var testGenesisFmt = `{
"validators": [
{
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"type": "ostracon/PubKeyEd25519",
"value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
},
"power": "10",
Expand All @@ -585,11 +585,11 @@ var testGenesisFmt = `{
var testPrivValidatorKey = `{
"address": "A3258DCBF45DCA0DF052981870F2D1441A36D145",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"type": "ostracon/PubKeyEd25519",
"value": "AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
},
"priv_key": {
"type": "tendermint/PrivKeyEd25519",
"type": "ostracon/PrivKeyEd25519",
"value": "EVkqJO/jIXp3rkASXfh9YnyToYXRXhBr6g9cQVxPFnQBP/5povV4HTjvsy530kybxKHwEi85iU8YL0qQhSYVoQ=="
}
}`
Expand Down
4 changes: 2 additions & 2 deletions crypto/bls/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
var _ crypto.PrivKey = PrivKey{}

const (
PrivKeyName = "tendermint/PrivKeyBLS12"
PubKeyName = "tendermint/PubKeyBLS12"
PrivKeyName = "ostracon/PrivKeyBLS12"
PubKeyName = "ostracon/PubKeyBLS12"
PrivKeySize = 32
PubKeySize = 48
SignatureSize = 96
Expand Down
4 changes: 2 additions & 2 deletions crypto/composite/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
// composite.PubKey and composite.PrivKey are intended to allow public key algorithms to be selected for each function.

const (
PubKeyName = "tendermint/PubKeyComposite"
PrivKeyName = "tendermint/PrivKeyComposite"
PubKeyName = "ostracon/PubKeyComposite"
PrivKeyName = "ostracon/PrivKeyComposite"

KeyType = "composite"
KeyTypeBlsWithEd25519 = KeyType + "(" + bls.KeyType + "," + ed25519.KeyType + ")"
Expand Down
4 changes: 2 additions & 2 deletions crypto/ed25519/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
var _ crypto.PrivKey = PrivKey{}

const (
PrivKeyName = "tendermint/PrivKeyEd25519"
PubKeyName = "tendermint/PubKeyEd25519"
PrivKeyName = "ostracon/PrivKeyEd25519"
PubKeyName = "ostracon/PubKeyEd25519"
// PubKeySize is is the size, in bytes, of public keys as used in this package.
PubKeySize = 32
// PrivateKeySize is the size, in bytes, of private keys as used in this package.
Expand Down
4 changes: 2 additions & 2 deletions crypto/secp256k1/secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (

//-------------------------------------
const (
PrivKeyName = "tendermint/PrivKeySecp256k1"
PubKeyName = "tendermint/PubKeySecp256k1"
PrivKeyName = "ostracon/PrivKeySecp256k1"
PubKeyName = "ostracon/PubKeySecp256k1"

KeyType = "secp256k1"
PrivKeySize = 32
Expand Down
4 changes: 2 additions & 2 deletions crypto/sr25519/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
var _ crypto.PrivKey = PrivKey{}

const (
PrivKeyName = "tendermint/PrivKeySr25519"
PubKeyName = "tendermint/PubKeySr25519"
PrivKeyName = "ostracon/PrivKeySr25519"
PubKeyName = "ostracon/PubKeySr25519"

// SignatureSize is the size of an Edwards25519 signature. Namely the size of a compressed
// Sr25519 point, and a field element. Both of which are 32 bytes.
Expand Down
4 changes: 2 additions & 2 deletions privval/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ func TestUnmarshalValidatorKey(t *testing.T) {
serialized := fmt.Sprintf(`{
"address": "%s",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"type": "ostracon/PubKeyEd25519",
"value": "%s"
},
"priv_key": {
"type": "tendermint/PrivKeyEd25519",
"type": "ostracon/PrivKeyEd25519",
"value": "%s"
}
}`, addr, pubB64, privB64)
Expand Down
10 changes: 5 additions & 5 deletions rpc/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ components:
properties:
type:
type: string
example: "tendermint/PubKeyEd25519"
example: "ostracon/PubKeyEd25519"
value:
type: string
example: "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
Expand Down Expand Up @@ -1644,7 +1644,7 @@ components:
properties:
type:
type: string
example: "tendermint/PubKeyEd25519"
example: "ostracon/PubKeyEd25519"
value:
type: string
example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
Expand Down Expand Up @@ -1803,7 +1803,7 @@ components:
properties:
type:
type: string
example: "tendermint/PubKeyEd25519"
example: "ostracon/PubKeyEd25519"
value:
type: string
example: "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM="
Expand Down Expand Up @@ -1974,7 +1974,7 @@ components:
- "value"
properties:
type:
example: "tendermint/PubKeyEd25519"
example: "ostracon/PubKeyEd25519"
value:
type: "string"
example: "VNMNfw7mrQBSpEvCtA9ykOe6BoR00RM9b/a9v3vXZhY="
Expand Down Expand Up @@ -2722,7 +2722,7 @@ components:
properties:
type:
type: string
example: "tendermint/PubKeyEd25519"
example: "ostracon/PubKeyEd25519"
value:
type: string
example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
Expand Down
6 changes: 3 additions & 3 deletions tools/tm-signer-harness/internal/test_harness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const (
keyFileContents = `{
"address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"type": "ostracon/PubKeyEd25519",
"value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc="
},
"priv_key": {
"type": "tendermint/PrivKeyEd25519",
"type": "ostracon/PrivKeyEd25519",
"value": "8O39AkQsoe1sBQwud/Kdul8lg8K9SFsql9aZvwXQSt1kKy5ONpzMTKifvSeYrHC/C76Oqturk4ffJCNwrRIXFw=="
}
}`
Expand Down Expand Up @@ -61,7 +61,7 @@ const (
{
"address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"type": "ostracon/PubKeyEd25519",
"value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc="
},
"power": "10",
Expand Down
10 changes: 5 additions & 5 deletions types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ func TestGenesisBad(t *testing.T) {
[]byte(
`{"validators":[` +
`{"pub_key":{` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// too big chain_id
[]byte(
`{"chain_id": "Lorem ipsum dolor sit amet, consectetuer adipiscing", "validators": [` +
`{"pub_key":{` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// wrong address
[]byte(
`{"chain_id":"mychain", "validators":[` +
`{"address": "A", "pub_key":{` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// missing some params in voter_params
[]byte(
`{"chain_id":"mychain", "validators":[` +
`{"pub_key":{` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}], ` +
`"voter_params":{"voter_election_threshold":"1"}` +
`}`,
Expand All @@ -75,7 +75,7 @@ func TestGenesisGood(t *testing.T) {
"initial_height": "1000",
"consensus_params": null,
"validators": [{
"pub_key":{"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},
"pub_key":{"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},
"power":"10",
"name":""
}],
Expand Down

0 comments on commit 39067a6

Please sign in to comment.