-
Notifications
You must be signed in to change notification settings - Fork 119
/
dispensation_multi.go
32 lines (27 loc) · 1.17 KB
/
dispensation_multi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
dispensationtypes "github.com/Sifchain/sifnode/x/dispensation/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/tendermint/tendermint/crypto"
)
type CreateDispensationMultiTx struct{} //nolint
func (CreateDispensationMultiTx) GetMsgAndArgs(_ CommonArgs) (sdk.Msg, Args) {
args := getDispensationTxArgs()
amount, ok := sdk.NewIntFromString("10000000000000000000")
if !ok {
panic("Failed to get amount")
}
address := sdk.AccAddress(crypto.AddressHash([]byte("Output")))
coinRowan := sdk.NewCoins(sdk.NewCoin("rowan", amount))
coinCeth := sdk.NewCoins(sdk.NewCoin("ceth", amount))
output := []types.Output{types.NewOutput(address, coinCeth), types.NewOutput(address, coinRowan)}
createDispensation := dispensationtypes.NewMsgCreateDistribution(args.Sender, dispensationtypes.DistributionType_DISTRIBUTION_TYPE_VALIDATOR_SUBSIDY, output, args.Sender.String())
return &createDispensation, args
}
func (CreateDispensationMultiTx) GetName() string {
return "CREATE-DISPENSATION"
}
func (s CreateDispensationMultiTx) Assert(response *sdk.TxResponse, _ *CommonArgs) {
defaultAssert(response, s.GetName())
}