Conversation
|
I'm already working on this |
|
Can we merged this though? It is done, just needs to be reviewed :) |
|
It seems |
|
I'll review |
|
@MaxGraey good to know, what are the differences? Would |
|
@axic |
| export declare function selfDestruct(addressOffset: usize): void; | ||
|
|
||
| @external("debug", "print32") | ||
| export declare function print32(value: i32): void; |
There was a problem hiding this comment.
Just note
instead repeated @external("debug", "...") you can simplified and grouped this to:
export declare namespace debug {
function print32(value: i32): void;
function print64(value: i64): void;
function printMem(dataOffset: usize, length: i32): void;
function printMemHex(dataOffset: usize, length: i32): void;
...
}this behave and generate exactly the same as "atomic" external decorator.
But required call like this: debug.print32(0x80). So if this not what you want leave this as is
There was a problem hiding this comment.
Another option could be to move all of the debug functions to a file named debug.ts, and rexport its elements from lib/ethereum.ts. By default, the file name without extension is used as the import's module name. If debug.ts resides within lib/, it's not necessary to re-export its elements because standard library exports become globals by default.
Thanks @MaxGraey that is good to know. Unfortunately in this case it seems However, perhaps the cleanest way is to force compilation for 32-bit targets only. Is there a way to do that? |
|
Currently wasm support only 32-bit addressing mode. This may change in the future (but there are opinions that it is not in such a near future and will require explicit flag). Anyway unsigned type definitely better for reflect pointer type. AS internally always use |
|
|
||
| export declare function getTxOrigin(resultOffset: usize): void; | ||
|
|
||
| export declare function log(dataOffset: usize, length: i32, numberOfTopics: i32, topic1: i32, topic2: i32, topic3: i32, topic4: i32): void; |
There was a problem hiding this comment.
export declare function log(dataOffset: usize, length: i32, numberOfTopics: i32, topic1: usize, topic2: usize, topic3: usize, topic4: usize): void;
No description provided.