-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
good first issueGood for newcomersGood for newcomersquestionFurther information is requestedFurther information is requested
Description
Problem
Error when build contracts when using Mapping<K,V,H> type where type V take more than one required constructor arguments.
Example contract
Using Uint8Array for mapping value, it takes length as mandatory constructor argument.
import {
AccountId, HashKeccak256, Mapping
} from "ask-lang";
@spreadLayout()
class Data {
map: Mapping<AccountId, Uint8Array, HashKeccak256> = new Mapping();
}
@contract()
export class Contract {
data: Data;
constructor() {
this.data = new Data();
}
@constructor()
default(): void {}
@message()
get(account: AccountId): Uint8Array {
// return new Uint8Array(0);
return this.data.map.get(account); // works if this line is commemted out.
}
}Error
$ ASK_CONFIG=./askconfig.json asc --config asconfig.json serialize.ts
ERROR TS2554: Expected 1 arguments, but got 0.
return instantiate<T>();
~~~~~~~~~~~~~~~~
in ~lib/as-serde-scale/misc.ts(21,20)
FAILURE 1 compile error(s)
error Command failed with exit code 1.Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersquestionFurther information is requestedFurther information is requested