diff --git a/util/issue_commands.go b/util/issue_commands.go index 907db8b..92c3fd9 100644 --- a/util/issue_commands.go +++ b/util/issue_commands.go @@ -13,7 +13,7 @@ func InitRDDLReissuanceProcess(ctx sdk.Context, proposerAddress string, blk_heig //blk_height := 0 //get_last_PoPBlockHeight() // TODO: to be read form the upcoming PoP-store // Construct the command - cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-proposal", hexProposerAddress, tx_unsigned, strconv.FormatInt(blk_height, 10)) + cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-proposal", proposerAddress, tx_unsigned, strconv.FormatInt(blk_height, 10)) // Start the command in a non-blocking way err = cmd.Start() @@ -27,7 +27,7 @@ func InitRDDLReissuanceProcess(ctx sdk.Context, proposerAddress string, blk_heig func SendRDDLReissuanceResult(ctx sdk.Context, proposerAddress string, txID string, blk_height uint64) error { // Construct the command - cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-result", hexProposerAddress, txID, strconv.FormatInt(blk_height, 10)) + cmd := exec.Command("planetmint-god", "tx", "dao", "reissue-rddl-result", proposerAddress, txID, strconv.FormatUint(blk_height, 10)) // Start the command in a non-blocking way err := cmd.Start() diff --git a/x/dao/keeper/reissuance_test.go b/x/dao/keeper/reissuance_test.go new file mode 100644 index 0000000..5377cf3 --- /dev/null +++ b/x/dao/keeper/reissuance_test.go @@ -0,0 +1,35 @@ +package keeper_test + +import ( + "fmt" + "testing" + + keepertest "github.com/planetmint/planetmint-go/testutil/keeper" + "github.com/stretchr/testify/assert" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/planetmint/planetmint-go/x/dao/keeper" + "github.com/planetmint/planetmint-go/x/dao/types" +) + +func createNReissuance(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Reissuance { + items := make([]types.Reissuance, n) + for i := range items { + items[i].BlockHeight = uint64(i) + items[i].Proposer = fmt.Sprintf("proposer_%v", i) + items[i].Rawtx = fmt.Sprintf("rawtransaction_%v", i) + items[i].TxId = "" + keeper.StoreReissuance(ctx, items[i]) + } + return items +} + +func TestGetResponse(t *testing.T) { + keeper, ctx := keepertest.DaoKeeper(t) + items := createNChallenge(keeper, ctx, 10) + for _, item := range items { + challenge, found := keeper.GetChallenge(ctx, item.Height) + assert.True(t, found) + assert.Equal(t, item, challenge) + } +}