Skip to content
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

Getting issue while using model #565

Open
Dimple-Kanwar opened this issue May 27, 2021 · 3 comments
Open

Getting issue while using model #565

Dimple-Kanwar opened this issue May 27, 2021 · 3 comments

Comments

@Dimple-Kanwar
Copy link

Dimple-Kanwar commented May 27, 2021

Hi,
I am getting `Error:

{ "index" : 0 }

` message from frontend but when I run the same function from cli, it is working fine.

sample Code:
Model.ts

 @nearBindgen
 export class Test 

 { id: i32; borrowAmount: i64; updatedAt: u128; borrower: string; lender: string; isEntity: bool; } 

part of function in Main.ts

 let tests = new PersistentMap<i32, Test>("t:");

let test: Test = 

 { id, borrowAmount, updatedAt, borrower,lender: Context.sender isEntity: true } 

logging.log(test); // error line

tests.set(id, test);

I tried converting this model into a proper class format with constructor but it's still giving me same error.

@willemneal
Copy link
Contributor

Do you have a link to the repo in question? Is this error in the log on the front end or is the whole call return this error?

@Dimple-Kanwar
Copy link
Author

this exception is getting thrown from this call to frontend.

@willemneal
Copy link
Contributor

@Dimple-Kanwar I still don't have enough context, for example, what is the method that is exported? Do you have any other source code you could share?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants