Skip to content

Commit

Permalink
fix: fix model for LiquidityPoolRemovedEffect (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitK89 authored Oct 1, 2022
1 parent 392edf9 commit d6ad27c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stellar_model/model/horizon/effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ class LiquidityPoolRemovedEffect(BaseEffect):
type_i: 94
"""

liquidity_pool: LiquidityPool
liquidity_pool_id: str


class LiquidityPoolClaimableAssetAmount(LiquidityPoolAssetAmount):
Expand Down
9 changes: 8 additions & 1 deletion tests/model/horizon/test_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,14 @@ def test_liquidity_pool_created(self):
)

def test_liquidity_pool_removed(self):
pass
raw_data = load_horizon_file("effects/liquidity_pool_removed.json")
parsed_data = LiquidityPoolRemovedEffect.parse_obj(raw_data)
self.assertEqual(parsed_data.id, "0179972298072752130-0000000002")
self.assertEqual(parsed_data.paging_token, "179972298072752130-2")
self.assertEqual(
parsed_data.liquidity_pool_id,
"89c11017d16552c152536092d7440a2cd4cf4bf7df2c7e7552b56e6bcac98d95",
)

def test_liquidity_pool_revoked(self):
pass
20 changes: 20 additions & 0 deletions tests/resources/model/horizon/effects/liquidity_pool_removed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"_links": {
"operation": {
"href": "https://ubiquity-fullnode-4-mainnet.stellar.bdnodes.net/operations/179972298072752130"
},
"succeeds": {
"href": "https://ubiquity-fullnode-4-mainnet.stellar.bdnodes.net/effects?order=desc&cursor=179972298072752130-2"
},
"precedes": {
"href": "https://ubiquity-fullnode-4-mainnet.stellar.bdnodes.net/effects?order=asc&cursor=179972298072752130-2"
}
},
"id": "0179972298072752130-0000000002",
"paging_token": "179972298072752130-2",
"account": "GBKM2YMDONW2XPZH5PJXVDFKC4U4AXRV4TZXP53YSAJPA6ZWGCJ7YGVZ",
"type": "liquidity_pool_removed",
"type_i": 94,
"created_at": "2022-07-24T12:40:09Z",
"liquidity_pool_id": "89c11017d16552c152536092d7440a2cd4cf4bf7df2c7e7552b56e6bcac98d95"
}

0 comments on commit d6ad27c

Please sign in to comment.