@@ -25,18 +25,19 @@ import (
25
25
26
26
func (n * NodeConfig ) StoreWasmCode (wasmFile , from string ) {
27
27
n .LogActionF ("storing wasm code from file %s" , wasmFile )
28
- cmd := []string {"terrad" , "tx" , "wasm" , "store" , wasmFile , fmt .Sprintf ("--from=%s" , from )}
28
+ cmd := []string {"terrad" , "tx" , "wasm" , "store" , wasmFile , fmt .Sprintf ("--from=%s" , from ), "--fees=10uluna" , "--gas=2000000" }
29
29
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
30
30
require .NoError (n .t , err )
31
31
n .LogActionF ("successfully stored" )
32
32
}
33
33
34
- func (n * NodeConfig ) InstantiateWasmContract (codeID , initMsg , amount , from string ) {
34
+ func (n * NodeConfig ) InstantiateWasmContract (codeID , initMsg , amount , from string , gasLimit string , fees sdk. Coins ) {
35
35
n .LogActionF ("instantiating wasm contract %s with %s" , codeID , initMsg )
36
36
cmd := []string {"terrad" , "tx" , "wasm" , "instantiate" , codeID , initMsg , fmt .Sprintf ("--from=%s" , from ), "--no-admin" , "--label=ratelimit" }
37
37
if amount != "" {
38
38
cmd = append (cmd , fmt .Sprintf ("--amount=%s" , amount ))
39
39
}
40
+ cmd = append (cmd , "--gas" , gasLimit , "--fees" , fees .String ())
40
41
n .LogActionF (strings .Join (cmd , " " ))
41
42
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
42
43
@@ -45,35 +46,28 @@ func (n *NodeConfig) InstantiateWasmContract(codeID, initMsg, amount, from strin
45
46
n .LogActionF ("successfully initialized" )
46
47
}
47
48
48
- func (n * NodeConfig ) Instantiate2WasmContract (codeID , initMsg , salt , amount , fee , gas , from string ) {
49
+ func (n * NodeConfig ) Instantiate2WasmContract (codeID , initMsg , salt , amount , from string , gasLimit string , fees sdk. Coins ) {
49
50
n .LogActionF ("instantiating wasm contract %s with %s" , codeID , initMsg )
50
51
encodedSalt := make ([]byte , hex .EncodedLen (len ([]byte (salt ))))
51
52
hex .Encode (encodedSalt , []byte (salt ))
52
53
cmd := []string {"terrad" , "tx" , "wasm" , "instantiate2" , codeID , initMsg , string (encodedSalt ), fmt .Sprintf ("--from=%s" , from ), "--no-admin" , "--label=ratelimit" }
53
54
if amount != "" {
54
55
cmd = append (cmd , fmt .Sprintf ("--amount=%s" , amount ))
55
56
}
56
- if fee != "" {
57
- cmd = append (cmd , fmt .Sprintf ("--fees=%s" , fee ))
58
- }
59
- if gas != "" {
60
- cmd = append (cmd , fmt .Sprintf ("--gas=%s" , gas ))
61
- }
57
+ cmd = append (cmd , "--gas" , gasLimit , "--fees" , fees .String ())
62
58
n .LogActionF (strings .Join (cmd , " " ))
63
59
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
64
60
require .NoError (n .t , err )
65
61
n .LogActionF ("successfully initialized" )
66
62
}
67
63
68
- func (n * NodeConfig ) WasmExecute (contract , execMsg , amount , fee , from string ) {
64
+ func (n * NodeConfig ) WasmExecute (contract , execMsg , amount , from string , gasLimit string , fees sdk. Coins ) {
69
65
n .LogActionF ("executing %s on wasm contract %s from %s" , execMsg , contract , from )
70
66
cmd := []string {"terrad" , "tx" , "wasm" , "execute" , contract , execMsg , fmt .Sprintf ("--from=%s" , from )}
71
67
if amount != "" {
72
68
cmd = append (cmd , fmt .Sprintf ("--amount=%s" , amount ))
73
69
}
74
- if fee != "" {
75
- cmd = append (cmd , fmt .Sprintf ("--fees=%s" , fee ))
76
- }
70
+ cmd = append (cmd , "--gas" , gasLimit , "--fees" , fees .String ())
77
71
n .LogActionF (strings .Join (cmd , " " ))
78
72
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
79
73
require .NoError (n .t , err )
@@ -124,6 +118,7 @@ func (n *NodeConfig) SubmitAddBurnTaxExemptionAddressProposal(addresses []string
124
118
"add-burn-tax-exemption-address" , strings .Join (addresses , "," ),
125
119
"--title=\" burn tax exemption address\" " ,
126
120
"--description=\" \" burn tax exemption address" ,
121
+ "--gas" , "300000" , "--gas-prices" , "1uluna" ,
127
122
fmt .Sprintf ("--from=%s" , walletName ),
128
123
}
129
124
@@ -152,7 +147,7 @@ func (n *NodeConfig) FailIBCTransfer(from, recipient, amount string) {
152
147
func (n * NodeConfig ) SendIBCTransfer (from , recipient , amount , memo string ) {
153
148
n .LogActionF ("IBC sending %s from %s to %s. memo: %s" , amount , from , recipient , memo )
154
149
155
- cmd := []string {"terrad" , "tx" , "ibc-transfer" , "transfer" , "transfer" , "channel-0" , recipient , amount , fmt .Sprintf ("--from=%s" , from ), "--memo" , memo }
150
+ cmd := []string {"terrad" , "tx" , "ibc-transfer" , "transfer" , "transfer" , "channel-0" , recipient , amount , fmt .Sprintf ("--from=%s" , from ), "--memo" , memo , "--fees=10uluna" }
156
151
157
152
_ , _ , err := n .containerManager .ExecTxCmdWithSuccessString (n .t , n .chainID , n .Name , cmd , "\" code\" :0" )
158
153
require .NoError (n .t , err )
@@ -171,15 +166,15 @@ func (n *NodeConfig) SubmitTextProposal(text string, initialDeposit sdk.Coin) {
171
166
func (n * NodeConfig ) DepositProposal (proposalNumber int ) {
172
167
n .LogActionF ("depositing on proposal: %d" , proposalNumber )
173
168
deposit := sdk .NewCoin (initialization .TerraDenom , sdk .NewInt (20 * assets .MicroUnit )).String ()
174
- cmd := []string {"terrad" , "tx" , "gov" , "deposit" , fmt .Sprintf ("%d" , proposalNumber ), deposit , "--from=val" }
169
+ cmd := []string {"terrad" , "tx" , "gov" , "deposit" , fmt .Sprintf ("%d" , proposalNumber ), deposit , "--from=val" , "--gas" , "300000" , "--fees" , "10000000uluna" }
175
170
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
176
171
require .NoError (n .t , err )
177
172
n .LogActionF ("successfully deposited on proposal %d" , proposalNumber )
178
173
}
179
174
180
175
func (n * NodeConfig ) VoteYesProposal (from string , proposalNumber int ) {
181
176
n .LogActionF ("voting yes on proposal: %d" , proposalNumber )
182
- cmd := []string {"terrad" , "tx" , "gov" , "vote" , fmt .Sprintf ("%d" , proposalNumber ), "yes" , fmt .Sprintf ("--from=%s" , from )}
177
+ cmd := []string {"terrad" , "tx" , "gov" , "vote" , fmt .Sprintf ("%d" , proposalNumber ), "yes" , fmt .Sprintf ("--from=%s" , from ), "--gas" , "300000" , "--fees" , "10000000uluna" }
183
178
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
184
179
require .NoError (n .t , err )
185
180
n .LogActionF ("successfully voted yes on proposal %d" , proposalNumber )
@@ -216,44 +211,45 @@ func extractProposalIDFromResponse(response string) (int, error) {
216
211
return proposalID , nil
217
212
}
218
213
219
- func (n * NodeConfig ) BankSend (amount string , sendAddress string , receiveAddress string ) {
220
- n .BankSendWithWallet (amount , sendAddress , receiveAddress , "val" )
214
+ func (n * NodeConfig ) BankSend (amount string , sendAddress string , receiveAddress string , gasLimit string , fees sdk. Coins ) {
215
+ n .BankSendWithWallet (amount , sendAddress , receiveAddress , "val" , gasLimit , fees )
221
216
}
222
217
223
- func (n * NodeConfig ) BankSendWithWallet (amount string , sendAddress string , receiveAddress string , walletName string ) {
218
+ func (n * NodeConfig ) BankSendWithWallet (amount string , sendAddress string , receiveAddress string , walletName string , gasLimit string , fees sdk. Coins ) {
224
219
n .LogActionF ("bank sending %s from address %s to %s" , amount , sendAddress , receiveAddress )
225
220
cmd := []string {"terrad" , "tx" , "bank" , "send" , sendAddress , receiveAddress , amount , fmt .Sprintf ("--from=%s" , walletName )}
221
+ cmd = append (cmd , "--fees" , fees .String (), "--gas" , gasLimit )
226
222
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
227
223
require .NoError (n .t , err )
228
224
n .LogActionF ("successfully sent bank sent %s from address %s to %s" , amount , sendAddress , receiveAddress )
229
225
}
230
226
231
- func (n * NodeConfig ) BankSendFeeGrantWithWallet (amount string , sendAddress string , receiveAddress string , feeGranter string , walletName string ) {
227
+ func (n * NodeConfig ) BankSendFeeGrantWithWallet (amount string , sendAddress string , receiveAddress string , feeGranter string , walletName string , gasLimit string , fees sdk. Coins ) {
232
228
n .LogActionF ("bank sending %s from address %s to %s" , amount , sendAddress , receiveAddress )
233
229
cmd := []string {"terrad" , "tx" , "bank" , "send" , sendAddress , receiveAddress , amount , fmt .Sprintf ("--fee-granter=%s" , feeGranter ), fmt .Sprintf ("--from=%s" , walletName )}
230
+ cmd = append (cmd , "--fees" , fees .String (), "--gas" , gasLimit )
234
231
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
235
232
require .NoError (n .t , err )
236
233
237
234
n .LogActionF ("successfully sent bank sent %s from address %s to %s" , amount , sendAddress , receiveAddress )
238
235
}
239
236
240
- func (n * NodeConfig ) BankMultiSend (amount string , split bool , sendAddress string , receiveAddresses ... string ) {
237
+ func (n * NodeConfig ) BankMultiSend (amount string , split bool , sendAddress string , gasLimit string , fees sdk. Coins , receiveAddresses ... string ) {
241
238
n .LogActionF ("bank multisending from %s to %s" , sendAddress , strings .Join (receiveAddresses , "," ))
242
239
cmd := []string {"terrad" , "tx" , "bank" , "multi-send" , sendAddress }
243
240
cmd = append (cmd , receiveAddresses ... )
244
- cmd = append (cmd , amount , "--from=val" )
241
+ cmd = append (cmd , amount , "--from=val" , "--fees" , fees . String (), "--gas" , gasLimit )
245
242
if split {
246
243
cmd = append (cmd , "--split" )
247
244
}
248
-
249
245
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
250
246
require .NoError (n .t , err )
251
247
n .LogActionF ("successfully multisent %s to %s" , sendAddress , strings .Join (receiveAddresses , "," ))
252
248
}
253
249
254
250
func (n * NodeConfig ) GrantAddress (granter , gratee string , spendLimit string , walletName string ) {
255
251
n .LogActionF ("granting for address %s" , gratee )
256
- cmd := []string {"terrad" , "tx" , "feegrant" , "grant" , granter , gratee , fmt .Sprintf ("--from=%s" , walletName ), fmt .Sprintf ("--spend-limit=%s" , spendLimit )}
252
+ cmd := []string {"terrad" , "tx" , "feegrant" , "grant" , granter , gratee , fmt .Sprintf ("--from=%s" , walletName ), fmt .Sprintf ("--spend-limit=%s" , spendLimit ), "--fees=10uluna" }
257
253
_ , _ , err := n .containerManager .ExecTxCmd (n .t , n .chainID , n .Name , cmd )
258
254
require .NoError (n .t , err )
259
255
n .LogActionF ("successfully granted for address %s" , gratee )
0 commit comments