contracting icon indicating copy to clipboard operation
contracting copied to clipboard

ForeignHash does not consider 'default_value' of original Hash

Open Endogen opened this issue 3 years ago • 0 comments

Describe the bug Defining a ForeignHash in a contract doesn't take in account the default_value of the original Hash.

To Reproduce Steps to reproduce the behavior:

  1. Create a new contract and define a ForeignHash. For example:
tau_balances = ForeignHash(foreign_contract='currency', foreign_name='balances')
  1. Retrieve a value that does NOT exist:
some_value = tau_balances["this does not exist"]

Expected behavior Variable some_value should be 0 since the original Hash was defined with default_value=0 but it's None

Endogen avatar Feb 28 '22 21:02 Endogen