Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LW-9418 hard fork proposal fixes #1135

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/Cardano/types/Governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type ParameterChangeAction = {
export type HardForkInitiationAction = {
__typename: GovernanceActionType.hard_fork_initiation_action;
governanceActionId: GovernanceActionId | null;
protocolVersion: ProtocolVersion;
protocolVersion: Pick<ProtocolVersion, 'major' | 'minor'>;
};

export type TreasuryWithdrawalsAction = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class HardForkInitiationAction {
writer.writeInt(GovernanceActionKind.HardForkInitiation);
this.#govActionId ? writer.writeEncodedValue(hexToBytes(this.#govActionId.toCbor())) : writer.writeNull();

writer.writeStartArray(1);
AngelCastilloB marked this conversation as resolved.
Show resolved Hide resolved
writer.writeEncodedValue(hexToBytes(this.#protocolVersion.toCbor()));

return writer.encodeAsHex();
Expand Down Expand Up @@ -79,10 +78,7 @@ export class HardForkInitiationAction {
govActionId = GovernanceActionId.fromCbor(HexBlob.fromBytes(reader.readEncodedValue()));
}

reader.readStartArray();
const protocolVersion = ProtocolVersion.fromCbor(HexBlob.fromBytes(reader.readEncodedValue()));
reader.readEndArray();

const action = new HardForkInitiationAction(protocolVersion, govActionId);
action.#originalBytes = cbor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HardForkInitiationAction } from '../../../../src/Serialization';
import { HexBlob } from '@cardano-sdk/util';

// Test data used in the following tests was generated with the cardano-serialization-lib
const cbor = HexBlob('830182582000000000000000000000000000000000000000000000000000000000000000000381820103');
const cbor = HexBlob('8301825820000000000000000000000000000000000000000000000000000000000000000003820103');
const core = {
__typename: Cardano.GovernanceActionType.hard_fork_initiation_action,
governanceActionId: { actionIndex: 3, id: '0000000000000000000000000000000000000000000000000000000000000000' },
Expand Down
Loading