Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
Merged
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
17 changes: 1 addition & 16 deletions packages/as-contracts/assembly/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,11 @@ export declare function ext_deposit_event(
data_len: i32
): void;

// Decodes the given buffer as a `T::Call` and adds it to the list
// of to-be-dispatched calls.
export declare function ext_dispatch_call(
call_ptr: i32,
call_len: i32
): void;

// Stores the amount of gas left into the scratch buffer.
export declare function ext_gas_left(): void;

// Stores the gas price for the current transaction into the scratch buffer.
export declare function ext_gas_price(): void;

// Retrieve the value under the given key from the **runtime** storage and return 0.
// If there is no entry under the given key then this function will return 1 and
// clear the scratch buffer.
export declare function ext_get_runtime_storage(
key_ptr: i32,
key_len: i32
): void;
export declare function ext_gas_price(gas: u64,): void;

// Retrieve the value under the given key from the storage or return 0.
export declare function ext_get_storage(
Expand Down
6 changes: 2 additions & 4 deletions packages/as-contracts/assembly/lib/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { numberToBytes } from '@substrate/as-utils';
// import {
// ext_call,
// ext_deposit_event,
// ext_dispatch_call,
// ext_get_runtime_storage,
// ext_instantiate,
// ext_restore_to,
// ext_return
Expand Down Expand Up @@ -90,8 +88,8 @@ export namespace contract {
* @description
* Returns the gas price for the current transaction.
*/
export function getGasPrice(): Uint8Array {
ext_gas_price();
export function getGasPrice(gas: u64): Uint8Array {
ext_gas_price(gas);
return storage.getScratchBuffer();
}

Expand Down