Ton-Dynasty / ticton-v0

Innovative price oracle for TON
https://ticton.xyz
7 stars 1 forks source link

test(Oracle.spec.ts): add test case for Issue 12 #13

Closed ipromise2324 closed 7 months ago

ipromise2324 commented 7 months ago

Issue12: Assume an existing alarm with ID 10, where both base_asset_scale and quote_asset_scale are set to 2. (remain_scale: 2) timeKeeper A invokes the wind method on alarm 10, reducing base_asset_scale to 1 and elevating quote_asset_scale to 3. (remain_scale: 1)

Subsequently, timeKeeper B also triggers the wind method for alarm 10, this time elevating base_asset_scale back to 2 and reducing quote_asset_scale to 2. (remain_scale: 0)

When timeKeeper C attempts to engage the wind method on alarm 10, the operation fails due to a remaining scale of 0.

After writing test about issue12, the operation fail as it should be.(Due to remain_scale of alarm10 is 0)