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

Change PubKey/PrivKey prefixes of "ostracon/" to "tendermint/" for compatibility (#445) #447

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ var testGenesisFmt = `{
"validators": [
{
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
},
"power": "10",
Expand All @@ -626,18 +626,18 @@ var testGenesisFmt = `{
var testPrivValidatorKey = `{
"address": "A3258DCBF45DCA0DF052981870F2D1441A36D145",
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value": "AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
},
"priv_key": {
"type": "ostracon/PrivKeyEd25519",
"type": "tendermint/PrivKeyEd25519",
"value": "EVkqJO/jIXp3rkASXfh9YnyToYXRXhBr6g9cQVxPFnQBP/5povV4HTjvsy530kybxKHwEi85iU8YL0qQhSYVoQ=="
}
}`

var testNodeKey = `{
"priv_key": {
"type": "ostracon/PrivKeyEd25519",
"type": "tendermint/PrivKeyEd25519",
"value": "hICuZLlVwHdzz6pAQOKk07MFn3Hze1EwwTUUhEDIdti9a1cQLR5Co/lxAzeGcyPWS/LuEr7qbgHmDUJT/nxx+Q=="
}
}`
Expand Down
4 changes: 2 additions & 2 deletions crypto/ed25519/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
var _ crypto.PrivKey = PrivKey{}

const (
PrivKeyName = "ostracon/PrivKeyEd25519"
PubKeyName = "ostracon/PubKeyEd25519"
PrivKeyName = "tendermint/PrivKeyEd25519"
PubKeyName = "tendermint/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 = "ostracon/PrivKeySecp256k1"
PubKeyName = "ostracon/PubKeySecp256k1"
PrivKeyName = "tendermint/PrivKeySecp256k1"
PubKeyName = "tendermint/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 = "ostracon/PrivKeySr25519"
PubKeyName = "ostracon/PubKeySr25519"
PrivKeyName = "tendermint/PrivKeySr25519"
PubKeyName = "tendermint/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
10 changes: 5 additions & 5 deletions rpc/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
Expand Down Expand Up @@ -1698,7 +1698,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
Expand Down Expand Up @@ -1857,7 +1857,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM="
Expand Down Expand Up @@ -2028,7 +2028,7 @@ components:
- "value"
properties:
type:
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: "string"
example: "VNMNfw7mrQBSpEvCtA9ykOe6BoR00RM9b/a9v3vXZhY="
Expand Down Expand Up @@ -2803,7 +2803,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/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": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc="
},
"priv_key": {
"type": "ostracon/PrivKeyEd25519",
"type": "tendermint/PrivKeyEd25519",
"value": "8O39AkQsoe1sBQwud/Kdul8lg8K9SFsql9aZvwXQSt1kKy5ONpzMTKifvSeYrHC/C76Oqturk4ffJCNwrRIXFw=="
}
}`
Expand Down Expand Up @@ -61,7 +61,7 @@ const (
{
"address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748",
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/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":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/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":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// wrong address
[]byte(
`{"chain_id":"mychain", "validators":[` +
`{"address": "A", "pub_key":{` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// missing some params in voter_params
[]byte(
`{"chain_id":"mychain", "validators":[` +
`{"pub_key":{` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/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":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},
"pub_key":{"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},
"power":"10",
"name":""
}],
Expand Down