Skip to content

Commit

Permalink
feat: Register incentives and sponsorship amino message to support ei…
Browse files Browse the repository at this point in the history
…p712 (#1240)
  • Loading branch information
ItzhakBokris authored Sep 22, 2024
1 parent 045e6c3 commit bb2cd89
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
8 changes: 4 additions & 4 deletions scripts/incentives/lockup_bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/sh

echo "locking LP1 tokens for 2 weeks"
dymd tx lockup lock-tokens 50000000000000000000gamm/pool/1 --duration="60s" --from pools --keyring-backend=test -b block -y --gas-prices 100000000adym
dymd tx lockup lock-tokens 50000000000000000000gamm/pool/1 --duration="60s" --from pools --keyring-backend=test -b sync -y --gas-prices 100000000adym
sleep 7

echo "locking uatom tokens for 1h"
dymd tx lockup lock-tokens 500000000uatom --duration="3600s" --from user --keyring-backend=test -b block -y --gas-prices 100000000adym
dymd tx lockup lock-tokens 500000000uatom --duration="3600s" --from user --keyring-backend=test -b sync -y --gas-prices 100000000adym
sleep 7

echo "locking dym tokens for 1 day"
dymd tx lockup lock-tokens 100dym --duration="24h" --from user --keyring-backend=test -b block -y --gas-prices 100000000adym
dymd tx lockup lock-tokens 100dym --duration="24h" --from user --keyring-backend=test -b sync -y --gas-prices 100000000adym
sleep 7

echo "unlocking dym tokens"
dymd tx lockup begin-unlock-by-id 2 --from user --keyring-backend=test -b block -y --gas-prices 100000000adym
dymd tx lockup begin-unlock-by-id 2 --from user --keyring-backend=test -b sync -y --gas-prices 100000000adym
12 changes: 6 additions & 6 deletions scripts/pools/e2e.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

create_asset_pool() {
dymd tx gamm create-pool --pool-file=$1 --from pools --keyring-backend=test -b block --gas auto --yes --fees 1dym
dymd tx gamm create-pool --pool-file=$1 --from pools --keyring-backend=test -b sync --gas auto --yes --fees 1dym
}

# create pools and pool gauges
Expand All @@ -16,20 +16,20 @@ create_asset_pool "$(dirname "$0")/nativeDenomPoolB.json"
echo "====================="
streamer_addr=$(dymd q auth module-account streamer -o json | jq '.account.base_account.address' | tr -d '"')
echo "Sending 300000dym to $streamer_addr"
dymd tx bank send hub-user $streamer_addr 300000dym --keyring-backend test -b block -y --fees 1dym
dymd tx bank send hub-user $streamer_addr 300000dym --keyring-backend test -b sync -y --fees 1dym

# lock LP tokens
echo "====================="
echo "Locking LP tokens"
echo "locking LP1 tokens for 1 day"
dymd tx lockup lock-tokens 50000000000000000000gamm/pool/1 --duration="24h" --from pools --keyring-backend=test -b block -y --fees 1dym
dymd tx lockup lock-tokens 50000000000000000000gamm/pool/1 --duration="24h" --from pools --keyring-backend=test -b sync -y --fees 1dym
echo "locking LP2 tokens for 1 minute"
dymd tx lockup lock-tokens 50000000000000000000gamm/pool/2 --duration="1m" --from pools --keyring-backend=test -b block -y --fees 1dym
dymd tx lockup lock-tokens 50000000000000000000gamm/pool/2 --duration="1m" --from pools --keyring-backend=test -b sync -y --fees 1dym

# create new stream
echo "====================="
echo "Gov proposal for creating new stream with LP1 and LP2 as incentives targets"
dymd tx gov submit-legacy-proposal create-stream-proposal 1,2 40,60 10000dym --epoch-identifier minute --from hub-user -b block --title sfasfas --description ddasda --deposit 1dym -y --fees 1dym --gas auto
dymd tx gov submit-legacy-proposal create-stream-proposal 1,2 40,60 10000dym --epoch-identifier minute --from hub-user -b sync --title sfasfas --description ddasda --deposit 1dym -y --fees 1dym --gas auto

last_proposal_id=$(dymd q gov proposals -o json | jq '.proposals | map(.id | tonumber) | max')
dymd tx gov vote "$last_proposal_id" yes --from hub-user -b block -y --fees 1dym
dymd tx gov vote "$last_proposal_id" yes --from hub-user -b sync -y --fees 1dym
11 changes: 11 additions & 0 deletions x/incentives/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
)

var (
Expand All @@ -29,3 +30,13 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

func init() {
RegisterCodec(amino)
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
// used to properly serialize MsgGrant and MsgExec instances
sdk.RegisterLegacyAminoCodec(amino)
RegisterCodec(authzcodec.Amino)

amino.Seal()
}
13 changes: 13 additions & 0 deletions x/sponsorship/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
)

// RegisterCodec registers the necessary x/sponsorship interfaces and concrete types on the provided
Expand All @@ -25,3 +26,15 @@ func RegisterInterfaces(reg types.InterfaceRegistry) {
)
msgservice.RegisterMsgServiceDesc(reg, &_Msg_serviceDesc)
}

var Amino = codec.NewLegacyAmino()

func init() {
RegisterCodec(Amino)
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
// used to properly serialize MsgGrant and MsgExec instances
sdk.RegisterLegacyAminoCodec(Amino)
RegisterCodec(authzcodec.Amino)

Amino.Seal()
}

0 comments on commit bb2cd89

Please sign in to comment.