Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dabi/builtins/types/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class TCaseType(dABIType):
smart_contract = {
'workchain': -1,
'shard': MASTER_SHARD,
'seqno': None
'seqno': None,
'timestamp': None,
}

address = None
Expand Down Expand Up @@ -180,6 +181,7 @@ def parse(self, data):
raise ValueError('TestCaseType: mc_seqno must be int')

self.smart_contract['seqno'] = data['smart_contract']['block']['mc_seqno']
self.smart_contract['timestamp'] = data['smart_contract']['block'].get('timestamp', datetime.now())

if 'name' not in data['smart_contract'] or not isinstance(data['smart_contract']['name'], str):
raise ValueError('TestCaseType: name must be in smart_contract (name of label.smart_contract to test)')
Expand Down Expand Up @@ -285,7 +287,7 @@ def get_tvm(self):
config = self.client.get_config_all(block)

c7 = C7(
time=datetime.now(),
time=self.smart_contract['timestamp'],
balance_grams=account_state.storage.balance.grams.amount.value,
address=self.address,
my_code=code,
Expand Down
39 changes: 39 additions & 0 deletions schema/interfaces/ethena/tsusde_vault.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: dabi/v0
type: Interface
metadata:
name: "tsUSDe Vault"
labels:
name: tsusde_vault
dton_parse_prefix: abi_tsusde_vault_
spec:
get_methods:
- method_name: getMintNanos
result:
- type: Int
labels:
name: mint_nanos
dton_type: UInt256

- method_name: getUnvestedAmount
result:
- type: Int
labels:
name: unvested_amount
dton_type: UInt256

- method_name: getTotalAssets
result:
- type: Int
labels:
name: total_assets
dton_type: UInt256

- method_name: getTotalShares
result:
- type: Int
labels:
name: total_shares
dton_type: UInt256

selector:
by_methods: true
22 changes: 22 additions & 0 deletions schema/tests/ethena/tsusde_vault.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: dabi/v0
type: TestCase
smart_contract:
name: tsusde_vault
address: "EQChGuD1u0e7KUWHH5FaYh_ygcLXhsdG2nSHPXHW8qqnpZXW"
block:
mc_seqno: 54216500
timestamp: 1763721008
parsed_info:
get_methods:
getMintNanos:
result:
- mint_nanos: 35000000
getUnvestedAmount:
result:
- unvested_amount: 1567273233
getTotalAssets:
result:
- total_assets: 8623626668626
getTotalShares:
result:
- total_shares: 6832825700362
Loading