Morley client doesn't account for originated contracts in transfers
Description
When we make a transfer to a contract that has CREATE_CONTRACT
in it, we compute incorrect burn cap.
Steps to reproduce
morley-client originate --contract ../../../test.tz --initial-storage 'Unit' --from tz1XyaS3pWSQHrKxvnJ9Kmpk9PKgWWunYXzU
morley-client transfer --from tz1V8fDHpHzN8RrZqiYCHaJM9EocsYZch5Cy --to KT1Pbt55ZLTMWt44SAAVt28dRZxQsT5ub46c --parameter 'Unit'
You need to specify --from
address that have money and whose key is revealed. --to
should be the contract originated at (1).
Prerequisites (if needed):
# test.tz
storage unit;
parameter unit;
code { CAR;
PUSH mutez 0;
NONE key_hash;
CREATE_CONTRACT { parameter unit; storage unit; code { FAILWITH } };
DIP { DROP };
NIL operation; SWAP; CONS;
UNIT; SWAP; PAIR;
}
Expected behaviour
Transaction succeeds and prints the address of originated contracts.
I think it's a good idea to print addresses of contracts originated by CREATE_CONTRACT
.
Actual behaviour
morley-client: UnexpectedClientFailure 1 "Node is bootstrapped, ready for injecting operations.\n" "Fatal error:\n The operation will burn \42793\&0.289 which is higher than the configured burn cap (\42793\&0.032).\n Use `--burn-cap 0.289` to emit this operation.\n"
Environment
- Archlinux, built with cabal
- da19869e