-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #346 from multiversx/feat/factories
Merge feat/factories into feat/next
- Loading branch information
Showing
30 changed files
with
2,891 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { BigNumber } from "bignumber.js"; | ||
|
||
export class DraftTransaction { | ||
public sender: string; | ||
public receiver: string; | ||
public gasLimit: BigNumber.Value; | ||
public value: BigNumber.Value; | ||
public data: Uint8Array; | ||
|
||
public constructor(options: { | ||
sender: string, | ||
receiver: string, | ||
gasLimit: BigNumber.Value, | ||
value?: BigNumber.Value, | ||
data?: Uint8Array | ||
}) { | ||
this.sender = options.sender; | ||
this.receiver = options.receiver; | ||
this.gasLimit = options.gasLimit; | ||
this.value = options.value ?? 0; | ||
this.data = options.data ?? new Uint8Array(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { assert } from "chai"; | ||
import { CodeMetadata } from "./codeMetadata"; | ||
|
||
describe("test code metadata", function () { | ||
it("should test code metadata from bytes", () => { | ||
const bytes = new Uint8Array([1, 0]); | ||
const codeMetadata = CodeMetadata.fromBytes(bytes); | ||
|
||
assert.equal(codeMetadata.toString(), "0100"); | ||
assert.deepEqual(codeMetadata.toJSON(), { | ||
upgradeable: true, | ||
readable: false, | ||
payable: false, | ||
payableBySc: false | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.