diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index cd09e43a3..c478e0926 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -13654,7 +13654,6 @@ Wasm code to the system | ----- | ---- | ----- | ----------- | | `sender` | [string](#string) | | Sender is the that actor that signed the messages | | `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | -| `code_id` | [uint64](#uint64) | | CodeID is optional | diff --git a/proto/terra/wasm/v1beta1/tx.proto b/proto/terra/wasm/v1beta1/tx.proto index b4962742c..d76814d75 100644 --- a/proto/terra/wasm/v1beta1/tx.proto +++ b/proto/terra/wasm/v1beta1/tx.proto @@ -34,8 +34,6 @@ message MsgStoreCode { string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; // WASMByteCode can be raw or gzip compressed bytes wasm_byte_code = 2 [(gogoproto.moretags) = "yaml:\"wasm_byte_code\"", (gogoproto.customname) = "WASMByteCode"]; - // CodeID is optional - uint64 code_id = 3 [(gogoproto.moretags) = "yaml:\"code_id\"", (gogoproto.customname) = "CodeID"]; } // MsgStoreCodeResponse defines the Msg/StoreCode response type. diff --git a/x/market/keeper/keeper_test.go b/x/market/keeper/keeper_test.go index afc7a4164..b8cb1dcf1 100644 --- a/x/market/keeper/keeper_test.go +++ b/x/market/keeper/keeper_test.go @@ -67,6 +67,6 @@ func TestReplenishPools(t *testing.T) { burnPoolDelta = input.MarketKeeper.GetBurnPoolDelta(input.Ctx) burnReplenishAmt := burnDiff.QuoInt64(recoveryPeriod) - expectedBurnDelta := mintDiff.Sub(burnReplenishAmt) + expectedBurnDelta := burnDiff.Sub(burnReplenishAmt) require.Equal(t, expectedBurnDelta, burnPoolDelta) } diff --git a/x/market/keeper/params.go b/x/market/keeper/params.go index a70ac6722..ab2bbffea 100644 --- a/x/market/keeper/params.go +++ b/x/market/keeper/params.go @@ -14,7 +14,7 @@ func (k Keeper) MintBasePool(ctx sdk.Context) (res sdk.Dec) { // BurnBasePool is burn liquidity pool(usdr unit) which will be made available per PoolRecoveryPeriod func (k Keeper) BurnBasePool(ctx sdk.Context) (res sdk.Dec) { - k.paramSpace.Get(ctx, types.KeyMintBasePool, &res) + k.paramSpace.Get(ctx, types.KeyBurnBasePool, &res) return } diff --git a/x/oracle/abci.go b/x/oracle/abci.go index 709c68538..c973ccbe6 100644 --- a/x/oracle/abci.go +++ b/x/oracle/abci.go @@ -16,89 +16,95 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) params := k.GetParams(ctx) + if core.IsPeriodLastBlock(ctx, params.VotePeriod) { - // Not yet time for a tally - if !core.IsPeriodLastBlock(ctx, params.VotePeriod) { - return - } - - // Build claim map over all validators in active set - validatorClaimMap := make(map[string]types.Claim) + // Build claim map over all validators in active set + validatorClaimMap := make(map[string]types.Claim) - maxValidators := k.StakingKeeper.MaxValidators(ctx) - iterator := k.StakingKeeper.ValidatorsPowerStoreIterator(ctx) - defer iterator.Close() + maxValidators := k.StakingKeeper.MaxValidators(ctx) + iterator := k.StakingKeeper.ValidatorsPowerStoreIterator(ctx) + defer iterator.Close() - powerReduction := k.StakingKeeper.PowerReduction(ctx) + powerReduction := k.StakingKeeper.PowerReduction(ctx) - i := 0 - for ; iterator.Valid() && i < int(maxValidators); iterator.Next() { - validator := k.StakingKeeper.Validator(ctx, iterator.Value()) + i := 0 + for ; iterator.Valid() && i < int(maxValidators); iterator.Next() { + validator := k.StakingKeeper.Validator(ctx, iterator.Value()) - // Exclude not bonded validator - if validator.IsBonded() { - valAddr := validator.GetOperator() - validatorClaimMap[valAddr.String()] = types.NewClaim(validator.GetConsensusPower(powerReduction), 0, 0, valAddr) - i++ + // Exclude not bonded validator + if validator.IsBonded() { + valAddr := validator.GetOperator() + validatorClaimMap[valAddr.String()] = types.NewClaim(validator.GetConsensusPower(powerReduction), 0, 0, valAddr) + i++ + } } - } - // Denom-TobinTax map - voteTargets := make(map[string]sdk.Dec) - k.IterateTobinTaxes(ctx, func(denom string, tobinTax sdk.Dec) bool { - voteTargets[denom] = tobinTax - return false - }) - - // Clear all exchange rates - k.IterateLunaExchangeRates(ctx, func(denom string, _ sdk.Dec) (stop bool) { - k.DeleteLunaExchangeRate(ctx, denom) - return false - }) - - // Organize votes to ballot by denom - // NOTE: **Filter out inactive or jailed validators** - // NOTE: **Make abstain votes to have zero vote power** - voteMap := k.OrganizeBallotByDenom(ctx, validatorClaimMap) - - if referenceTerra := pickReferenceTerra(ctx, k, voteTargets, voteMap); referenceTerra != "" { - // make voteMap of Reference Terra to calculate cross exchange rates - ballotRT := voteMap[referenceTerra] - voteMapRT := ballotRT.ToMap() - exchangeRateRT := ballotRT.WeightedMedian() - - // Iterate through ballots and update exchange rates; drop if not enough votes have been achieved. - for denom, ballot := range voteMap { - - // Convert ballot to cross exchange rates - if denom != referenceTerra { - ballot = ballot.ToCrossRate(voteMapRT) + // Denom-TobinTax map + voteTargets := make(map[string]sdk.Dec) + k.IterateTobinTaxes(ctx, func(denom string, tobinTax sdk.Dec) bool { + voteTargets[denom] = tobinTax + return false + }) + + // Clear all exchange rates + k.IterateLunaExchangeRates(ctx, func(denom string, _ sdk.Dec) (stop bool) { + k.DeleteLunaExchangeRate(ctx, denom) + return false + }) + + // Organize votes to ballot by denom + // NOTE: **Filter out inactive or jailed validators** + // NOTE: **Make abstain votes to have zero vote power** + voteMap := k.OrganizeBallotByDenom(ctx, validatorClaimMap) + + if referenceTerra := pickReferenceTerra(ctx, k, voteTargets, voteMap); referenceTerra != "" { + // make voteMap of Reference Terra to calculate cross exchange rates + ballotRT := voteMap[referenceTerra] + voteMapRT := ballotRT.ToMap() + exchangeRateRT := ballotRT.WeightedMedian() + + // Iterate through ballots and update exchange rates; drop if not enough votes have been achieved. + for denom, ballot := range voteMap { + + // Convert ballot to cross exchange rates + if denom != referenceTerra { + ballot = ballot.ToCrossRate(voteMapRT) + } + + // Get weighted median of cross exchange rates + exchangeRate := Tally(ctx, ballot, params.RewardBand, validatorClaimMap) + + // Transform into the original form uluna/stablecoin + if denom != referenceTerra { + exchangeRate = exchangeRateRT.Quo(exchangeRate) + } + + // Set the exchange rate, emit ABCI event + k.SetLunaExchangeRateWithEvent(ctx, denom, exchangeRate) } + } - // Get weighted median of cross exchange rates - exchangeRate := Tally(ctx, ballot, params.RewardBand, validatorClaimMap) - - // Transform into the original form uluna/stablecoin - if denom != referenceTerra { - exchangeRate = exchangeRateRT.Quo(exchangeRate) + //--------------------------- + // Do miss counting & slashing + voteTargetsLen := len(voteTargets) + for _, claim := range validatorClaimMap { + // Skip abstain & valid voters + if int(claim.WinCount) == voteTargetsLen { + continue } - // Set the exchange rate, emit ABCI event - k.SetLunaExchangeRateWithEvent(ctx, denom, exchangeRate) + // Increase miss counter + k.SetMissCounter(ctx, claim.Recipient, k.GetMissCounter(ctx, claim.Recipient)+1) } - } - //--------------------------- - // Do miss counting & slashing - voteTargetsLen := len(voteTargets) - for _, claim := range validatorClaimMap { - // Skip abstain & valid voters - if int(claim.WinCount) == voteTargetsLen { - continue - } + // Distribute rewards to ballot winners + k.RewardBallotWinners(ctx, validatorClaimMap) + + // Clear the ballot + k.ClearBallots(ctx, params.VotePeriod) - // Increase miss counter - k.SetMissCounter(ctx, claim.Recipient, k.GetMissCounter(ctx, claim.Recipient)+1) + // Update vote targets and tobin tax + k.ApplyWhitelist(ctx, params.Whitelist, voteTargets) } // Do slash who did miss voting over threshold and @@ -107,14 +113,5 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) { k.SlashAndResetMissCounters(ctx) } - // Distribute rewards to ballot winners - k.RewardBallotWinners(ctx, validatorClaimMap) - - // Clear the ballot - k.ClearBallots(ctx, params.VotePeriod) - - // Update vote targets and tobin tax - k.ApplyWhitelist(ctx, params.Whitelist, voteTargets) - return } diff --git a/x/oracle/abci_test.go b/x/oracle/abci_test.go index f52bc826a..78b4fa056 100644 --- a/x/oracle/abci_test.go +++ b/x/oracle/abci_test.go @@ -3,6 +3,7 @@ package oracle_test import ( "fmt" "math" + "sort" "testing" "github.com/stretchr/testify/require" @@ -167,6 +168,7 @@ func TestOracleTally(t *testing.T) { Recipient: valAddr, } } + sort.Sort(ballot) weightedMedian := ballot.WeightedMedian() standardDeviation := ballot.StandardDeviation() maxSpread := weightedMedian.Mul(input.OracleKeeper.RewardBand(input.Ctx).QuoInt64(2)) diff --git a/x/oracle/client/rest/tx.go b/x/oracle/client/rest/tx.go index a8a116cca..66c010ce2 100644 --- a/x/oracle/client/rest/tx.go +++ b/x/oracle/client/rest/tx.go @@ -59,13 +59,6 @@ func newDelegateHandlerFunction(clientCtx client.Context) http.HandlerFunc { return } - // Bytes comparison, so do not require type conversion - if !voterAddr.Equals(req.Feeder) { - err := fmt.Errorf("[%v] can not change [%v] delegation", req.Feeder, voterAddr) - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - // create the message msg := types.NewMsgDelegateFeedConsent(voterAddr, req.Feeder) if rest.CheckBadRequestError(w, msg.ValidateBasic()) { @@ -109,12 +102,15 @@ func newAggregatePrevoteHandlerFunction(clientCtx client.Context) http.HandlerFu } hash = types.GetAggregateVoteHash(req.Salt, req.ExchangeRates, voterAddr) - } else { + } else if len(req.Hash) > 0 { hash, err = types.AggregateVoteHashFromHexString(req.Hash) if err != nil { rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) return } + } else { + rest.WriteErrorResponse(w, http.StatusBadRequest, "must provide Hash or (ExchangeRates & Salt)") + return } // create the message diff --git a/x/oracle/keeper/ballot.go b/x/oracle/keeper/ballot.go index 34f32f41d..d0e3b600a 100644 --- a/x/oracle/keeper/ballot.go +++ b/x/oracle/keeper/ballot.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "sort" "strings" "github.com/terra-money/core/x/oracle/types" @@ -44,6 +45,13 @@ func (k Keeper) OrganizeBallotByDenom(ctx sdk.Context, validatorClaimMap map[str } k.IterateAggregateExchangeRateVotes(ctx, aggregateHandler) + + // sort created ballot + for denom, ballot := range votes { + sort.Sort(ballot) + votes[denom] = ballot + } + return } diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 93ae5e98f..90611e525 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -358,7 +358,7 @@ func (k Keeper) ValidateFeeder(ctx sdk.Context, feederAddr sdk.AccAddress, valid } // Check that the given validator exists - if val := k.StakingKeeper.Validator(ctx, validatorAddr); !val.IsBonded() { + if val := k.StakingKeeper.Validator(ctx, validatorAddr); val == nil || !val.IsBonded() { return sdkerrors.Wrapf(stakingtypes.ErrNoValidatorFound, "validator %s is not active set", validatorAddr.String()) } diff --git a/x/oracle/keeper/msg_server.go b/x/oracle/keeper/msg_server.go index e72a85ee3..caba44d03 100644 --- a/x/oracle/keeper/msg_server.go +++ b/x/oracle/keeper/msg_server.go @@ -33,11 +33,8 @@ func (ms msgServer) AggregateExchangeRatePrevote(goCtx context.Context, msg *typ return nil, err } - if !feederAddr.Equals(valAddr) { - delegate := ms.GetFeederDelegation(ctx, valAddr) - if !delegate.Equals(feederAddr) { - return nil, sdkerrors.Wrap(types.ErrNoVotingPermission, msg.Feeder) - } + if err := ms.ValidateFeeder(ctx, feederAddr, valAddr); err != nil { + return nil, err } // Convert hex string to votehash @@ -46,12 +43,6 @@ func (ms msgServer) AggregateExchangeRatePrevote(goCtx context.Context, msg *typ return nil, sdkerrors.Wrap(types.ErrInvalidHash, err.Error()) } - // Check that the given validator exists - val := ms.StakingKeeper.Validator(ctx, valAddr) - if val == nil { - return nil, sdkerrors.Wrap(stakingtypes.ErrNoValidatorFound, msg.Validator) - } - aggregatePrevote := types.NewAggregateExchangeRatePrevote(voteHash, valAddr, uint64(ctx.BlockHeight())) ms.SetAggregateExchangeRatePrevote(ctx, valAddr, aggregatePrevote) @@ -83,17 +74,8 @@ func (ms msgServer) AggregateExchangeRateVote(goCtx context.Context, msg *types. return nil, err } - if !feederAddr.Equals(valAddr) { - delegate := ms.GetFeederDelegation(ctx, valAddr) - if !delegate.Equals(feederAddr) { - return nil, sdkerrors.Wrap(types.ErrNoVotingPermission, msg.Feeder) - } - } - - // Check that the given validator exists - val := ms.StakingKeeper.Validator(ctx, valAddr) - if val == nil { - return nil, sdkerrors.Wrap(stakingtypes.ErrNoValidatorFound, msg.Validator) + if err := ms.ValidateFeeder(ctx, feederAddr, valAddr); err != nil { + return nil, err } params := ms.GetParams(ctx) diff --git a/x/oracle/simulation/operations.go b/x/oracle/simulation/operations.go index 43683b955..d36e3c08a 100644 --- a/x/oracle/simulation/operations.go +++ b/x/oracle/simulation/operations.go @@ -91,7 +91,7 @@ func SimulateMsgAggregateExchangeRatePrevote(ak types.AccountKeeper, bk types.Ba // ensure the validator exists val := k.StakingKeeper.Validator(ctx, address) - if val == nil { + if val == nil || !val.IsBonded() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAggregateExchangeRatePrevote, "unable to find validator"), nil, nil } @@ -155,7 +155,7 @@ func SimulateMsgAggregateExchangeRateVote(ak types.AccountKeeper, bk types.BankK // ensure the validator exists val := k.StakingKeeper.Validator(ctx, address) - if val == nil { + if val == nil || !val.IsBonded() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAggregateExchangeRateVote, "unable to find validator"), nil, nil } diff --git a/x/oracle/tally.go b/x/oracle/tally.go index 925c4bac4..88c41a4e2 100644 --- a/x/oracle/tally.go +++ b/x/oracle/tally.go @@ -42,10 +42,7 @@ func Tally(ctx sdk.Context, pb types.ExchangeRateBallot, rewardBand sdk.Dec, val } // ballot for the asset is passing the threshold amount of voting power -func ballotIsPassing(ctx sdk.Context, ballot types.ExchangeRateBallot, k keeper.Keeper) (sdk.Int, bool) { - totalBondedPower := sdk.TokensToConsensusPower(k.StakingKeeper.TotalBondedTokens(ctx), k.StakingKeeper.PowerReduction(ctx)) - voteThreshold := k.VoteThreshold(ctx) - thresholdVotes := voteThreshold.MulInt64(totalBondedPower).RoundInt() +func ballotIsPassing(ballot types.ExchangeRateBallot, thresholdVotes sdk.Int) (sdk.Int, bool) { ballotPower := sdk.NewInt(ballot.Power()) return ballotPower, !ballotPower.IsZero() && ballotPower.GTE(thresholdVotes) } @@ -57,6 +54,10 @@ func pickReferenceTerra(ctx sdk.Context, k keeper.Keeper, voteTargets map[string largestBallotPower := int64(0) referenceTerra := "" + totalBondedPower := sdk.TokensToConsensusPower(k.StakingKeeper.TotalBondedTokens(ctx), k.StakingKeeper.PowerReduction(ctx)) + voteThreshold := k.VoteThreshold(ctx) + thresholdVotes := voteThreshold.MulInt64(totalBondedPower).RoundInt() + for denom, ballot := range voteMap { // If denom is not in the voteTargets, or the ballot for it has failed, then skip // and remove it from voteMap for iteration efficiency @@ -69,7 +70,7 @@ func pickReferenceTerra(ctx sdk.Context, k keeper.Keeper, voteTargets map[string // If the ballot is not passed, remove it from the voteTargets array // to prevent slashing validators who did valid vote. - if power, ok := ballotIsPassing(ctx, ballot, k); ok { + if power, ok := ballotIsPassing(ballot, thresholdVotes); ok { ballotPower = power.Int64() } else { delete(voteTargets, denom) diff --git a/x/oracle/types/ballot.go b/x/oracle/types/ballot.go index 62ec4e2bd..12aff8271 100644 --- a/x/oracle/types/ballot.go +++ b/x/oracle/types/ballot.go @@ -79,7 +79,7 @@ func (pb ExchangeRateBallot) WeightedMedian() sdk.Dec { totalPower := pb.Power() if pb.Len() > 0 { if !sort.IsSorted(pb) { - sort.Sort(pb) + panic("ballot must be sorted") } pivot := int64(0) @@ -126,7 +126,7 @@ func (pb ExchangeRateBallot) Len() int { // Less reports whether the element with // index i should sort before the element with index j. func (pb ExchangeRateBallot) Less(i, j int) bool { - return pb[i].ExchangeRate.LTE(pb[j].ExchangeRate) + return pb[i].ExchangeRate.LT(pb[j].ExchangeRate) } // Swap implements sort.Interface. diff --git a/x/oracle/types/ballot_test.go b/x/oracle/types/ballot_test.go index 646926311..1f2c74a04 100644 --- a/x/oracle/types/ballot_test.go +++ b/x/oracle/types/ballot_test.go @@ -167,7 +167,7 @@ func TestPBWeightedMedian(t *testing.T) { }{ { // Supermajority one number - []int64{2, 1, 10, 100000}, + []int64{1, 2, 10, 100000}, []int64{1, 1, 100, 1}, []bool{true, true, true, true}, sdk.NewDec(10), diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index 8823c968c..b7b848602 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -100,7 +100,7 @@ func (p Params) Validate() error { } if p.RewardDistributionWindow < p.VotePeriod { - return fmt.Errorf("oracle parameter RewardDistributionWindow must be greater than or equal with votes period") + return fmt.Errorf("oracle parameter RewardDistributionWindow must be greater than or equal with VotePeriod") } if p.SlashFraction.GT(sdk.OneDec()) || p.SlashFraction.IsNegative() { @@ -108,7 +108,7 @@ func (p Params) Validate() error { } if p.SlashWindow < p.VotePeriod { - return fmt.Errorf("oracle parameter SlashWindow must be greater than or equal with votes period") + return fmt.Errorf("oracle parameter SlashWindow must be greater than or equal with VotePeriod") } if p.MinValidPerWindow.GT(sdk.OneDec()) || p.MinValidPerWindow.IsNegative() { diff --git a/x/treasury/legacy/v05/migrate.go b/x/treasury/legacy/v05/migrate.go index 5b9a528e2..1e28c1ca0 100644 --- a/x/treasury/legacy/v05/migrate.go +++ b/x/treasury/legacy/v05/migrate.go @@ -30,7 +30,7 @@ func Migrate( // Remove cumulative height dependencies cumulativeEpochs := int(treasuryGenState.CumulativeHeight / int64(v04treasury.BlocksPerWeek)) - epochStates := make([]v05treasury.EpochState, len(treasuryGenState.TRs)) + epochStates := make([]v05treasury.EpochState, len(treasuryGenState.TRs)-cumulativeEpochs) for i := range treasuryGenState.TRs { if i < cumulativeEpochs { continue diff --git a/x/vesting/types/schedule.go b/x/vesting/types/schedule.go index 77c8f1ffc..76383fb25 100644 --- a/x/vesting/types/schedule.go +++ b/x/vesting/types/schedule.go @@ -100,7 +100,6 @@ func (vs VestingSchedule) GetDenom() string { func (vs VestingSchedule) Validate() error { sumRatio := sdk.ZeroDec() for _, lazySchedule := range vs.Schedules { - if err := lazySchedule.Validate(); err != nil { return err } diff --git a/x/vesting/types/vesting_account.go b/x/vesting/types/vesting_account.go index 7f860dbb7..18ed8331b 100644 --- a/x/vesting/types/vesting_account.go +++ b/x/vesting/types/vesting_account.go @@ -1,6 +1,7 @@ package types import ( + fmt "fmt" "time" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -125,10 +126,17 @@ func (lgva LazyGradedVestingAccount) GetEndTime() int64 { // Validate checks for errors on the account fields func (lgva LazyGradedVestingAccount) Validate() error { + denomMap := make(map[string]bool) for _, vestingSchedule := range lgva.GetVestingSchedules() { + if _, ok := denomMap[vestingSchedule.Denom]; ok { + return fmt.Errorf("cannot have multiple vesting schedules for %s", vestingSchedule.Denom) + } + if err := vestingSchedule.Validate(); err != nil { return err } + + denomMap[vestingSchedule.Denom] = true } return lgva.BaseVestingAccount.Validate() diff --git a/x/vesting/types/vesting_account_test.go b/x/vesting/types/vesting_account_test.go index 996f8df2a..884bc2b34 100644 --- a/x/vesting/types/vesting_account_test.go +++ b/x/vesting/types/vesting_account_test.go @@ -316,6 +316,14 @@ func TestGenesisAccountValidate(t *testing.T) { types.NewLazyGradedVestingAccount(baseAcc, initialVesting, types.VestingSchedules{types.VestingSchedule{core.MicroLunaDenom, types.Schedules{types.Schedule{1554668078, 1654668078, sdk.NewDecWithPrec(1, 1)}}}}), errors.New("vesting total ratio must be one"), }, + { + "multiple vesting schedule for a denom", + types.NewLazyGradedVestingAccount(baseAcc, initialVesting, types.VestingSchedules{ + {core.MicroLunaDenom, types.Schedules{types.Schedule{1554668078, 1654668078, sdk.OneDec()}}}, + {core.MicroLunaDenom, types.Schedules{types.Schedule{1554668078, 1654668078, sdk.OneDec()}}}, + }), + errors.New("cannot have multiple vesting schedules for uluna"), + }, } for _, tt := range tests { tt := tt diff --git a/x/wasm/keeper/api.go b/x/wasm/keeper/api.go index b19134ffb..973fa7f86 100644 --- a/x/wasm/keeper/api.go +++ b/x/wasm/keeper/api.go @@ -11,20 +11,22 @@ import ( func (k Keeper) getCosmWasmAPI(ctx sdk.Context) cosmwasm.GoAPI { return cosmwasm.GoAPI{ HumanAddress: func(canon []byte) (humanAddr string, usedGas uint64, err error) { + humanizeCost := types.HumanizeCost * types.GasMultiplier err = sdk.VerifyAddressFormat(canon) if err != nil { - return "", 0, nil + return "", humanizeCost, nil } - return sdk.AccAddress(canon).String(), types.HumanizeCost * types.GasMultiplier, nil + return sdk.AccAddress(canon).String(), humanizeCost, nil }, CanonicalAddress: func(human string) (canonicalAddr []byte, usedGas uint64, err error) { + canonicalizeCost := types.CanonicalizeCost * types.GasMultiplier addr, err := sdk.AccAddressFromBech32(human) if err != nil { - return nil, 0, err + return nil, canonicalizeCost, err } - return addr, types.CanonicalizeCost * types.GasMultiplier, nil + return addr, canonicalizeCost, nil }, } } diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index 873093ec5..99bbb56cd 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -38,8 +38,6 @@ type MsgStoreCode struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` // WASMByteCode can be raw or gzip compressed WASMByteCode []byte `protobuf:"bytes,2,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty" yaml:"wasm_byte_code"` - // CodeID is optional - CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty" yaml:"code_id"` } func (m *MsgStoreCode) Reset() { *m = MsgStoreCode{} } @@ -670,67 +668,66 @@ func init() { func init() { proto.RegisterFile("terra/wasm/v1beta1/tx.proto", fileDescriptor_5834e4e1a84cce82) } var fileDescriptor_5834e4e1a84cce82 = []byte{ - // 952 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x41, 0x6f, 0xe3, 0x44, + // 944 bytes of a gzipped FileDescriptorProto + 0x1f,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 0xff, 0xfa, 0xdf, 0x2a, 0xed, 0xd6, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1063,11 +1060,6 @@ func (m *MsgStoreCode) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.CodeID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x18 - } if len(m.WASMByteCode) > 0 { i -= len(m.WASMByteCode) copy(dAtA[i:], m.WASMByteCode) @@ -1597,9 +1589,6 @@ func (m *MsgStoreCode) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.CodeID != 0 { - n += 1 + sovTx(uint64(m.CodeID)) - } return n } @@ -1925,25 +1914,6 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { m.WASMByteCode = []byte{} } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])