Skip to content

Commit df52d36

Browse files
committed
replace koinos-proto-as submodule by a package and remove unnecessary files
1 parent 7800cd1 commit df52d36

21 files changed

+149
-1194
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "assembly/koinos-proto-as"]
2-
path = assembly/koinos-proto-as
3-
url = https://github.com/koinos/koinos-proto-as

__tests__/mockVM.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Arrays, Base58, MockVM, StringBytes, System } from "../assembly";
2-
import * as chain from '../assembly/koinos-proto-as/koinos/chain/chain';
3-
import * as protocol from '../assembly/koinos-proto-as/koinos/protocol/protocol';
4-
import * as authority from '../assembly/koinos-proto-as/koinos/chain/authority';
2+
import { chain, protocol, authority } from 'koinos-proto-as';
3+
54

65
const mockAccount = Base58.decode('1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe');
76
const mockAccount2 = Base58.decode('1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqE');

__tests__/systemCalls.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Arrays, Base58, MockVM, StringBytes, System, Crypto, Base64 } from "../assembly";
2-
import * as chain from '../assembly/koinos-proto-as/koinos/chain/chain';
3-
import * as protocol from '../assembly/koinos-proto-as/koinos/protocol/protocol';
4-
import * as authority from '../assembly/koinos-proto-as/koinos/chain/authority';
2+
import { chain, protocol, authority } from 'koinos-proto-as';
3+
54
import * as TestObject from "./test";
65

76
const mockAccount = Base58.decode('1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe');

__tests__/token.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Base58, MockVM, Protobuf, StringBytes, Token } from "../assembly";
2-
import * as token from '../assembly/koinos-proto-as/koinos/contracts/token/token';
2+
import { token } from 'koinos-proto-as';
3+
34

45
const mockTokenContractIdAccount = Base58.decode('1DQzuCcTKacbs9GGScFTU1Hc8BsyARTPqe');
56
const mockAccount1 = Base58.decode('1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe');

assembly/index.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
import 'wasi';
22
export { Protobuf } from 'as-proto';
33
export { u128, u128Safe } from 'as-bignum';
4+
export * from 'koinos-proto-as';
45

5-
export { System } from './systemCalls';
6+
export * from './systemCalls';
67
export * from './util';
7-
8-
export * from './koinos-proto-as/google/protobuf/any';
9-
10-
export * from './koinos-proto-as/koinos/chain/authority';
11-
export * from './koinos-proto-as/koinos/chain/chain';
12-
export * from './koinos-proto-as/koinos/chain/events';
13-
export * from './koinos-proto-as/koinos/chain/object_spaces';
14-
export * from './koinos-proto-as/koinos/chain/system_call_ids';
15-
export * from './koinos-proto-as/koinos/chain/system_calls';
16-
export * from './koinos-proto-as/koinos/chain/value';
17-
18-
export * from './koinos-proto-as/koinos/protocol/protocol';
19-
20-
export * from './koinos-proto-as/koinos/contracts/pow/pow';
21-
export * from './koinos-proto-as/koinos/contracts/resources/resources';
22-
export * from './koinos-proto-as/koinos/contracts/token/token';
23-
24-
export * from './koinos-proto-as/koinos/common';
25-
export * from './koinos-proto-as/koinos/options';

assembly/koinos-proto-as

Lines changed: 0 additions & 1 deletion
This file was deleted.

assembly/systemCalls.ts

Lines changed: 41 additions & 46 deletions
Large diffs are not rendered by default.

assembly/util/mockVM.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { Protobuf } from "as-proto";
22
import { System } from "../systemCalls";
3-
import * as authority from "../koinos-proto-as/koinos/chain/authority";
4-
import * as chain from "../koinos-proto-as/koinos/chain/chain";
5-
import * as system_calls from "../koinos-proto-as/koinos/chain/system_calls";
6-
import * as protocol from "../koinos-proto-as/koinos/protocol/protocol";
7-
import * as value from "../koinos-proto-as/koinos/chain/value";
3+
import { system_calls, chain, protocol, authority, value } from 'koinos-proto-as';
4+
85

96
export namespace MockVM {
107
export const METADATA_SPACE = new chain.object_space(true, null, 0);

assembly/util/space.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { System } from '../systemCalls';
2-
import { object_space } from '../koinos-proto-as/koinos/chain/chain';
2+
import { chain } from 'koinos-proto-as';
33
import { Protobuf, Reader, Writer } from 'as-proto';
44
import { StringBytes } from './stringBytes';
55

@@ -10,7 +10,7 @@ export namespace Space {
1010
}
1111

1212
export class Space<TKey, TValue> {
13-
private space: object_space;
13+
private space: chain.object_space;
1414
private valueDecoder: (reader: Reader, length: i32) => TValue;
1515
private valueEncoder: (message: TValue, writer: Writer) => void;
1616

@@ -34,7 +34,7 @@ export namespace Space {
3434
valueDecoder: (reader: Reader, length: i32) => TValue,
3535
valueEncoder: (message: TValue, writer: Writer) => void,
3636
system: bool = false) {
37-
this.space = new object_space(system, contractId, spaceId);
37+
this.space = new chain.object_space(system, contractId, spaceId);
3838
this.valueDecoder = valueDecoder;
3939
this.valueEncoder = valueEncoder;
4040
}

assembly/util/token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Protobuf, System } from "..";
2-
import * as token from "../koinos-proto-as/koinos/contracts/token/token";
2+
import { token } from "koinos-proto-as";
33

44
enum entries {
55
name_entry = 0x82a3537f,

0 commit comments

Comments
 (0)