From dfca41c98df63cdcc692bef8ba295e2626b2857e Mon Sep 17 00:00:00 2001 From: Tobias Lindahl Date: Thu, 2 May 2019 10:33:26 +0200 Subject: [PATCH 1/2] Correct arity for BLOCKHASH --- src/aeb_fate_generate_ops.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aeb_fate_generate_ops.erl b/src/aeb_fate_generate_ops.erl index 0631c13..5c224ca 100644 --- a/src/aeb_fate_generate_ops.erl +++ b/src/aeb_fate_generate_ops.erl @@ -104,7 +104,7 @@ ops_defs() -> , { 'ORIGIN', 16#5b, 1, false, 3, [a], origin, "Arg0 := Address of contract called by the call transaction."} , { 'CALLER', 16#5c, 1, false, 3, [a], caller, "Arg0 := The address that signed the call transaction."} , { 'GASPRICE', 16#5d, 1, false, 3, [a], gasprice, "Arg0 := The current gas price."} - , { 'BLOCKHASH', 16#5e, 1, false, 3, [a], blockhash, "Arg0 := The current blockhash."} %% TODO: Do we support has at height? + , { 'BLOCKHASH', 16#5e, 2, false, 3, [a, a], blockhash, "Arg0 := The blockhash at height."} , { 'BENEFICIARY', 16#5f, 1, false, 3, [a], beneficiary, "Arg0 := The address of the current beneficiary."} , { 'TIMESTAMP', 16#60, 1, false, 3, [a], timestamp, "Arg0 := The current timestamp. Unrelaiable, don't use for anything."} , { 'GENERATION', 16#61, 1, false, 3, [a], generation, "Arg0 := The block height of the cureent generation."} -- 2.30.2 From 31d188ce818e1da343ae6ec6fc662323b9c1cca6 Mon Sep 17 00:00:00 2001 From: Tobias Lindahl Date: Thu, 2 May 2019 10:52:07 +0200 Subject: [PATCH 2/2] Update test of BLOCKHASH to correct arity --- test/asm_code/all_instructions.fate | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/asm_code/all_instructions.fate b/test/asm_code/all_instructions.fate index b0509c1..1cdfeb0 100644 --- a/test/asm_code/all_instructions.fate +++ b/test/asm_code/all_instructions.fate @@ -156,7 +156,7 @@ FUNCTION foo () : {tuple, []} GASPRICE arg119 - BLOCKHASH arg110 + BLOCKHASH a arg110 BENEFICIARY var163 @@ -235,4 +235,3 @@ FUNCTION foo () : {tuple, []} BALANCE_OTHER a arg0 SETELEMENT a 2 (1, "two", 3) 2 - \ No newline at end of file -- 2.30.2