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 1dd84df
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 50 deletions.
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
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 1dd84df

Please sign in to comment.