Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Commit

Permalink
Make CounterfactulApp methods public (#2517)
Browse files Browse the repository at this point in the history
* Make CounterfactulApp methods public

* Make other methods public

* [apps] Alon/fix pulic tests (#2584)

* fix: Change function from external to public in NimApp

* chore: Yarn Build everything

* fix: Remove old `expected-build-artifacts`

My build folder had old contracts in it that was causing the `expected-build-artifacts` diff to succeed locally and fail on CI
  • Loading branch information
snario committed Nov 14, 2019
1 parent c949e28 commit be0f8ee
Show file tree
Hide file tree
Showing 41 changed files with 150 additions and 150 deletions.
20 changes: 10 additions & 10 deletions packages/apps/contracts/HighRollerApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ contract HighRollerApp is CounterfactualApp {
bytes32 actionHash;
}

function isStateTerminal(bytes calldata encodedState)
external
function isStateTerminal(bytes memory encodedState)
public
pure
returns (bool)
{
Expand All @@ -63,10 +63,10 @@ contract HighRollerApp is CounterfactualApp {

// NOTE: Function is being deprecated soon, do not modify!
function getTurnTaker(
bytes calldata encodedState,
address[] calldata participants
bytes memory encodedState,
address[] memory participants
)
external
public
pure
returns (address)
{
Expand All @@ -75,10 +75,10 @@ contract HighRollerApp is CounterfactualApp {
}

function applyAction(
bytes calldata encodedState,
bytes calldata encodedAction
bytes memory encodedState,
bytes memory encodedAction
)
external
public
pure
returns (bytes memory)
{
Expand Down Expand Up @@ -147,8 +147,8 @@ contract HighRollerApp is CounterfactualApp {
return abi.encode(nextState);
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (bytes memory)
{
Expand Down
18 changes: 9 additions & 9 deletions packages/apps/contracts/NimApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ contract NimApp is CounterfactualApp {
uint256[3] pileHeights;
}

function isStateTerminal(bytes calldata encodedState)
external
function isStateTerminal(bytes memory encodedState)
public
pure
returns (bool)
{
Expand All @@ -34,10 +34,10 @@ contract NimApp is CounterfactualApp {

// NOTE: Function is being deprecated soon, do not modify!
function getTurnTaker(
bytes calldata encodedState,
address[] calldata participants
bytes memory encodedState,
address[] memory participants
)
external
public
pure
returns (address)
{
Expand All @@ -46,9 +46,9 @@ contract NimApp is CounterfactualApp {
}

function applyAction(
bytes calldata encodedState, bytes calldata encodedAction
bytes memory encodedState, bytes memory encodedAction
)
external
public
pure
returns (bytes memory)
{
Expand All @@ -68,8 +68,8 @@ contract NimApp is CounterfactualApp {
return abi.encode(ret);
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (bytes memory)
{
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/contracts/SimpleTransferApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ contract SimpleTransferApp is CounterfactualApp {
LibOutcome.CoinTransfer[2] coinTransfers;
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (bytes memory)
{
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/contracts/SimpleTwoPartySwapApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ contract SimpleTwoPartySwapApp is CounterfactualApp {
LibOutcome.CoinTransfer[][] coinTransfers;
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (bytes memory)
{
Expand Down
18 changes: 9 additions & 9 deletions packages/apps/contracts/TicTacToeApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ contract TicTacToeApp is CounterfactualApp {
WinClaim winClaim;
}

function isStateTerminal(bytes calldata encodedState)
external
function isStateTerminal(bytes memory encodedState)
public
pure
returns (bool)
{
Expand All @@ -63,10 +63,10 @@ contract TicTacToeApp is CounterfactualApp {

// NOTE: Function is being deprecated soon, do not modify!
function getTurnTaker(
bytes calldata encodedState,
address[] calldata participants
bytes memory encodedState,
address[] memory participants
)
external
public
pure
returns (address)
{
Expand All @@ -75,9 +75,9 @@ contract TicTacToeApp is CounterfactualApp {
}

function applyAction(
bytes calldata encodedState, bytes calldata encodedAction
bytes memory encodedState, bytes memory encodedAction
)
external
public
pure
returns (bytes memory)
{
Expand Down Expand Up @@ -106,8 +106,8 @@ contract TicTacToeApp is CounterfactualApp {
return abi.encode(postState);
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (bytes memory)
{
Expand Down
20 changes: 10 additions & 10 deletions packages/apps/contracts/UnidirectionalLinkedTransferApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ contract UnidirectionalLinkedTransferApp is CounterfactualApp {
bytes32 preImage;
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (bytes memory)
{
return abi.encode(abi.decode(encodedState, (AppState)).transfers);
}

function applyAction(
bytes calldata encodedState,
bytes calldata encodedAction
bytes memory encodedState,
bytes memory encodedAction
)
external
public
pure
returns (bytes memory)
{
Expand Down Expand Up @@ -165,10 +165,10 @@ contract UnidirectionalLinkedTransferApp is CounterfactualApp {
}

function getTurnTaker(
bytes calldata encodedState,
address[] calldata participants
bytes memory encodedState,
address[] memory participants
)
external
public
pure
returns (address)
{
Expand All @@ -177,8 +177,8 @@ contract UnidirectionalLinkedTransferApp is CounterfactualApp {
];
}

function isStateTerminal(bytes calldata encodedState)
external
function isStateTerminal(bytes memory encodedState)
public
pure
returns (bool)
{
Expand Down
20 changes: 10 additions & 10 deletions packages/apps/contracts/UnidirectionalTransferApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ contract UnidirectionalTransferApp is CounterfactualApp {
}

function getTurnTaker(
bytes calldata encodedState,
address[] calldata participants
bytes memory encodedState,
address[] memory participants
)
external
public
pure
returns (address)
{
Expand All @@ -131,8 +131,8 @@ contract UnidirectionalTransferApp is CounterfactualApp {
];
}

function computeOutcome(bytes calldata encodedState)
external
function computeOutcome(bytes memory encodedState)
public
pure
returns (
bytes memory // Encoded version of a LibOutcome.CoinTransfer[2]
Expand All @@ -142,10 +142,10 @@ contract UnidirectionalTransferApp is CounterfactualApp {
}

function applyAction(
bytes calldata encodedState,
bytes calldata encodedAction
bytes memory encodedState,
bytes memory encodedAction
)
external
public
pure
returns (bytes memory)
{
Expand Down Expand Up @@ -210,8 +210,8 @@ contract UnidirectionalTransferApp is CounterfactualApp {

}

function isStateTerminal(bytes calldata encodedState)
external
function isStateTerminal(bytes memory encodedState)
public
pure
returns (bool)
{
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/expected-build-artifacts/CounterfactualApp.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/apps/expected-build-artifacts/HighRollerApp.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/apps/expected-build-artifacts/NimApp.json

Large diffs are not rendered by default.

0 comments on commit be0f8ee

Please sign in to comment.