Closed forgetso closed 2 years ago
hey, will meanbeam support pallet-contracts in future? Our redspot-plugin https://docs.patract.io/en/redspot/plugin/redspot-known-types just pick the chain which contains pallet-contracts
module. If you are planning to use the pallet-contracts
in future, we can add your type in to this plugin
oh it seems that I miss understand what your mean. you add your config to know-types package, and try to test?
will meanbeam support pallet-contracts in future?
I don't know, I just wanted to get my existing redspot project working with a moonbeam development node. Is pallet-contracts required for the chain to work with redspot?
you add your config to know-types package, and try to test?
Yes, I've added the config to known types package in my fork. For example, in moonbeam.ts I have:
Collator: {
id: "AccountId",
bond: "Balance",
nominators: "Vec<Bond>",
total: "Balance",
state: "CollatorStatus",
},
However, it seems these type definitions are not passed through when using yarn test
like in the following example:
import {artifacts, network, patract} from "redspot";
import {expect} from "chai";
const {getContractFactory, getRandomSigner} = patract;
const {blake2AsHex, blake2AsU8a} = require('@polkadot/util-crypto');
const {stringToU8a} = require('@polkadot/util');
const {api, getAddresses, getSigners, createSigner, keyring} = network;
import "@redspot/known-types";
describe("PROSOPO", () => {
after(() => {
return api.disconnect();
});
// setup function called by all tests
async function setup() {
await api.isReady
const registry = api.registry;
const collatorDef = api.registry.getDefinition('Collator');
console.log(collatorDef); // prints undefined
process.exit();
//....tests
emm, redspot all api just support pallet-contracts interface, we have not design the support for pallet-evm. I think if you connect to moonbeam, maybe using ethereum tools is enough.
Yeah, I should probably use hardhat for this. Thanks for the advice.
Redspot Version 0.11.9-1
I have made some changes to redspot to add moonbeams types.
Added the moonbeam definitions: https://github.com/prosopo-io/redspot/blob/master/packages/redspot-known-types/src/moonbeam.ts
Imported moonbeam from apps-config: https://github.com/prosopo-io/redspot/blob/master/packages/redspot-known-types/src/chain.ts
Added moonbeam def into index.ts: https://github.com/prosopo-io/redspot/blob/master/packages/redspot-known-types/src/index.ts
I then changed my config to use only moonbeam:
When I run
yarn test
, I get a complaint about there not being a development network - which is correct. When I runyarn test --network moonbeam
, it successfully connects to my node:However, I still get a complaint about missing type data in node:
2021-09-09 14:35:17 METADATA: Unknown types found, no types for Collator, CollatorSnapshot, InflationInfo, Nominator, OrderedSet, RoundIndex, RoundInfo
Do I need to specify these types in the types section of my config as well as in this file?