Closed xbhuang1994 closed 6 years ago
var BankVaultContract = function () { LocalContractStorage.defineMapProperty(this, "userArray", null); ... init: function () { this.userArray = []; Test result:
var BankVaultContract = function () { LocalContractStorage.defineMapProperty(this, "userArray", null);
init: function () { this.userArray = [];
{"result":"TypeError: Cannot set property userArray of # which has only a getter","execute_err":"Deploy: TypeError: Cannot set property userArray of # which has only a getter","estimate_gas":"25648"}
Where am I wrong?
I found the problem, you should use defineProperty instead of defineMapProperty
@xbhuang1994 Congrats!
var BankVaultContract = function () { LocalContractStorage.defineMapProperty(this, "userArray", null);
...init: function () { this.userArray = [];
Test result:{"result":"TypeError: Cannot set property userArray of #
Where am I wrong?