Skip to content

Commit

Permalink
Renamed from property to avoid python name clash
Browse files Browse the repository at this point in the history
  • Loading branch information
john-connor84 committed Jul 22, 2022
1 parent 88ad253 commit eaa9cc0
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 52 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### API Breaking
* [#737](https://github.com/NibiruChain/nibiru/pull/737) - Renamed from property to avoid python name clash


### Documentation

* [#701](https://github.com/NibiruChain/nibiru/pull/701) Add release process guide
Expand Down
2 changes: 1 addition & 1 deletion proto/pricefeed/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message MsgPostPrice {
option (gogoproto.goproto_getters) = false;

// From: address of oracle
string from = 1;
string oracle = 1;
// Token0: denominator unit of the price, a.k.a. quote asset
string token0 = 2 ;
// Token1: numerator unit of price, a.k.a. base asset
Expand Down
4 changes: 2 additions & 2 deletions x/pricefeed/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (k msgServer) PostPrice(goCtx context.Context, msg *types.MsgPostPrice,
) (*types.MsgPostPriceResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

from, err := sdk.AccAddressFromBech32(msg.From)
from, err := sdk.AccAddressFromBech32(msg.Oracle)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -64,7 +64,7 @@ func (k msgServer) PostPrice(goCtx context.Context, msg *types.MsgPostPrice,
sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName),
sdk.NewAttribute(sdk.AttributeKeySender, msg.From),
sdk.NewAttribute(sdk.AttributeKeySender, msg.Oracle),
),
)

Expand Down
2 changes: 1 addition & 1 deletion x/pricefeed/simulation/post_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func SimulateMsgPostPrice(
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
simAccount, _ := simtypes.RandomAcc(r, accs)
msg := &types.MsgPostPrice{
From: simAccount.Address.String(),
Oracle: simAccount.Address.String(),
}

// TODO: Handling the PostPrice simulation
Expand Down
6 changes: 3 additions & 3 deletions x/pricefeed/types/message_post_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ sdk.Msg = &MsgPostPrice{}

func NewMsgPostPrice(creator string, token0 string, token1 string, price sdk.Dec, expiry time.Time) *MsgPostPrice {
return &MsgPostPrice{
From: creator,
Oracle: creator,
Token0: token0,
Token1: token1,
Price: price,
Expand All @@ -36,7 +36,7 @@ func (msg *MsgPostPrice) Type() string {
}

func (msg *MsgPostPrice) GetSigners() []sdk.AccAddress {
creator, err := sdk.AccAddressFromBech32(msg.From)
creator, err := sdk.AccAddressFromBech32(msg.Oracle)
if err != nil {
panic(err)
}
Expand All @@ -49,7 +49,7 @@ func (msg *MsgPostPrice) GetSignBytes() []byte {
}

func (msg *MsgPostPrice) ValidateBasic() error {
_, err := sdk.AccAddressFromBech32(msg.From)
_, err := sdk.AccAddressFromBech32(msg.Oracle)
if err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}
Expand Down
4 changes: 2 additions & 2 deletions x/pricefeed/types/message_post_price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ func TestMsgPostPrice_ValidateBasic(t *testing.T) {
{
name: "invalid address",
msg: MsgPostPrice{
From: "invalid_address",
Oracle: "invalid_address",
},
err: sdkerrors.ErrInvalidAddress,
}, {
name: "valid address",
msg: MsgPostPrice{
From: sample.AccAddress().String(),
Oracle: sample.AccAddress().String(),
},
},
}
Expand Down
85 changes: 42 additions & 43 deletions x/pricefeed/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eaa9cc0

Please sign in to comment.