Closed nikita-fuchs closed 3 years ago
"Same" thing happening also with Chain.clone:
contract Some_Other_Child_Contract =
entrypoint sayHi() =
"hello"
contract Identity =
record state = {
name: string,
surname: string,
idNumber: int
}
entrypoint init(name: string, surname: string, idNumber: int) =
{ name = name,
surname = surname,
idNumber = idNumber
}
entrypoint getIdentity() =
state
main contract IdentityService =
stateful entrypoint createNewIdentity(cloneFrom: Identity, name: string, surname: string, idNumber: int) =
let identity = Chain.clone(ref=cloneFrom, name, surname, idNumber) : Identity
identity.address
The problem is that the state type from the child contract leaks into the parent contract. Work-around: add
type state = unit
to the main contract.
Crashing on a saturday night: