-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!(zoe): add method zcf.getInstance() #3353
Conversation
makeIssuerRecord(currencyKit.brand, currencyKit.issuer, { | ||
assetKind: AssetKind.NAT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the brace moved. It looks like the signature for makeIsuserRecord()
is still
* @param {Brand} brand
* @param {Issuer} issuer
* @param {DisplayInfo=} displayInfo
* @returns {IssuerRecord}
@@ -121,7 +128,8 @@ test('makeInstanceRecordStorage', async t => { | |||
// Add currency again, but call it "money" | |||
addIssuerToInstanceRecord( | |||
'Money', | |||
makeIssuerRecord(currencyKit.brand, currencyKit.issuer, AssetKind.NAT, { | |||
makeIssuerRecord(currencyKit.brand, currencyKit.issuer, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The brace here moved, too. I think the braces should surround decimalPlaces
to make a displayInfo
, and assetKind should be a separate third argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think so? The types were telling me that assetKind
should be a part of displayInfo
, which is the third argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind. I was reading the body of makeIssuerRecord()
(in issuerRecord.js
) and thought I was looking at the parameter list.
I was only looking at the def'n because AssetKind.NAT
moved from being the third param to being a part of the third param. Was the code previously broken? Why didn't tsc
catch it before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsc
doesn't cover the tests yet in Zoe
@@ -121,7 +128,8 @@ test('makeInstanceRecordStorage', async t => { | |||
// Add currency again, but call it "money" | |||
addIssuerToInstanceRecord( | |||
'Money', | |||
makeIssuerRecord(currencyKit.brand, currencyKit.issuer, AssetKind.NAT, { | |||
makeIssuerRecord(currencyKit.brand, currencyKit.issuer, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind. I was reading the body of makeIssuerRecord()
(in issuerRecord.js
) and thought I was looking at the parameter list.
I was only looking at the def'n because AssetKind.NAT
moved from being the third param to being a part of the third param. Was the code previously broken? Why didn't tsc
catch it before?
50b7c00
to
afbd305
Compare
Closes #3330
Adds a method to zcf:
getInstance()
. This allows the contract code to easily get its own instance, in order to send elsewhere.