-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chain release2.9 compatibility Grace Period and overdue #3387
base: development
Are you sure you want to change the base?
Conversation
- a method to get NU billing information - a method to get contract payment state - a method to get used resources by the node contract - some related interfaces
- use proxy url in unlockMycontracts - refactor unlockContracts to accept array of contracts - add function to unlock contracts by their ids
- add function that takes only contract to unlock it - add calculate overdue functions
- add contracts on rented node to the rent node overdue
it is storing the rent contract on a map by the node id, and ignore the unwanted calculations
unlock dialog now will check if the node contract on rented node or not; if so will retrive the rent contract cost and store the and will avoid duplication
…d with selected contracts
@0oM4R I attempted a quick test, but it didn't go well. |
Another point, it seems you haven't incorporated the changes discussed in the tg group yet.
|
…into development_chain_release2.9
there is a separate issue for it #3400 |
works fine with me but we should handle the zero tft case in the ui
|
Sorry, My bad. |
Calculations looks much better now. |
…rting cost per second
skip the node contracts on rented nodes as it already calculated in rent contract
we were ignoring the elapsed seconds for node contracts and we assume that it is the same as rent contract
Description
We have new accurate way to resume/unlock contracts on tfchain2.9, this pull request is for replace the old way as it is no longer supported.
General idea:
Now the amount required to resume the contract is described as Overdue.
The overdue amount basically is the sum of three parts:
Changes
Please node: you may notice that we have multiple functions that generally do the same thing but require different arguments.
for example: we need some information that is already in the contract type,
so instead of requesting the contract in side the function we are passing it.
but in some cases we only have the contract id? we provide a function that take the contract id and then request the contract then pass it to the inner function.
TFChain client
Grid client:
Dashboard
support new functions in grid client, refactor, and remove the deprecated gird client functions.
we have some changes in the flow:
If the user select node contracts, and some of them are on a rent contract, we will show the rent contract id with the selected contracts
if use click on grace period chip of node contract with ipv4 on rented node the content of the dialog depends on the rent contract state:
if the rent contract state is
Created
: will get the node contract overdue, and user will be able to unlock the contract.If on
Grace period
: will show a message that you will have to check the rent contract and unlock it.fix loading spinner in loading locked amount details:
Related Issues
#3340
#3364
Tested Scenarios
show contract/s cost : this will be nearly from pricing calculator if the contract got billed right before moving to the grace period as in this case overdue will be small for example, name contract cost should be about
0.025
tftsselect node contracts on rented node that its contract on grace period,
unlock all contracts associated with rent contract: in this case to verify that the node contract got billed, use
smarContractModule/contractPaymentState
call, the additional and standred overdraft should be 0Unlock single or multiple contracts
in any case we should'n have a contract got billed twice: you can add log line to log the ids in batchUnlock contracts
Tips:
To send contract to a grace period, you need to follow some steps
1- empty you walet, this can be done by polkadot UI
Balances/TransferAll
2- get the contract Id, must be billable one like rent contract or node contract on shared node, name contract, and call
smarContractsModule/billcontractForBlock
using any other funded account.to send node contract with public ip on rented node to grace period and keep it's rent contract is on created state
Documentation PR
For UI changes, Please provide the Documetation PR on info_grid
Checklist