regenerated contract schema and made the migration data optional

This commit is contained in:
Jędrzej Stuczyński
2024-10-09 15:03:34 +01:00
parent ae30b0d803
commit 1f089ca6ad
6 changed files with 113 additions and 6 deletions
@@ -804,5 +804,5 @@ impl AffectedNode {
#[cw_serde]
pub struct MigrateMsg {
pub vesting_contract_address: Option<String>,
pub fix_nodes: Vec<AffectedNode>,
pub fix_nodes: Option<Vec<AffectedNode>>,
}
@@ -2150,7 +2150,7 @@
"minimum": 0.0
},
"owner": {
"description": "The address of the owner of the the mixnodes used for the query.",
"description": "The address of the owner of the mixnodes used for the query.",
"type": "string"
},
"start_after": {
@@ -2961,6 +2961,15 @@
"title": "MigrateMsg",
"type": "object",
"properties": {
"fix_nodes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/AffectedNode"
}
},
"vesting_contract_address": {
"type": [
"string",
@@ -2968,7 +2977,50 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"definitions": {
"AffectedDelegator": {
"type": "object",
"required": [
"address",
"missing_ratio"
],
"properties": {
"address": {
"type": "string"
},
"missing_ratio": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
},
"AffectedNode": {
"type": "object",
"required": [
"delegators",
"mix_id"
],
"properties": {
"delegators": {
"type": "array",
"items": {
"$ref": "#/definitions/AffectedDelegator"
}
},
"mix_id": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
},
"additionalProperties": false
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
}
}
},
"sudo": null,
"responses": {
+53 -1
View File
@@ -3,6 +3,15 @@
"title": "MigrateMsg",
"type": "object",
"properties": {
"fix_nodes": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/AffectedNode"
}
},
"vesting_contract_address": {
"type": [
"string",
@@ -10,5 +19,48 @@
]
}
},
"additionalProperties": false
"additionalProperties": false,
"definitions": {
"AffectedDelegator": {
"type": "object",
"required": [
"address",
"missing_ratio"
],
"properties": {
"address": {
"type": "string"
},
"missing_ratio": {
"$ref": "#/definitions/Decimal"
}
},
"additionalProperties": false
},
"AffectedNode": {
"type": "object",
"required": [
"delegators",
"mix_id"
],
"properties": {
"delegators": {
"type": "array",
"items": {
"$ref": "#/definitions/AffectedDelegator"
}
},
"mix_id": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
},
"additionalProperties": false
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
}
}
}
+1 -1
View File
@@ -438,7 +438,7 @@
"minimum": 0.0
},
"owner": {
"description": "The address of the owner of the the mixnodes used for the query.",
"description": "The address of the owner of the mixnodes used for the query.",
"type": "string"
},
"start_after": {
+3 -1
View File
@@ -558,7 +558,9 @@ pub fn migrate(
let mut response = Response::new();
queued_migrations::restore_vested_delegations(&mut response, deps, env, msg.fix_nodes)?;
if let Some(nodes_to_fix) = msg.fix_nodes {
queued_migrations::restore_vested_delegations(&mut response, deps, env, nodes_to_fix)?;
}
Ok(response)
}
@@ -108,6 +108,7 @@ impl NetworkManager {
) -> Result<nym_mixnet_contract_common::MigrateMsg, NetworkManagerError> {
Ok(nym_mixnet_contract_common::MigrateMsg {
vesting_contract_address: Some(ctx.network.contracts.vesting.address()?.to_string()),
fix_nodes: None,
})
}