diff --git a/packages/native-utils/bench/hash.js b/packages/native-utils/bench/hash.js index 425c75c..98d72dc 100644 --- a/packages/native-utils/bench/hash.js +++ b/packages/native-utils/bench/hash.js @@ -14,7 +14,7 @@ const DEFAULT_STATE = { challengeDuration: 1, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: diff --git a/packages/native-utils/bench/recover.js b/packages/native-utils/bench/recover.js index c46cb41..5d9b215 100644 --- a/packages/native-utils/bench/recover.js +++ b/packages/native-utils/bench/recover.js @@ -6,7 +6,7 @@ const PRIVATE_KEY = '0x111111111111111111111111111111111111111111111111111111111 const OUTCOME = [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: '0x0000000000000000000000000000000000000000000000000000000000000000', diff --git a/packages/native-utils/bench/sign.js b/packages/native-utils/bench/sign.js index 547f4e0..2e67707 100644 --- a/packages/native-utils/bench/sign.js +++ b/packages/native-utils/bench/sign.js @@ -6,7 +6,7 @@ const PRIVATE_KEY = '0x111111111111111111111111111111111111111111111111111111111 const OUTCOME = [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: '0x0000000000000000000000000000000000000000000000000000000000000000', diff --git a/packages/native-utils/common/src/state.rs b/packages/native-utils/common/src/state.rs index 3d4f324..229b7ee 100644 --- a/packages/native-utils/common/src/state.rs +++ b/packages/native-utils/common/src/state.rs @@ -42,7 +42,7 @@ impl Tokenize for AssetOutcomeType { #[derive(Deserialize,PartialEq)] #[serde(rename_all = "camelCase")] pub struct AllocationAssetOutcome { - pub asset_holder_address: Address, + pub asset: Address, pub allocation_items: Vec, } @@ -74,7 +74,7 @@ impl Tokenize for Guarantee { #[derive(Deserialize,PartialEq)] #[serde(rename_all = "camelCase")] pub struct GuaranteeAssetOutcome { - pub asset_holder_address: Address, + pub asset: Address, pub guarantee: Guarantee, } @@ -96,12 +96,12 @@ pub enum AssetOutcome { impl Tokenize for AssetOutcome { fn tokenize(&self) -> Token { - let (asset_holder_address, encoded) = match self { - Self::AllocationAssetOutcome(o) => (o.asset_holder_address, o.encode()), - Self::GuaranteeAssetOutcome(o) => (o.asset_holder_address, o.encode()), + let (asset, encoded) = match self { + Self::AllocationAssetOutcome(o) => (o.asset, o.encode()), + Self::GuaranteeAssetOutcome(o) => (o.asset, o.encode()), }; Token::Tuple(vec![ - asset_holder_address.tokenize(), + asset.tokenize(), Bytes(encoded).tokenize(), ]) } diff --git a/packages/native-utils/tests/hash.test.ts b/packages/native-utils/tests/hash.test.ts index bf18a3d..fb74863 100644 --- a/packages/native-utils/tests/hash.test.ts +++ b/packages/native-utils/tests/hash.test.ts @@ -129,7 +129,7 @@ describe('encodeOutcome', () => { ...DEFAULT_STATE, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: @@ -149,7 +149,7 @@ describe('encodeOutcome', () => { ...DEFAULT_STATE, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: @@ -174,7 +174,7 @@ describe('encodeOutcome', () => { ...DEFAULT_STATE, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', guarantee: { targetChannelId: '0x0000000000000000000000000000000000000000000000000000000000000000', @@ -203,7 +203,7 @@ describe('hashOutcome', () => { ...DEFAULT_STATE, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: @@ -223,7 +223,7 @@ describe('hashOutcome', () => { ...DEFAULT_STATE, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: diff --git a/packages/native-utils/tests/recover.test.ts b/packages/native-utils/tests/recover.test.ts index 89c645f..2e1e73a 100644 --- a/packages/native-utils/tests/recover.test.ts +++ b/packages/native-utils/tests/recover.test.ts @@ -15,7 +15,7 @@ const DEFAULT_STATE: State = { challengeDuration: 1, outcome: [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: diff --git a/packages/native-utils/tests/sign.test.ts b/packages/native-utils/tests/sign.test.ts index d0faede..45b745a 100644 --- a/packages/native-utils/tests/sign.test.ts +++ b/packages/native-utils/tests/sign.test.ts @@ -39,7 +39,7 @@ describe('Sign state', () => { test('State with asset allocation outcome', async () => { const outcome = [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', allocationItems: [ { destination: @@ -71,7 +71,7 @@ describe('Sign state', () => { test('State with guarantee outcome', async () => { const outcome = [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', guarantee: { targetChannelId: '0x0000000000000000000000000000000000000000000000000000000000000000', diff --git a/packages/native-utils/tests/transition.test.ts b/packages/native-utils/tests/transition.test.ts index c42731d..0ec5a48 100644 --- a/packages/native-utils/tests/transition.test.ts +++ b/packages/native-utils/tests/transition.test.ts @@ -4,7 +4,7 @@ import * as native from '..' const OUTCOME = [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', guarantee: { targetChannelId: '0x0000000000000000000000000000000000000000000000000000000000000000', @@ -137,7 +137,7 @@ describe('Validate state transitions', () => { test('Outcome mismatch mismatch fails', async () => { const otheroutcome = [ { - assetHolderAddress: '0x0000000000000000000000000000000000000000', + asset: '0x0000000000000000000000000000000000000000', guarantee: { targetChannelId: '0x0000000000000000000000000000000000000000000000000000000000000000',