Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

update ref-fvm #209

Closed
wants to merge 9 commits into from
Closed
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build_mock_api:
./bin/solc @zondax/solidity-bignumber=${PWD}/node_modules/@zondax/solidity-bignumber/ solidity-cborutils=${PWD}/node_modules/solidity-cborutils/ @openzeppelin=${PWD}/node_modules/@openzeppelin/ @ensdomains=${PWD}/node_modules/@ensdomains/ contracts/v0.8/mocks/MinerMockAPI.sol --output-dir ./build/v0.8/mocks --overwrite --bin --hashes --opcodes --abi

build_builtin_actors:
cd testing/builtin-actors && make bundle-devnet-wasm
cd testing/builtin-actors && make bundle-hyperspace

get_method_nums:
cd script && cargo r
Expand Down
10 changes: 6 additions & 4 deletions contracts/v0.8/AccountAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ library AccountAPI {
function authenticateMessage(bytes memory target, AccountTypes.AuthenticateMessageParams memory params) internal {
bytes memory raw_request = params.serializeAuthenticateMessageParams();

bytes memory raw_response = Actor.call(AccountTypes.AuthenticateMessageMethodNum, target, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(AccountTypes.AuthenticateMessageMethodNum, target, raw_request, Misc.DAG_CBOR_CODEC,0, false);

bytes memory result = Actor.readRespData(raw_response);
require(result.length == 0, "unexpected response received");
Expand All @@ -47,7 +47,7 @@ library AccountAPI {
function authenticateMessage(uint64 target, AccountTypes.AuthenticateMessageParams memory params) internal {
bytes memory raw_request = params.serializeAuthenticateMessageParams();

bytes memory raw_response = Actor.callByID(target, AccountTypes.AuthenticateMessageMethodNum, Misc.CBOR_CODEC, raw_request, 0, false);
bytes memory raw_response = Actor.callByID(target, AccountTypes.AuthenticateMessageMethodNum, Misc.DAG_CBOR_CODEC, raw_request, 0, false);

bytes memory result = Actor.readRespData(raw_response);
require(result.length == 0, "unexpected response received");
Expand All @@ -58,7 +58,8 @@ library AccountAPI {
function universalReceiverHook(bytes memory target, AccountTypes.UniversalReceiverParams memory params) internal {
bytes memory raw_request = params.serializeUniversalReceiverParams();

bytes memory raw_response = Actor.call(AccountTypes.UniversalReceiverHookMethodNum, target, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(AccountTypes.UniversalReceiverHookMethodNum, target, raw_request, Misc.DAG_CBOR_CODEC, 0, false);


bytes memory result = Actor.readRespData(raw_response);
require(result.length == 0, "unexpected response received");
Expand All @@ -69,7 +70,8 @@ library AccountAPI {
function universalReceiverHook(uint64 target, AccountTypes.UniversalReceiverParams memory params) internal {
bytes memory raw_request = params.serializeUniversalReceiverParams();

bytes memory raw_response = Actor.callByID(target, AccountTypes.UniversalReceiverHookMethodNum, Misc.CBOR_CODEC, raw_request, 0, false);
bytes memory raw_response = Actor.callByID(target, AccountTypes.UniversalReceiverHookMethodNum, Misc.DAG_CBOR_CODEC, raw_request, 0, false);


bytes memory result = Actor.readRespData(raw_response);
require(result.length == 0, "unexpected response received");
Expand Down
82 changes: 73 additions & 9 deletions contracts/v0.8/DataCapAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ library DataCapAPI {
function balance(bytes memory addr) internal returns (BigInt memory) {
bytes memory raw_request = addr.serializeAddress();

bytes memory raw_response = Actor.call(DataCapTypes.BalanceOfMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, true);
bytes memory raw_response = Actor.call(
DataCapTypes.BalanceOfMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
true
);


bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -73,7 +81,14 @@ library DataCapAPI {
function allowance(DataCapTypes.GetAllowanceParams memory params) internal returns (BigInt memory) {
bytes memory raw_request = params.serializeGetAllowanceParams();

bytes memory raw_response = Actor.call(DataCapTypes.AllowanceMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, true);
bytes memory raw_response = Actor.call(
DataCapTypes.AllowanceMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
true
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -83,7 +98,14 @@ library DataCapAPI {
function transfer(DataCapTypes.TransferParams memory params) internal returns (DataCapTypes.TransferReturn memory) {
bytes memory raw_request = params.serializeTransferParams();

bytes memory raw_response = Actor.call(DataCapTypes.TransferMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.TransferMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -93,7 +115,14 @@ library DataCapAPI {
function transferFrom(DataCapTypes.TransferFromParams memory params) internal returns (DataCapTypes.TransferFromReturn memory) {
bytes memory raw_request = params.serializeTransferFromParams();

bytes memory raw_response = Actor.call(DataCapTypes.TransferFromMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.TransferFromMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -103,7 +132,14 @@ library DataCapAPI {
function increaseAllowance(DataCapTypes.IncreaseAllowanceParams memory params) internal returns (BigInt memory) {
bytes memory raw_request = params.serializeIncreaseAllowanceParams();

bytes memory raw_response = Actor.call(DataCapTypes.IncreaseAllowanceMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.IncreaseAllowanceMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -113,7 +149,14 @@ library DataCapAPI {
function decreaseAllowance(DataCapTypes.DecreaseAllowanceParams memory params) internal returns (BigInt memory) {
bytes memory raw_request = params.serializeDecreaseAllowanceParams();

bytes memory raw_response = Actor.call(DataCapTypes.DecreaseAllowanceMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.DecreaseAllowanceMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -123,7 +166,14 @@ library DataCapAPI {
function revokeAllowance(DataCapTypes.RevokeAllowanceParams memory params) internal returns (BigInt memory) {
bytes memory raw_request = params.serializeRevokeAllowanceParams();

bytes memory raw_response = Actor.call(DataCapTypes.RevokeAllowanceMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.RevokeAllowanceMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -133,7 +183,14 @@ library DataCapAPI {
function burn(DataCapTypes.BurnParams memory params) internal returns (DataCapTypes.BurnReturn memory) {
bytes memory raw_request = params.serializeBurnParams();

bytes memory raw_response = Actor.call(DataCapTypes.BurnMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.BurnMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -143,7 +200,14 @@ library DataCapAPI {
function burnFrom(DataCapTypes.BurnFromParams memory params) internal returns (DataCapTypes.BurnFromReturn memory) {
bytes memory raw_request = params.serializeBurnFromParams();

bytes memory raw_response = Actor.call(DataCapTypes.BurnFromMethodNum, DataCapTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(
DataCapTypes.BurnFromMethodNum,
DataCapTypes.ActorID,
raw_request,
Misc.DAG_CBOR_CODEC,
0,
false
);

bytes memory result = Actor.readRespData(raw_response);

Expand Down
4 changes: 2 additions & 2 deletions contracts/v0.8/InitAPI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ library InitAPI {
function exec(InitTypes.ExecParams memory params) internal returns (InitTypes.ExecReturn memory) {
bytes memory raw_request = params.serializeExecParams();

bytes memory raw_response = Actor.call(InitTypes.ExecMethodNum, InitTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(InitTypes.ExecMethodNum, InitTypes.ActorID, raw_request, Misc.DAG_CBOR_CODEC, 0, false);

bytes memory result = Actor.readRespData(raw_response);

Expand All @@ -44,7 +44,7 @@ library InitAPI {
function exec4(InitTypes.Exec4Params memory params) internal returns (InitTypes.Exec4Return memory) {
bytes memory raw_request = params.serializeExec4Params();

bytes memory raw_response = Actor.call(InitTypes.Exec4MethodNum, InitTypes.ActorID, raw_request, Misc.CBOR_CODEC, 0, false);
bytes memory raw_response = Actor.call(InitTypes.Exec4MethodNum, InitTypes.ActorID, raw_request, Misc.DAG_CBOR_CODEC, 0, false);

bytes memory result = Actor.readRespData(raw_response);

Expand Down
Loading