filecoin
filecoin copied to clipboard
State reloading pattern for receiver hooks
I don't know if it's a good idea for the library code to be doing this instead of handling state loading on the user implementation side (like we're doing for fungible tokens). It'll be ok for now since it's going into a dev branch but I think it'll cause problems in actor code that carries additional state of its own beyond the NFTState
It does open up one easy optimisation though: we can pass through the original MintReturn
data in the intermediate struct and simply return that if there's no change once the hook call completes. I've been playing with the idea here (sending original data) and here (trying to centralise the 'has state changed' check) for the fungible token
Originally posted by @abright in https://github.com/helix-onchain/filecoin/pull/138#discussion_r1002801864