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: add set oracles at ApplyUpgrade #586

Merged
merged 49 commits into from
Jan 4, 2023

Conversation

audtlr24
Copy link
Contributor

@audtlr24 audtlr24 commented Jan 3, 2023

As discussed in #582 (comment), instead of applying the queue as in PR #584, change it to check the EncryptedOraclePrivKey in the OracleUpgrade store.
Existing PR #584 will be closed.

audtlr24 and others added 30 commits December 19, 2022 10:28
Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
…nto ft/569/oracle-upgrade-handler

# Conflicts:
#	cmd/panacead/cmd/genoracle.go
#	proto/panacea/oracle/v2/oracle.proto
…ft/571/upgrade-oracle-tx

# Conflicts:
#	proto/panacea/oracle/v2/oracle.proto
#	proto/panacea/oracle/v2/proposal.proto
#	proto/panacea/oracle/v2/query.proto
#	x/oracle/types/errors.go
#	x/oracle/types/keys.go
#	x/oracle/types/oracle.go
#	x/oracle/types/oracle.pb.go
#	x/oracle/types/query.pb.go
#	x/oracle/types/query.pb.gw.go
…ft/575/upgrade-proto

# Conflicts:
#	proto/panacea/oracle/v2/oracle.proto
#	proto/panacea/oracle/v2/proposal.proto
#	proto/panacea/oracle/v2/query.proto
#	x/oracle/types/keys.go
#	x/oracle/types/oracle.pb.go
#	x/oracle/types/query.pb.go
#	x/oracle/types/query.pb.gw.go
This reverts commit 44a3f47.
…1/upgrade-oracle-tx

# Conflicts:
#	proto/panacea/oracle/v2/oracle.proto
#	proto/panacea/oracle/v2/proposal.proto
#	x/oracle/keeper/grpc_query_oracle.go
#	x/oracle/types/keys.go
#	x/oracle/types/oracle.pb.go
Copy link
Contributor

@gyuguen gyuguen left a comment

Choose a reason for hiding this comment

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

Thank you.
I left a comment.

Comment on lines 55 to 59
uniqueID, address := types.SplitOracleUpgradeKey(iterator.Key())
oracleUpgrade, err := k.GetOracleUpgrade(ctx, uniqueID, address.String())
if err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can change like below:
We don't have to called GetOracle(...) function.

Suggested change
uniqueID, address := types.SplitOracleUpgradeKey(iterator.Key())
oracleUpgrade, err := k.GetOracleUpgrade(ctx, uniqueID, address.String())
if err != nil {
return err
}
bz := iterator.Value()
oracleUpgrade := &types.OracleUpgrade{}
if err := k.cdc.UnmarshalLengthPrefixed(bz, oracleUpgrade); err != nil {
return err
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed it in 0e5ad56. Please check again, thanks.

Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

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

lgtm.

Base automatically changed from ft/574/approve-oracle-upgrade to main January 4, 2023 02:55
…pgrade-oracle

# Conflicts:
#	x/oracle/abci_test.go
#	x/oracle/keeper/oracle_test.go
#	x/oracle/keeper/upgrade.go
#	x/oracle/types/errors.go
#	x/oracle/types/keys.go
#	x/oracle/types/oracle.go
Copy link

@inchori inchori left a comment

Choose a reason for hiding this comment

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

LGTM

@audtlr24 audtlr24 merged commit ce3f219 into main Jan 4, 2023
@audtlr24 audtlr24 deleted the ft/na/improve-apply-upgrade-oracle branch January 4, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants