Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.x - update submit work and contract.myMethod.send docs #6229

Merged
merged 7 commits into from
Jul 13, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,4 @@ Released with 1.0.0-beta.37 code base.

- Builds fixed by updating all typescript versions to 4.9.5 (#6238)
- ABI encoding for large negative `int`s (#6239)
- Updated type file for `submitWork` parameters, accepts 3 parameters instead of an array (#5200)
2 changes: 1 addition & 1 deletion docs/web3-eth-contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ methods.myMethod.send

.. code-block:: javascript

myContract.methods.myMethod([param1[, param2[, ...]]]).send(options[, callback])
myContract.methods.myMethod(param1, param2, ...).send(options[, callback])

Will send a transaction to the smart contract and execute its method. Note this can alter the smart contract state.

Expand Down
4 changes: 2 additions & 2 deletions docs/web3-eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2015,11 +2015,11 @@ Example

.. code-block:: javascript

web3.eth.submitWork([
web3.eth.submitWork(
luu-alex marked this conversation as resolved.
Show resolved Hide resolved
"0x0000000000000001",
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"
])
)
.then(console.log);
> true

Expand Down
4 changes: 3 additions & 1 deletion packages/web3-eth/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ export class Eth {
): Promise<string[]>;

submitWork(
data: [string, string, string],
nonce: string,
powHash: string,
digest: string,
callback?: (error: Error, result: boolean) => void
): Promise<boolean>;

Expand Down
12 changes: 5 additions & 7 deletions packages/web3-eth/types/tests/eth.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,19 +580,17 @@ eth.getWork();
eth.getWork((error: Error, result: string[]) => {});

// $ExpectType Promise<boolean>
eth.submitWork([
eth.submitWork(
'0x0000000000000001',
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
'0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000'
]);
);

// $ExpectType Promise<boolean>
eth.submitWork(
[
'0x0000000000000001',
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
'0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000'
],
'0x0000000000000001',
'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
'0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000',
(error: Error, result: boolean) => {}
);

Expand Down
Loading