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: Register incentives and sponsorship amino message to support eip712 #1240

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
}
Loading