Skip to content

Commit

Permalink
feat: fee payer added
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Jan 20, 2023
1 parent c19b40c commit e4a3de3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions contracts/ibc_transfer/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ fn execute_send(
recv_fee: vec![],
ack_fee: vec![Coin::new(1000u128, "stake")],
timeout_fee: vec![Coin::new(1000u128, "stake")],
payer: None,
};
let coin1 = coin(amount, denom.clone());
let msg1 = NeutronMsg::IbcTransfer {
Expand Down
2 changes: 2 additions & 0 deletions contracts/neutron_interchain_txs/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ fn execute_delegate(
recv_fee: vec![],
ack_fee: vec![CosmosCoin::new(1000u128, "stake")],
timeout_fee: vec![CosmosCoin::new(1000u128, "stake")],
payer: None,
};
let (delegator, connection_id) = get_ica(deps.as_ref(), &env, &interchain_account_id)?;
let delegate_msg = MsgDelegate {
Expand Down Expand Up @@ -265,6 +266,7 @@ fn execute_undelegate(
recv_fee: vec![],
ack_fee: vec![CosmosCoin::new(1000u128, "stake")],
timeout_fee: vec![CosmosCoin::new(1000u128, "stake")],
payer: None,
};
let (delegator, connection_id) = get_ica(deps.as_ref(), &env, &interchain_account_id)?;
let delegate_msg = MsgUndelegate {
Expand Down
20 changes: 17 additions & 3 deletions packages/neutron-sdk/schema/neutron_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,15 @@
}
],
"definitions": {
"Addr": {
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
"type": "string"
},
"AdminProposal": {
"description": "AdminProposal defines the struct for various proposals which Neutron's Admin Module may accept.",
"oneOf": [
{
"description": "*param_change_proposal** is a parameter change proposal field.",
"description": "*ParamChangeProposal** is a parameter change proposal field.",
"type": "object",
"required": [
"param_change_proposal"
Expand All @@ -298,7 +302,7 @@
"additionalProperties": false
},
{
"description": "*software_upgrade_proposal** is a software upgrade proposal field.",
"description": "*SoftwareUpgradeProposal** is a software upgrade proposal field.",
"type": "object",
"required": [
"software_upgrade_proposal"
Expand All @@ -311,7 +315,7 @@
"additionalProperties": false
},
{
"description": "*cancel_software_upgrade_proposal** is a cancel software upgrade proposal field.",
"description": "*CancelSoftwareUpgradeProposal** is a cancel software upgrade proposal field.",
"type": "object",
"required": [
"cancel_software_upgrade_proposal"
Expand Down Expand Up @@ -376,6 +380,16 @@
"$ref": "#/definitions/Coin"
}
},
"payer": {
"anyOf": [
{
"$ref": "#/definitions/Addr"
},
{
"type": "null"
}
]
},
"recv_fee": {
"type": "array",
"items": {
Expand Down
3 changes: 2 additions & 1 deletion packages/neutron-sdk/src/bindings/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
NeutronError, NeutronResult,
};

use cosmwasm_std::{Coin, CosmosMsg, CustomMsg, StdError};
use cosmwasm_std::{Addr, Coin, CosmosMsg, CustomMsg, StdError};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json_wasm::to_string;
Expand All @@ -15,6 +15,7 @@ pub struct IbcFee {
pub recv_fee: Vec<Coin>,
pub ack_fee: Vec<Coin>,
pub timeout_fee: Vec<Coin>,
pub payer: Option<Addr>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
Expand Down

0 comments on commit e4a3de3

Please sign in to comment.