Skip to content

Commit

Permalink
feat: support CERES protocol version
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankrol authored and davidyuk committed Jan 23, 2023
1 parent 481f1f8 commit 8960a91
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/aeternity_node_mean16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ chain:
persist: false
hard_forks:
"1": 0
"5": 1
"6": 1

mining:
autostart: true
Expand Down
1 change: 1 addition & 0 deletions src/tx/builder/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const NAME_BID_RANGES = mapObject({

export enum ConsensusProtocolVersion {
Iris = 5,
Ceres = 6,
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/tx/builder/field-types/ct-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ export const ProtocolToVmAbi = {
vmVersion: [], abiVersion: [AbiVersion.NoAbi, AbiVersion.Fate],
},
},
[ConsensusProtocolVersion.Ceres]: {
'contract-create': {
vmVersion: [VmVersion.Fate2], abiVersion: [AbiVersion.Fate],
},
'contract-call': {
vmVersion: [], abiVersion: [AbiVersion.Fate],
},
'oracle-call': {
vmVersion: [], abiVersion: [AbiVersion.NoAbi, AbiVersion.Fate],
},
},
} as const;

export interface CtVersion {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe('Node Chain', () => {
.foo(v, { nonce: nextNonce + idx, gasLimit, combine: true })),
)).map((r) => r.decodedResult);
expect(results).to.be.eql(numbers.map((v) => BigInt(v * 100)));
expect(httpSpy.args.length).to.be.equal(1);
expect(httpSpy.args.length).to.be.equal(2);
httpSpy.restore();
});
});

0 comments on commit 8960a91

Please sign in to comment.