diff --git a/packages/neo-one-client-full-common/src/__data__/models.ts b/packages/neo-one-client-full-common/src/__data__/models.ts index 8fffd94f32..c132392939 100644 --- a/packages/neo-one-client-full-common/src/__data__/models.ts +++ b/packages/neo-one-client-full-common/src/__data__/models.ts @@ -1,4 +1,4 @@ -import { common, ContractParameterTypeModel, ECPoint, UInt160 } from '@neo-one/client-common'; +import { common, ContractParameterTypeModel, ECPoint, UInt160, WildcardContainer } from '@neo-one/client-common'; import { constants } from '@neo-one/utils'; import { ContractABIModel, @@ -110,12 +110,13 @@ export const contractPermissionModel = ( ) => new ContractPermissionModel({ contract: contractPermissionDescriptorModel(hashOrGroupType), methods }); export const contractManifestModel = ( + name: string = 'name1', groups: readonly ContractGroupModel[] = [contractGroupModel()], abi: ContractABIModel = contractAbiModel(), permissions: readonly ContractPermissionModel[] = [contractPermissionModel('uint160', ['method1'])], - trusts: readonly UInt160[] = [common.bufferToUInt160(Buffer.alloc(20, 1))], + trusts: WildcardContainer = [contractPermissionDescriptorModel('uint160')], supportedStandards: readonly string[] = [], -) => new ContractManifestModel({ groups, supportedStandards, abi, permissions, trusts }); +) => new ContractManifestModel({ name, groups, supportedStandards, abi, permissions, trusts }); // TODO: fixup export const contractModel = ( diff --git a/packages/neo-one-client-full-common/src/__tests__/models/__snapshots__/ContractManifestModel.test.ts.snap b/packages/neo-one-client-full-common/src/__tests__/models/__snapshots__/ContractManifestModel.test.ts.snap index 84602f7915..89477e8eb0 100644 --- a/packages/neo-one-client-full-common/src/__tests__/models/__snapshots__/ContractManifestModel.test.ts.snap +++ b/packages/neo-one-client-full-common/src/__tests__/models/__snapshots__/ContractManifestModel.test.ts.snap @@ -14,43 +14,45 @@ Object { ], }, ], - "hash": "0x0101010101010101010101010101010101010101", "methods": Array [ Object { "name": "function", - "offset": undefined, + "offset": 0, "parameters": Array [ Object { "name": "param", "type": "Boolean", }, ], - "returnType": "Void", + "returntype": "Void", + "safe": true, }, ], }, "extra": undefined, + "features": Object {}, "groups": Array [ Object { "publicKey": "0248be3c070df745a60f3b8b494efcc6caf90244d803a9a72fe95d9bae2120ec70", "signature": "ccaab040cc25021c91567b75db4778853441869157b8f6aad960cdcf1069812480027a528ca9b98e2205027de20696f848cf81824eeb7af1d5110870870ceb67", }, ], + "name": "name1", "permissions": Array [ Object { - "contract": "0x0101010101010101010101010101010101010101", + "contract": Object { + "hash": "0x0101010101010101010101010101010101010101", + }, "methods": Array [ "method1", ], }, ], - "safeMethods": Array [ - "method1", - "method2", - ], - "supportedStandards": Array [], + "supportedstandards": Array [], "trusts": Array [ - "0x0101010101010101010101010101010101010101", + Object { + "hash": "0x0101010101010101010101010101010101010101", + }, ], } `;