nearprotocol / assemblyscript

A TypeScript to WebAssembly compiler 🚀
https://assemblyscript.org
Apache License 2.0
8 stars 1 forks source link

Contract metadata #38

Closed bowenwang1996 closed 4 years ago

bowenwang1996 commented 5 years ago

Basic implementation of contract metadata described here.

DanielRX commented 5 years ago

Main thing I noticed that would keep the format, but reduce code size The current JSON is

viewMethods: {
    [methodName: string]: {
        name: string (methodName),
        parameters: {[key: string]: string},
        returnType: string
    }
}

by removing name: methodName, or converting viewMethods into an array, you reduce the size of the JSON by the total string length of all method names, and the name being duplicated doesn't serve any benefit to the developer

vgrichina commented 5 years ago

I agree that we don't really need name: string (methodName), part

bowenwang1996 commented 5 years ago

Yeah I'll change that