Skip to content

Commit

Permalink
fix test 1/n
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Sep 17, 2024
1 parent c0e2182 commit 59887a3
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions ignite/pkg/cosmosclient/cosmosclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ func TestClientCreateTx(t *testing.T) {
{
name: "ok: with default values",
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
},
Expand All @@ -447,13 +447,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithUseFaucet("localhost:1234", "", 0),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectMakeSureAccountHasToken(sdkaddr.String(), defaultFaucetMinAmount)

Expand All @@ -466,13 +466,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithUseFaucet("localhost:1234", "", 0),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectMakeSureAccountHasToken(sdkaddr.String(), defaultFaucetMinAmount-1)
s.expectPrepareFactory(sdkaddr)
Expand All @@ -484,13 +484,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithFees("10token"),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"token","amount":"10"}],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"token","amount":"10"}],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
},
Expand All @@ -502,13 +502,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithGasPrices("3token"),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"token","amount":"900000"}],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"token","amount":"900000"}],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
},
Expand All @@ -521,8 +521,8 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithGasAdjustment(2.1),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
Expand All @@ -538,13 +538,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithGas(""),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"20042","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"20042","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
s.gasometer.EXPECT().
Expand All @@ -558,13 +558,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithGas("auto"),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"20042","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"20042","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
s.gasometer.EXPECT().
Expand All @@ -578,13 +578,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithGasAdjustment(2.4),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"300000","payer":"","granter":""},"tip":null},"signatures":[]}`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
},
Expand All @@ -596,13 +596,13 @@ func TestClientCreateTx(t *testing.T) {
cosmosclient.WithGasAdjustment(0),
},
msg: &banktypes.MsgSend{
FromAddress: "from",
ToAddress: "to",
FromAddress: "cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x",
ToAddress: "cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv",
Amount: sdktypes.NewCoins(
sdktypes.NewCoin("token", math.NewIntFromUint64(1)),
),
},
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"from","to_address":"to","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"20042","payer":"","granter":""},"tip":null},"signatures":[]}
expectedJSONTx: `{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1aew8dk9cs3uzzgeldatgzvm5ca2k4m98xhy20x","to_address":"cosmos1fhpcsxn0g8uask73xpcgwxlfxtuunn3ey5ptjv","amount":[{"denom":"token","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"0001-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"20042","payer":"","granter":""},"tip":null},"signatures":[]}
`,
setup: func(s suite) {
s.expectPrepareFactory(sdkaddr)
Expand Down

0 comments on commit 59887a3

Please sign in to comment.