You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: allow unhardened arg to sendBridgeAction (#11992)
_incidental_
## Description
ymax-planner hit an error,
```
Error in main: (Error#2)
Error#2: Cannot pass non-frozen objects like {
method: 'invokeEntry',
message: {
targetName: 'planner',
method: 'submit',
args: [ 0, [Array], 1, 0 ]
}
} . Use harden()
at Object.sendBridgeAction (packages/client-utils/dist/signing-smart-wallet-kit.js:32:56)
at startEngine (file:///Users/luqi/github/Agoric/agoric-sdk/services/ymax-planner/src/engine.ts:675:50)
at async main (file:///Users/luqi/github/Agoric/agoric-sdk/services/ymax-planner/src/main.ts:99:3)
```
I thought it was caused by #11986 but that `toCapData` call in `sendBridgeAction` wasn't changed. The function always required a hardened `action` param.
However I think that's unnecessary and worse ergonomically. The argument is almost always a literal, so the `harden()` is just clutter. This makes the function harden the arg itself. It could copy the arg to a new hardened one to pass to `toCapData` but I think it's reasonable to expect that the caller is okay with the hardening, and in most cases it won't matter at all because it's a literal.
### Security Considerations
If the caller doesn't trust `sendBridgeAction` they can opt into hardening before the call.
### Scaling Considerations
n/a
### Documentation Considerations
none
### Testing Considerations
updated tests
### Upgrade Considerations
none
0 commit comments