Exemple #1
0
 def get_account_resource_or_default(cls, blob):
     if blob:
         omap = AccountState.deserialize(blob.blob).ordered_map
         resource = omap[AccountConfig.account_resource_path()]
         return cls.deserialize(resource)
     else:
         return cls()
def test_resource_access_vec():
    array = AccessPath.resource_access_vec(AccountConfig.account_struct_tag(),
                                           [])
    assert bytes(array) == AccountConfig.account_resource_path()
Exemple #3
0
 def get_resource(self):
     resource = self.ordered_map[AccountConfig.account_resource_path()]
     if resource:
         return AccountResource.deserialize(resource)
     else:
         return None