Skip to content

Commit

Permalink
fix(client): fix trusts types through client and compiler (#2479) (#2497
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ftgibran authored Jun 28, 2021
1 parent 9429955 commit 3776008
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
7 changes: 4 additions & 3 deletions packages/neo-one-client-full-common/src/__data__/models.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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> = [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 = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
],
}
`;

0 comments on commit 3776008

Please sign in to comment.