Merge branch 'release/v1.20.0' into raulk/hyperspace-nv20-migration

This commit is contained in:
Raúl Kripalani
2023-02-14 11:27:55 +00:00
5 changed files with 32 additions and 1 deletions
+8
View File
@@ -107,6 +107,14 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
}
}
// This isn't strictly necessary, but the underlying VM will assume that the message is
// valid and may not return helpful debugging information. Checking here makes message
// validity issues easier to debug.
nv := sm.GetNetworkVersion(ctx, ts.Height())
if err := msg.ValidForBlockInclusion(0, nv); err != nil {
return nil, xerrors.Errorf("message not valid for network version %d: %w", nv, err)
}
// Unless executing on a specific state cid, apply all the messages from the current tipset
// first. Unfortunately, we can't just execute the tipset, because that will run cron. We
// don't want to apply miner messages after cron runs in a given epoch.
+1
View File
@@ -0,0 +1 @@
608060405234801561001057600080fd5b5060b58061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063b6baffe314602d575b600080fd5b60336047565b604051603e91906066565b60405180910390f35b600044905090565b6000819050919050565b606081604f565b82525050565b6000602082019050607960008301846059565b9291505056fea2646970667358221220c113f1abaabaed6a0324d363896b0d15a8bca7b9a540948a5be5b636a12a534f64736f6c63430008110033
+9
View File
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.17;
contract GetDifficulty {
function getDifficulty () public view returns (uint256) {
return block.difficulty;
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ func TestEthFeeHistory(t *testing.T) {
defer cancel()
// Wait for the network to create 20 blocks
<-time.After(20 * blockTime)
client.WaitTillChain(ctx, kit.HeightAtLeast(20))
history, err := client.EthFeeHistory(ctx, result.Wrap[jsonrpc.RawParams](
json.Marshal([]interface{}{5, "0x10"}),
+13
View File
@@ -855,3 +855,16 @@ func TestFEVMProxyUpgradeable(t *testing.T) {
_, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "test()", []byte{})
require.NoError(t, err)
}
func TestFEVMGetBlockDifficulty(t *testing.T) {
ctx, cancel, client := kit.SetupFEVMTest(t)
defer cancel()
//install contract
filenameActor := "contracts/GetDifficulty.hex"
fromAddr, contractAddr := client.EVM().DeployContractFromFilename(ctx, filenameActor)
ret, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, contractAddr, "getDifficulty()", []byte{})
require.NoError(t, err)
require.Equal(t, len(ret), 32)
}