Skip to content
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

put delegations into escrow account metadata #62

Merged
merged 2 commits into from
Oct 5, 2020

Conversation

pro-wh
Copy link
Collaborator

@pro-wh pro-wh commented Oct 2, 2020

for #61

This takes an unsophisticated approach. Load the delegations and debonding delegations from the existing staking API and put them into the metadata area under new keys. The format that they're in is fine as is.

Also add info about the breakdown of the escrow balance into active and debonding pools and info about the shares.

A preview, where the test entity has delegated 2,000 base units to the testing destination account:

The test entity's (oasis1qzzd6khm3acqskpxlk9vd5044cmmcce78y5l6000) escrow account

{
    "block_identifier": {
        "index": 175, 
        "hash": "8472f4494618356dcfa346a52c1f15f90277470409977018b4f11134c0908715"
    }, 
    "balances": [
        {
            "value": "100000000000", 
            "currency": {
                "symbol": "ROSE", 
                "decimals": 9
            }
        }
    ], 
    "metadata": {
        "active_balance": "100000000000", 
        "active_shares": "1", 
        "debonding_balance": "0", 
        "debonding_delegations": { }, 
        "debonding_shares": "0", 
        "delegations": {
            "oasis1qpkant39yhx59sagnzpc8v0sg8aerwa3jyqde3ge": {
                "shares": "2000"
            }, 
            "oasis1qzzd6khm3acqskpxlk9vd5044cmmcce78y5l6000": {
                "shares": "1"
            }
        }, 
        "nonce": 2
    }
}

The testing destination (oasis1qpkant39yhx59sagnzpc8v0sg8aerwa3jyqde3ge) escrow account

{
    "block_identifier": {
        "index": 175, 
        "hash": "8472f4494618356dcfa346a52c1f15f90277470409977018b4f11134c0908715"
    }, 
    "balances": [
        {
            "value": "2000", 
            "currency": {
                "symbol": "ROSE", 
                "decimals": 9
            }
        }
    ], 
    "metadata": {
        "active_balance": "2000", 
        "active_shares": "2000", 
        "debonding_balance": "0", 
        "debonding_delegations": { }, 
        "debonding_shares": "0", 
        "delegations": { }, 
        "nonce": 0
    }
}

@pro-wh pro-wh requested review from kostko and abukosek October 2, 2020 23:15
@pro-wh pro-wh requested a review from peterjgilbert as a code owner October 2, 2020 23:15
@pro-wh pro-wh merged commit 4220c17 into master Oct 5, 2020
@pro-wh pro-wh deleted the pro-wh/feature/escrowmeta branch October 5, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants